Created
October 6, 2025 02:56
-
-
Save ipepe/b771e6d1ec22e0ad2fa8750aa0ac29f8 to your computer and use it in GitHub Desktop.
mcpblitz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # frozen_string_literal: true | |
| # encoding: utf-8 | |
| # Force UTF-8 encoding | |
| Encoding.default_external = Encoding::UTF_8 | |
| Encoding.default_internal = Encoding::UTF_8 | |
| APPLICATION_ID = ENV.fetch('WOT_API_APP_ID') | |
| require 'json' | |
| require 'logger' | |
| require 'fileutils' | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'rest-client', require: 'rest-client' | |
| gem 'fast-mcp', "~> 1.5", require: 'fast_mcp' | |
| end | |
| server = FastMcp::Server.new( | |
| name: 'mcp-blitz', | |
| version: '1.0.0' | |
| ) | |
| class Vehicles < FastMcp::Tool | |
| description "Method returns list of available vehicles." | |
| def call | |
| RestClient.get("https://api.wotblitz.eu/wotb/encyclopedia/vehicles/?application_id=#{APPLICATION_ID}&fields=name%2Ctier") | |
| end | |
| end | |
| class Vehicle < FastMcp::Tool | |
| description "Method returns vehicle configuration characteristics based on the specified module IDs." | |
| arguments do | |
| required(:id).filled(:integer).description("Vehicle ID") | |
| end | |
| def call(id:) | |
| tank_id = id | |
| RestClient.get("https://api.wotblitz.eu/wotb/encyclopedia/vehicleprofile/?application_id=#{APPLICATION_ID}&tank_id=#{tank_id}") | |
| end | |
| end | |
| class VehicleConfigurations < FastMcp::Tool | |
| description "Method returns vehicle configuration characteristics." | |
| arguments do | |
| required(:id).filled(:integer).description("Vehicle ID") | |
| end | |
| def call(id:) | |
| tank_id = id | |
| RestClient.get("https://api.wotblitz.eu/wotb/encyclopedia/vehicleprofiles/?application_id=#{APPLICATION_ID}&tank_id=#{tank_id}") | |
| end | |
| end | |
| class VehiclesModules < FastMcp::Tool | |
| description "Method returns list of available modules, such as guns, engines, etc." | |
| def call | |
| RestClient.get("https://api.wotblitz.eu/wotb/encyclopedia/modules/?application_id=#{APPLICATION_ID}") | |
| end | |
| end | |
| class VehicleModule < FastMcp::Tool | |
| description "Method returns module configuration characteristics based on the specified module IDs." | |
| arguments do | |
| required(:id).filled(:integer).description("Module ID") | |
| end | |
| def call(id:) | |
| module_id = id | |
| RestClient.get("https://api.wotblitz.eu/wotb/encyclopedia/moduleprofile/?application_id=#{APPLICATION_ID}&module_id=#{module_id}") | |
| end | |
| end | |
| server.register_tools( | |
| Vehicles, | |
| Vehicle, | |
| VehicleConfigurations, | |
| VehiclesModules, | |
| VehicleModule | |
| ) | |
| server.start | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment