MetaGraph-MCP
Enables enterprise AI agents to query governed data lineage, PII-aware schema documentation, and semantic metadata from SQL logs via MCP, with role-based access and vector search.
README
š MetaGraph-MCP
Autonomous Governance & Active Metadata Context Engine for Enterprise AI Agents
MetaGraph-MCP is a production-grade, active metadata ingestion and lineage engine built for enterprise AI context delivery. It parses SQL AST query execution logs into directed lineage graphs (DAGs), auto-documents datasets using autonomous LLM agents with PII detection, indexes semantic metadata into a standalone Qdrant Vector Database, and exposes governed context to AI agents via the Model Context Protocol (MCP).
šļø System Architecture
The system processes raw SQL and DDL metadata through an AST parser, enriches it with autonomous metadata and PII classification, stores semantic embeddings in Qdrant, and exposes governed context through MCP and REST APIs.
Cosine Similarity
$$ \operatorname{CosineSimilarity}(A,B)
\frac{\mathbf{A}\cdot\mathbf{B}} {|\mathbf{A}|,|\mathbf{B}|} $$
[ Raw SQL Logs / DDL Files ]
ā
ā¼
[ AST Parser Engine ]
ā
ā¼
[ Directed Lineage Graph (DAG) ]
ā
ā¼
[ Scribe Metadata Agent ]
ā
ā¼
[ PII Classifier & Confidence ]
ā
ā¼
[ Qdrant Vector DB ]
(RAG Embeddings)
ā
āāāāāāāā“āāāāāāā
ā¼ ā¼
[ Governed MCP ] [ Express REST API
Server & Swagger UI ]
ā ā
ā¼ ā¼
[ Claude Desktop / Cursor ] [ Enterprise AI Agents
& Humans ]
⨠Core Features
- AST-Based Lineage Ingestion: Parses raw SQL query logs and DDL statements using
node-sql-parserto construct an in-memory Directed Acyclic Graph (DAG) mapping upstream/downstream dependencies. - Autonomous Metadata Agent (Scribe): Leverages LLMs to generate column descriptions, flag sensitive PII data fields (
is_pii: true), and output confidence ratings (0.0 ā 1.0). - Vector RAG Engine (Qdrant): Embeds table definitions and column descriptions using
text-embedding-004and stores them in a Qdrant vector collection for fast natural-language semantic catalog search. - Governed MCP Server: Implements the official
@modelcontextprotocol/sdkoverstdiowith built-in RBAC rules, including PII redaction for non-ADMINagents. - CLI & OpenAPI Tools: Includes a command-line interface (
atlan-context) for local SQL batch ingestion and interactive Swagger documentation at/docs.
š Directory Structure
atlan-context-mcp/
āāā .env.example
āāā Dockerfile
āāā docker-compose.yml
āāā package.json
āāā README.md
āāā src/
āāā config/
ā āāā env.js # Environment variables & configuration
āāā core/
ā āāā ast-parser.js # SQL AST parsing & dependency extraction
ā āāā lineage-dag.js # Directed Graph data structure
ā āāā metadata-store.js # Persistent metadata state storage
ā āāā vector-store.js # Qdrant Vector Store integration
āāā agents/
ā āāā scribe-agent.js # Autonomous documentation & PII classifier
āāā mcp/
ā āāā server.js # Model Context Protocol Stdio Server
ā āāā tools/
ā āāā get-lineage.js
ā āāā get-governed-schema.js
ā āāā search-metadata.js # Semantic vector search (RAG)
āāā server/
ā āāā app.js # Express REST API & Swagger UI (/docs)
āāā cli/
āāā index.js # CLI runner (`atlan-context ingest`)
ā” Getting Started
1. Prerequisites
- Node.js >= 20.x
- Docker & Docker Compose
- Google Gemini API Key
2. Environment Setup
Create a .env file in the root directory:
GEMINI_API_KEY=your_gemini_api_key_here
PORT=3000
QDRANT_URL=http://localhost:6333
DOTENV_CONFIG_QUIET=true
3. Spin Up Infrastructure
Start the application and the Qdrant vector database container:
docker-compose up --build -d
4. Ingest Sample Data via CLI
Register table schema definitions:
node src/cli/index.js schema raw_orders order_id customer_email amount
node src/cli/index.js schema stg_orders order_id user_id amount
Ingest raw SQL transform queries:
node src/cli/index.js ingest ./sample.sql
5. Access Dashboards & Developer Documentation
- Swagger API Documentation:
http://localhost:3000/docs - REST Dashboard:
http://localhost:3000 - Qdrant Vector Dashboard:
http://localhost:6333/dashboard
š ļø MCP Protocol Integration
To connect this server to Claude Desktop or Cursor, add the following configuration to your MCP settings file (claude_desktop_config.json):
{
"mcpServers": {
"atlan-context": {
"command": "node",
"args": ["/path/to/atlan-context-mcp/src/mcp/server.js"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key_here",
"QDRANT_URL": "http://localhost:6333"
}
}
}
}
Exposed MCP Tools
| Tool Name | Parameters | Description |
|---|---|---|
get_table_lineage |
tableName |
Returns upstream dependency DAG for a target data asset. |
get_governed_schema |
tableName, userRole |
Returns table documentation with role-based PII masking. |
search_business_glossary |
query, topK |
Executes semantic vector RAG search over indexed metadata. |
š License
This project is licensed under the MIT License.
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.