catalog-mcp
catalog-mcp
あらゆるJSONカタログをAIエージェント向けのクエリツールに変えるMCPサーバー。
カタログのURLまたはファイルを指定するだけで(在庫フィード、商品リスト、feedmergeが公開するcatalog.jsonなど)、あらゆるMCPクライアント(Claude Desktop、Claude Code、プロトコルに対応したもの)が、レコードに対して構造化フィルタリング、グループ化、ランキング、スキーマ発見を行えるようになります。
Node 18以上。実行時の依存関係は2つ:MCP SDKとzod。
なぜ必要か
エージェントは大きなJSONファイルを扱うのが苦手で、ツールを使うのが得意です。エージェントに2MBのカタログを渡すと、レコードを切り詰めたり、スキミングしたり、幻覚を起こしたりします。しかし、フィルター文法を備えたcatalog_queryを渡せば、「$30,000未満でこれら2つの特徴を持つ最も安いレコード」という質問に、毎回正しく、条件に合うレコードだけを読んで答えます。
このリポジトリは、私が本番環境で稼働させているMCPサーバーの一般化版です。ある販売フロアのAIアシスタントが、まさにこれらのツール(同じフィルターセマンティクス、同じnull価格ルール、同じTTLキャッシュ)を使って、1日に何百回もライブの在庫カタログをクエリしています。そのパイプラインは以下の通りです:
vendor feed -> feedmerge -> catalog.json -> catalog-mcp -> any agent
(guarded sync) (versioned) (query tools)私はこれを自分の公開在庫フィードに対して実行しています。以下の例では、リポジトリが単独で動作するように中立なカタログを使用しています。
Related MCP server: mcp-db-server
クイックスタート
git clone https://github.com/stevyf93II/catalog-mcp.git
cd catalog-mcp
npm install
npm test # engine, loader, and stdio end-to-end tests
# serve the example catalog
node src/server.js --file examples/telescopes.json --key skuClaude Desktopに組み込む(claude_desktop_config.json):
{
"mcpServers": {
"my-catalog": {
"command": "node",
"args": ["/path/to/catalog-mcp/src/server.js"],
"env": {
"CATALOG_URL": "https://example.com/catalog.json",
"CATALOG_KEY": "sku"
}
}
}
}その後、エージェントに「カタログにはどのようなタイプがあり、それぞれの下限価格はいくらですか?」などと質問すると、エージェントがcatalog_schema、catalog_count_by、catalog_topを自ら組み合わせて答えます。
ツール
ツール | 説明 |
| レコードのフィルタリング、並べ替え、ページネーション、射影を行う |
| キーフィールドで1件のレコードを取得する |
| フィールドでグループ化してカウント(配列フィールドは各要素をカウント) |
| 数値フィールドで上位N件のレコードを取得(オプションでフィルター付き) |
| フィールドの個別値とそのカウントを取得 — フィルターをかける前にそのフィールドの語彙を学ぶ |
| レコードから推論されたスキーマ:型、カバレッジ、数値範囲、サンプル値 |
| レコード数、ソース、キャッシュ経過時間、オプションで数値の要約 |
すべてのツールは読み取り専用で冪等であり、その旨がMCPアノテーションに記載されています。
フィルター文法
query、count_by、topで使われる、1つの小さな仕様:
{
"eq": { "type": "reflector", "goto": true },
"min": { "aperture_mm": 150 },
"max": { "price": 1000 },
"has": { "features": ["Parabolic Mirror", "Cooling Fan"] },
"contains": { "name": "dobsonian" }
}eq— 任意の値(真偽値やnullも含む)との厳密な等価比較。min/max— 数値の範囲。対象フィールドに実数がないレコードは除外されます。このルールは重要です。本番カタログでは、価格がないことは「価格はお問い合わせください」を意味し、「$30,000未満のユニットを表示」というクエリは、価格が不明なユニットを決して表面化してはいけません。has— 配列のメンバーシップ。リストされた値がすべて存在しなければなりません。contains— 文字列フィールドに対する大文字小文字を区別しない部分文字列検索。フィールド"*"はレコード内のすべての文字列フィールドを検索します。
条件はANDで結合されます。未知のトップレベルキーは、有効なキーを列挙するエラーになります。なぜなら、フィルターが黙って無視されると、エージェントが自信満々に間違った答えを報告するからです。
並べ替えは、ソートフィールドがないレコードを両方向で末尾に追いやります。「価格順に並べる」と、価格のあるレコードが最初に表示され、nullの壁が表示されることはありません。
設定
環境変数 | フラグ | 意味 |
|
| HTTP(S)経由のカタログ(url/fileのいずれか一方のみ) |
|
| ディスク上のカタログ |
|
| レコード配列へのドットパス(例: |
|
|
|
|
| フェッチキャッシュのTTL(秒)(デフォルト |
CATALOG_RECORDS_PATHが設定されていない場合、ローダーはドキュメントルートが配列であればそれを使用し、そうでなければオブジェクトのトップレベル配列が1つだけあればそれを使用します({ "meta": ..., "items": [...] }はそのまま動作します)。ドキュメントが曖昧な場合は拒否し、候補となるキーを列挙します。
リフレッシュに失敗した場合、サーバーはエラーにする代わりに最後に正常に読み込んだデータを提供します。タスク中のエージェントは、例外よりも5分前のレコードの方が良いからです。また、catalog_statsはキャッシュの経過時間を報告するため、古さが隠されることはありません。
非目標
データベースではありません。カタログは読み取り専用でメモリ上に存在します。データがJSONファイルに快適に収まらない場合は、本物のストアが必要です。
書き込みはありません。ここでカタログを変更することはありません。それは同期パイプラインの役割です(feedmergeを参照)。
クエリ言語はありません。5つのフィルターキーでエージェントが実際に尋ねる質問はカバーできます。それ以上凝ったものは、ツールスキーマではなくコードに属します。
ライセンス
MIT
Available Tools
7 toolscatalog_count_byCount records by fieldARead-onlyIdempotent
Group records by a field and count each value, most common first. Array fields count each element. Optional filter applies first.
Inputs: field (required), filter.
catalog_getGet one record by keyARead-onlyIdempotent
Fetch a single record by its key field ("id"). Returns { found, record }.
Inputs: key (required), fields.
catalog_queryQuery the catalogARead-onlyIdempotent
Filter, sort, and page through catalog records. Returns { count, total_matching, total_records, records }. Use catalog_schema first if you are unsure which fields exist. Example: filter {"eq":{"condition":"used"},"max":{"price":30000},"has":{"features":["Solar"]}}, sort_by "price".
Inputs: limit, fields, filter, offset, +2 more.
catalog_schemaInferred catalog schemaARead-onlyIdempotent
Field inventory inferred from the records themselves: type, coverage, numeric min/max, and sample values for categorical fields. Call this first when exploring an unfamiliar catalog.
Inputs: no named parameters.
catalog_statsCatalog totals and freshnessARead-onlyIdempotent
Record count, source, cache age, and optional numeric summaries (count/min/max/mean/median) for the fields you name.
Inputs: refresh, numeric_fields.
catalog_topTop N records by a numeric fieldARead-onlyIdempotent
Rank records by a numeric field with an optional filter. Example: sort_by "price", sort_dir "asc", filter {"has":{"features":["Bunkhouse"]}} = cheapest records with that feature.
Inputs: sort_by (required), limit, fields, filter, +1 more.
catalog_valuesDistinct values of a fieldARead-onlyIdempotent
All distinct values of a field with occurrence counts, most common first. The reliable way to learn a categorical field's vocabulary before filtering on it.
Inputs: field (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
catalog_values and catalog_count_by both return per-value occurrence counts, catalog_top is essentially a sorted special case of catalog_query, and catalog_stats overlaps with catalog_schema's min/max summaries. Each tool has a slightly different focus, but the boundaries are fuzzy enough that an agent could easily misselect.
All tool names share the catalog_ prefix and snake_case, so the namespace is predictable. The suffixes are not uniformly verb_noun—schema/stats/values are nouns while get/query/count_by/top are verb-like—so it is mostly consistent rather than perfectly patterned.
Seven tools is a well-scoped size for a catalog exploration server: enough for schema discovery, statistics, filtering, record retrieval, grouping, and value enumeration without bloat.
For a read-only catalog/exploration domain, the set covers the full workflow: understand the schema, inspect summary statistics, learn field vocabulary, filter/sort/page records, fetch by id, and aggregate/rank. No obvious dead-end operation is missing.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
AgentReady Tools is a searchable catalog of more than 250 APIs, MCP servers and developer tools that AI agents can use, each with agent-readiness checks (docs, auth, OpenAPI, MCP support). Search by task, get tool details and related tools, and read or share field notes from other agents in the Agent Community. Remote MCP endpoint: https://agentready-tools.com/mcp
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAn integration layer for AI agents that provides a catalog of tools from various sources (OpenAPI, GraphQL, MCP, etc.) and can be used as an MCP server for compatible agents.4,778MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language to SQL query support.19-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to explore, search, and query API definitions from OpenAPI/Swagger JSON files.MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to generate, search, and reason over knowledge graphs from code, databases, docs, and open-data portals without requiring an LLM or API key.2Apache 2.0