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 Serveranalyze 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: Stream 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 toolsanalyzeEngine 解析C
SFENを解析して候補手(MultiPV)・評価値・PVを返す
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | ||
| forceMove | No | ||
| multipv | No | ||
| sfen | Yes | ||
| threads | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool returns data (candidate moves, evaluations, PV) but doesn't describe performance characteristics (e.g., computation time, resource usage), error handling, or any side effects. For an analysis tool with 5 parameters and no annotation coverage, this leaves significant gaps in understanding how the tool behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise—a single sentence in Japanese that efficiently conveys the core purpose. It's front-loaded with the main action ('analyze SFEN') and avoids any redundant information. Every word earns its place, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (5 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain the output format, how results are structured, or any limitations (e.g., depth/multipv constraints). While concise, it lacks the detail needed for an agent to effectively use this tool without additional context or trial-and-error.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate by explaining parameters. It only mentions 'SFEN' implicitly and doesn't describe any of the 5 parameters (sfen, depth, multipv, threads, forceMove) or their effects on the analysis. The description adds no meaningful semantic information beyond what the parameter names suggest, failing to address the coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: analyzing SFEN (Shogi Forsyth–Edwards Notation) to return candidate moves (MultiPV), evaluation values, and PV (principal variation). It uses specific verbs ('analyze' and 'return') and identifies the resource (SFEN positions). However, it doesn't explicitly differentiate from sibling tools like 'eval_at' or 'ping', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'eval_at'. It doesn't mention any prerequisites, constraints, or typical use cases (e.g., game analysis, move exploration). The agent must infer usage from the purpose alone, which is insufficient for effective tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
eval_at特定手の直後を評価C
現局面で特定の一手を指した先を解析して返す
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | ||
| move | Yes | ||
| multipv | No | ||
| sfen | Yes | ||
| threads | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions analysis and returning results, but lacks details on computational behavior (e.g., performance impact, rate limits), error handling, or output format. For a tool with 5 parameters and no output schema, this is insufficient to inform safe and effective usage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise—a single sentence that directly states the tool's function without any unnecessary words. It's front-loaded with the core purpose, making it efficient and easy to parse, though this conciseness comes at the cost of detail in other dimensions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover parameter meanings, behavioral traits, or output details, leaving significant gaps for an AI agent to understand how to invoke and interpret results from this tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description adds no semantic information about parameters like 'sfen,' 'move,' 'depth,' 'multipv,' or 'threads.' It doesn't explain what these parameters mean or how they affect the analysis, failing to compensate for the low schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'analyze and return the evaluation after a specific move in the current position.' It specifies the verb ('analyze') and resource ('current position after a specific move'), making the function understandable. However, it doesn't explicitly differentiate from sibling tools like 'analyze' or 'ping,' which could provide similar or related functionality, so it doesn't reach the highest score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'analyze' or 'ping,' nor does it specify prerequisites, exclusions, or optimal contexts for usage. This lack of comparative or contextual advice limits its effectiveness in tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
pingPingB
ヘルスチェック(常に pong を返す)
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool always returns 'pong,' which implies a read-only, non-destructive operation, but it doesn't cover aspects like error handling, latency, or side effects. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise—a single sentence in Japanese that directly states the tool's function. It's front-loaded with the key information ('health check') and avoids any redundant or verbose language, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (0 parameters, no output schema, simple purpose), the description is adequate but minimal. It covers the basic purpose and behavior but lacks details on usage context or advanced behavioral traits. With no annotations or output schema, it meets the minimum viable standard but could be more informative.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description doesn't add any parameter details, which is appropriate. Baseline is 4 for 0 parameters, as it avoids unnecessary repetition and focuses on the tool's purpose.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'ヘルスチェック(常に pong を返す)' translates to 'Health check (always returns pong).' This specifies the verb ('health check') and the resource/outcome ('always returns pong'), making it distinct from siblings like 'analyze' or 'eval_at.' However, it doesn't explicitly differentiate from potential similar tools (e.g., 'status' or 'health'), so it's not a perfect 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like system monitoring, connectivity testing, or prerequisites. Without any usage context, the agent must infer from the purpose alone, which is insufficient for optimal tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
analyze - First observed
eval_at - First observed
ping
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.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
AlicenseAqualityBmaintenanceMCP server that gives AI coding agents direct access to evaluation tools.22Apache 2.0- FlicenseNot gradedqualityDmaintenanceEnables deployment of MCP servers over HTTP, providing ready-to-use tools for text processing, math calculations, and social media content generation, accessible to AI assistants like GitHub Copilot and Claude.-
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to execute real-world actions through 10 specialized engines covering authenticated API calls, browser automation, visual QA, shell commands, file operations, job scraping, and parallel task execution.-
- AlicenseNot gradedqualityBmaintenanceMachine-readable utilities and datasets for AI agents. MCP + HTTP + x402.MIT