Shogi MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Shogi MCP Server analyze this shogi position: lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Shogi MCP Server
将棋AIエンジンのHTTP APIブリッジおよびMCP(Model Context Protocol)サーバー実装です。
https://github.com/user-attachments/assets/cdff97b9-d60f-411b-b81f-9cabd8e62
将棋AIエンジンのREST APIおよびMCP(Model Context Protocol)サーバー実装です。
現時点のLLMとUSI形式の将棋AIの統合し、指し手の説明をさせるためのサンプルプログラムです。
概要
このプロジェクトは、ネイティブの将棋エンジンバイナリをラップし、以下の2つのインターフェースを提供します:
HTTP API Bridge: HTTPエンドポイント経由での将棋局面解析
MCP Server: AIエージェント統合のためのModel Context Protocolサーバー
Related MCP server: Chess MCP
必要要件
Node.js 18.0.0以上
USIプロトコル対応の将棋エンジン
評価関数ファイル(nn.bin)
インストール
# リポジトリのクローン
git clone <repository-url>
cd shogi-mcp
# 依存関係のインストール
npm installセットアップ
将棋エンジンバイナリを
engine/engineに配置評価関数ファイルを
eval/nn.binに配置
使用方法
Claude Desktop
claude_desktop_config.jsonに以下を追記
"mcpServers": {
"shogi-mcp": {
"command": "ここにnodeのフルパスを追加",
"args": ["ここにmcp-server.mjsのフルパスを追加"],
"env": {
"REST_BASE": "http://localhost:8787"
}
}
}ブリッジサーバーの起動
npm run start:bridgeデフォルトでポート8787で起動します。
APIエンドポイント
GET /health
ヘルスチェック用エンドポイント
GET /analyze
局面解析エンドポイント
パラメータ:
sfen(必須): SFEN形式の局面depth: 探索深さ(デフォルト: 30、最大: 30)multipv: 候補手の数(デフォルト: 10、最大: 10)threads: 使用スレッド数(デフォルト: 1、最大: 8)forceMove: 指定した手を指した後の局面を解析
例:
curl "http://localhost:8787/analyze?sfen=lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL%20b%20-%201&depth=20&multipv=5"MCPサーバーの起動
npm run start:mcpMCPサーバーはstdio経由で通信し、以下のツールを提供します:
ping: 疎通確認analyze: 局面の完全解析(MultiPV)eval_at: 特定の手を指した後の局面評価
環境変数
変数名 | 説明 | デフォルト値 |
| 将棋エンジンのパス |
|
| ブリッジサーバーのポート |
|
| MCPサーバーが使用するブリッジAPIのベースURL |
|
| エンジン通信のデバッグログを有効化("1"で有効) | - |
| 評価関数ファイルのパス | - |
| 評価関数ディレクトリのパス | - |
プロジェクト構成
shogi-mcp/
├── src/
│ ├── core/
│ │ └── engine.js # USIプロトコルエンジンラッパー
│ └── servers/
│ ├── bridge-server.js # Express HTTP APIブリッジサーバー
│ └── mcp-server.mjs # MCPサーバー実装
├── engine/
│ └── engine # 将棋エンジンバイナリ
├── eval/
│ └── nn.bin # 評価関数(NNUEで実装)
├── package.json
└── README.md 開発
テスト
ブリッジAPIのテスト例:
# ヘルスチェック
curl http://localhost:8787/health
# 初期局面の解析
curl "http://localhost:8787/analyze?sfen=startpos&depth=15&multipv=3"トラブルシューティング
評価関数が読み込めない場合
環境変数で明示的にパスを指定してください:
EVAL_FILE=./eval/nn.bin EVAL_DIR=./eval npm run start:bridgeエンジンが起動しない場合
エンジンバイナリの実行権限を確認
chmod +x engine/engineエンジンパスを環境変数で指定
ENGINE_PATH=/path/to/engine npm run start:bridgeライセンス
MIT
Available Tools
3 toolsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: 'analyze' evaluates the current position, 'eval_at' analyzes a specific move from the current position, and 'ping' is a health check. There is no overlap in functionality, making tool selection unambiguous for an agent.
The naming is mostly consistent with a verb-based pattern ('analyze', 'eval_at', 'ping'), though 'eval_at' uses an underscore while the others do not, and 'ping' is a simple verb rather than a descriptive action. This minor deviation keeps the set readable but not perfectly uniform.
With only 3 tools, the set feels thin for a Shogi server, as it lacks operations like move generation, game state management, or board manipulation. While the tools cover core analysis, the count is borderline for the domain's potential scope.
The tool surface has significant gaps for a Shogi server: there are no tools for creating or modifying game states (e.g., making moves, resetting boards), accessing game history, or handling game rules. This incompleteness will likely cause agent failures in broader Shogi-related tasks.
Maintenance
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Human-input bridge for AI agents with voice-first answer links, MCP tools, and HTTP APIs.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Web search API and MCP server for developers building AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAn MCP bridge that provides an interface to UCI-compatible chess engines like Stockfish for analyzing positions and retrieving best moves. It enables users to interact with chess engines through commands for position management, engine information, and move calculation.3MIT
- AlicenseNot gradedqualityDmaintenanceA powerful chess engine and game server built with the Model Context Protocol (MCP). Play chess against AI, analyze positions, and integrate chess functionality into your AI applications.48 npm1ISC
- FlicenseAqualityDmaintenanceEnables chess analysis and move generation using the Stockfish engine via MCP tools, allowing clients to evaluate positions, get best moves, apply moves, and visualize boards.7-
- AlicenseAqualityBmaintenanceMCP chess runtime that lets LLMs play, analyze, and adapt strength by exposing Stockfish, human move likelihood (Maia3), and Lichess statistics, with the LLM handling strategy and the server handling computation.1331 npmAGPL 3.0