MCPgateway
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"filesystem": {
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"./files"
],
"command": "npx",
"description": "操作行",
"env": {}
},
"sqlite": {
"args": [
"mcp-server-sqlite",
"--db-path",
"./test.db"
],
"command": "uvx",
"description": "SQLite操作",
"env": {}
}
}
}
服务介绍
Parent MCP Server
複数子MCP一元管理親MCP
概要
複数子MCPfilesystem, sqlite 登録管理統一操作
1. 依存関係
uv sync
2. 子設定用意
children_config.example.json / children_abstract.example.json 実環境合編集
cp children_config.example.json children_config.json
cp children_abstract.example.json children_abstract.json
3. uvx起動推奨
GitHub公開後uvx直接起動
uvx --from git+https://github.com/OWNER/ParentMCPserver \
parent-mcp-server \
--children-config /absolute/path/to/children_config.json \
--children-abstract /absolute/path/to/children_abstract.json
4. 起動clone済場合
uv run python parent_server.py \
--children-config /absolute/path/to/children_config.json \
--children-abstract /absolute/path/to/children_abstract.json
設定例
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "./files"],
"env": {},
"description": "操作行"
},
"sqlite": {
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "./test.db"],
"env": {},
"description": "SQLite操作"
}
}
}
使用方法
使用場合
.mcp.json 以下設定OWNER自身GitHub置換
{
"mcpServers": {
"parent-manager": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/OWNER/ParentMCPserver",
"parent-mcp-server",
"--children-config",
"/absolute/path/to/children_config.json",
"--children-abstract",
"/absolute/path/to/children_abstract.json"
],
"env": {
"PYTHONUTF8": "1"
}
}
}
}
別使用場合
他 .mcp.json 同様設定上記同構成追加
重要: --children-config --children-abstract 実際絶対指定children-abstract未指定場合警告出children_abstract登録
提供
基本
list_registered_children()- 登録子一覧取得wake_child_and_get_schema(child_name)- 子起動取得execute_child_tool(child_name, tool_name, tool_args, head_chars=None, tail_chars=None)- 子実行長出力省略可能get_children_abstract()- 子概要JSON内容返--children-abstract指定時
管理
get_active_sessions()- 現在子一覧取得close_child_session(child_name)- 特定子閉check_child_session_health(child_name)- 健全性reconnect_child_session(child_name)- 強制的再接続
高度機能
環境変数 DEBUG_MCP=1 設定子stderr出力確認有効
DEBUG_MCP=1 uv run python parent_server.py \
--children-config /path/to/children_config.json \
--children-abstract /path/to/children_abstract.json
自動機能
接続失敗時自動的最大3回指数: 1秒2秒4秒
構造
ParentMCPserver/
parent_server.py #
children_config.example.json # 子設定
children_abstract.example.json # 子概要
example.mcp.json # .mcp.json設定例
pyproject.toml # 定義
.venv/ # 仮想環境uv sync作成
README.md #
Python環境見
uv sync
実行専用仮想環境作成
子起動
config.json設定確認- 子npx, uvx 利用可能確認
- 子依存関係確認