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).
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.
\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 ]
- 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.
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`)
- Node.js >= 20.x
- Docker & Docker Compose
- Google Gemini API Key
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=trueStart the application and the Qdrant vector database container:
docker-compose up --build -dRegister 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 amountIngest raw SQL transform queries:
node src/cli/index.js ingest ./sample.sql- Swagger API Documentation:
http://localhost:3000/docs - REST Dashboard:
http://localhost:3000 - Qdrant Vector Dashboard:
http://localhost:6333/dashboard
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"
}
}
}
}| 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. |
This project is licensed under the MIT License.