Context Catalog MCP

Context Catalog MCP

Exposes schema, lineage, and data-quality trust signals from a SQLite-backed catalog as MCP tools, enabling AI agents to answer grounded questions about datasets without hallucinating.

Category
访问服务器

README

Context Catalog MCP

A miniature version of an enterprise data catalog — schema, lineage, and data-quality "trust signals" — exposed as an MCP (Model Context Protocol) server, so an AI agent can answer questions about a dataset grounded in real metadata instead of guessing.

Why this project exists

Most AI-on-data demos stop at "ask a question, get a SQL answer." That's not where the hard problem is. The hard problem is: does the agent actually know what the data means, where a number came from, and whether it can be trusted — or is it confidently making it up?

This project builds the layer that answers that:

  • Schema + semantics — every table/column has a human-authored description, owner, and tags, separate from the raw data.
  • Lineage — derived metrics (like customer_ltv) expose their exact source columns and transformation logic. Raw columns are explicitly labeled as raw, not silently assumed.
  • Trust signals — every table gets a computed null rate, duplicate rate, freshness, and a High/Medium/Low trust label, from real checks against the data, not hardcoded values.
  • Refuses to hallucinate — every tool returns found: False with a clear message when something doesn't exist, instead of inventing a plausible-looking answer. This is tested explicitly in the eval harness.

Architecture

data/seed_data.py      → builds a small SQLite DB (customers, products,
                          orders, order_items) + a catalog_metadata table
                          (the semantic layer: descriptions, owners, lineage)

catalog_core.py         → the actual logic: schema lookup, lineage lookup,
                          data-quality scoring, catalog search. Plain
                          Python, no MCP dependency — single source of
                          truth used by everything else below.

catalog_server.py       → wraps catalog_core as 4 MCP tools, so any
                          MCP-compatible client (Claude Desktop, a custom
                          agent, etc.) can call them.

eval_harness.py         → 10 deterministic test cases against catalog_core
                          directly (no LLM, no API key needed) — checks
                          correctness AND checks that unknown
                          tables/columns are correctly refused rather
                          than hallucinated.

demo_client.py           → shows what an agent would see when calling the
                          tools for 5 realistic questions. Zero setup.

agent_demo.py            → optional: a real Claude-powered agent that takes
                          a plain English question, decides which tool(s)
                          to call, and answers grounded in the result.
                          Needs ANTHROPIC_API_KEY; everything else above
                          works without one.

How to run it

Requires Python 3.10+.

pip install -r requirements.txt
./run_demo.sh

That single command will:

  1. Seed the SQLite database with sample data (including intentional data quality issues, so the trust scoring has something real to catch).
  2. Run the eval harness and print a pass/fail report with accuracy %.
  3. Run the demo client, showing 5 realistic agent questions answered from the catalog.

Run the real MCP server

python3 catalog_server.py

To connect it to Claude Desktop, add to your MCP config:

{
  "mcpServers": {
    "context-catalog": {
      "command": "python3",
      "args": ["/absolute/path/to/catalog_server.py"]
    }
  }
}

Try the live LLM agent (optional)

export ANTHROPIC_API_KEY=sk-ant-...
python3 agent_demo.py "What does customer_ltv mean and can I trust the orders table?"

Eval results

10/10 passed  (100.0% accuracy)

Covers: correct schema/lineage/quality lookups for known entities, AND correct refusal (found: False) for unknown tables, unknown columns, and nonsense search queries — the hallucination-avoidance behavior is tested just as rigorously as the happy path.

Tech stack

Python, SQLite, the official mcp SDK, Anthropic API (optional, for the live agent demo). No external services, no cloud dependency — runs fully offline except for the optional agent demo.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选