MetaGraph-MCP

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.

Category
Visit Server

README

šŸš€ MetaGraph-MCP

Autonomous Governance & Active Metadata Context Engine for Enterprise AI Agents

License: MIT Node.js Docker MCP Protocol

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-parser to 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-004 and stores them in a Qdrant vector collection for fast natural-language semantic catalog search.
  • Governed MCP Server: Implements the official @modelcontextprotocol/sdk over stdio with built-in RBAC rules, including PII redaction for non-ADMIN agents.
  • 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured