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.
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: Falsewith 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:
- Seed the SQLite database with sample data (including intentional data quality issues, so the trust scoring has something real to catch).
- Run the eval harness and print a pass/fail report with accuracy %.
- 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.