tin-canMCP
tin-canMCP
ブローカーを備えた階層型カタログとして構成された大規模MCPサーバー(20以上のツール)を構築するための規定テンプレートです。
tin-canMCPサーバーは、カタログのサイズに関係なく、AIクライアントに対して正確に7つのツールのみを公開します。カタログ自体には数百のツールを含めることができますが、ブローカーが可視性を制御するため、AIは常にタスクに関連する限定されたサブセットのみを認識します。
このテンプレートを使用すべき場合
tin-canMCPは、多数のツール(CLIバイナリ、APIエンドポイント、AppleScriptコマンド、SDKメソッド)をラップするMCPを作成する場合に使用してください。ブローカーパターンにより、AIが認識するツール数をキャッシュに適した上限内に維持できます。
グループ化が不要で3〜10個のツールしか必要ない場合は、tin-canMCPを使用しないでください。単純なFastMCPサーバーの方が適しています。
Related MCP server: production-grade-mcp-agentic-system
すべてのサーバーが公開する7つのツール
ツール | 目的 |
| 現在の有効化状態とルーティングのヒントを表示 |
| カタログ内のすべてのグループを一覧表示 |
| 名前/説明でカタログ全体を検索(有効化不要) |
| グループ/階層を有効にしてツールを実行可能にする |
| 有効化範囲を次の階層に拡大(canonical → advanced → internal) |
| 現在実行可能なツールを表示 |
| 名前と引数を指定してアクティブなツールを実行 |
ドメインツールには catalog_run_tool を通じてのみアクセスできます。完全なワークフローについては HOW-TO-USE.md を参照してください。
クイックスタート
pip install -r requirements.txt
cp .env.example .env
# Scaffold a catalog for your domain
python scripts/scaffold_catalog.py \
--name mydomain \
--source cli \
--tools list,get,create,delete \
--out catalog-runtime \
--force
# Validate the registry is structurally sound
python scripts/validate_registry.py catalog-runtime
# Run the server
python main.py --transport=stdioこの時点でサーバーが読み込まれ、7つのブローカーツールが公開されます。catalog-runtime/registry/tools.json 内の TODO マーカーと、catalog-runtime/tools/ 配下のツールごとのマニフェストを埋めるまで、catalog_run_tool は実行を拒否します。
次へ: HOW-TO-USE.md を読んでください。ツールマニフェストの作成、グループ化戦略、階層の割り当てについて解説しています。
リポジトリ構成
.
├── app/
│ ├── catalog_runtime/ # Broker, loader, executor (DO NOT modify)
│ ├── tools/ # Registers the 7 broker MCP tools (DO NOT modify)
│ ├── prompts/ # Optional MCP prompts
│ ├── config.py # Env-backed settings
│ └── server.py # FastMCP server
├── catalog-runtime/
│ ├── registry/ # YOUR 7 registry JSON files — edit these
│ ├── tools/ # YOUR per-tool manifests — edit these
│ └── schema/ # JSON Schemas for registry files (reference)
├── scripts/
│ ├── scaffold_catalog.py # Generate a registry skeleton
│ └── validate_registry.py # Check invariants (run in CI)
├── ai-prompts/ # Master prompt + per-source hints for AI implementation
├── docs/
│ └── catalog-runtime-template.md # Full schema contract reference
├── main.py
└── HOW-TO-USE.md # Prescriptive authoring workflow設定
環境変数(.env またはシェル経由):
VAR_CATALOG_RUNTIME_DIR— カタログランタイムへのパス(デフォルト: リポジトリローカルのcatalog-runtime/)VAR_SERVER_NAME— クライアントに表示されるMCPサーバー名(デフォルト:tin-canMCP)VAR_COMMAND_TIMEOUT_SECONDS— ツールごとのタイムアウト(デフォルト:20)VAR_MAX_OUTPUT_CHARS— stdout/stderrの切り捨てしきい値(デフォルト:12000)MCP_TRANSPORT—stdio、sse、またはweb(デフォルト:stdio)
やってはいけないこと
app/tools/内のドメインツールに@mcp.tool()デコレータを追加しないでください。それはブローカーの目的を損ないます。代わりにカタログエントリを追加してください。max_tools_per_activationを15以上に設定しないでください。可視領域を制限することがこの設計の目的です。すべてのツールを
canonicalに入れないでください。ニッチなツールを後回しにするためにadvancedやinternal階層を使用してください。validate_registry.pyをスキップしないでください。相互参照のバグは静かに発生します。
謝辞
このテンプレートは、josharsh 氏によるMCPブローカーパターンの取り組みに触発されました。
ライセンス
MIT。LICENSE を参照してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Search, vet & assemble MCP servers from your agent: verified tools, risk labels, and trust scores.
Patterns for designing and reviewing AI skills, agents, and multi-agent workflows. Find guidance on context economy, delegation, verification, and tool design; inspect claims, worked examples, maturity labels, and source references. Five read-only tools let agents discover relevant patterns, compare concise cards, read specific sections, and explore relationships. Hosted Streamable HTTP at https://agentic-atlas.dev/mcp/ — no installation, account, or API key required. Browse the atlas at https://agentic-atlas.dev/.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA progressive-disclosure gateway for MCP servers that keeps tool lists small by exposing one top-level tool per server, allowing agents to search, list, inspect, and call underlying tools within a selected domain.14MIT
- AlicenseNot gradedqualityDmaintenanceA production-grade MCP server designed for multi-tenant, authenticated, and observable AI agent systems, enabling secure tool execution across heterogeneous data sources.66MIT
- FlicenseNot gradedqualityDmaintenanceProduction-grade FastMCP 3.x server template for scalable semantic tool retrieval, dynamic providers, paginated tool lists, and role-based progressive disclosure.-
- FlicenseNot gradedqualityCmaintenanceA browse-first MCP middleware that provides an LLM-friendly catalogue for discovering and invoking tools across multiple upstream MCP servers, reducing context overhead.-