Context Engineering GraphRAG MCP Server
Provides a pre-built Grafana dashboard for visualizing metrics, traces, and audit events from the system.
Emits OpenTelemetry traces for distributed tracing and observability, and can send them to an OpenTelemetry collector.
Provides vector storage and retrieval using PostgreSQL with the pgvector extension. Supports both in-process exact cosine search rebuilt from PostgreSQL and pgvector HNSW indexes for efficient similarity search.
Exposes Prometheus metrics for monitoring and includes a ServiceMonitor and SLO alerts for integration with Prometheus-based monitoring stacks.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Context Engineering GraphRAG MCP ServerSearch the supplier-risk collection and answer with citations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Context Engineering GraphRAG
Agentic RAG and GraphRAG context engineering for enterprise agents. Documents are chunked with exact provenance, screened for prompt injection and credentials, embedded, and turned into a temporal knowledge graph. Agents get hybrid retrieval, graph-aware context packs that fit a token budget, and answers in which every sentence is cited, checked for groundedness and released only when the governance policy allows it. Every decision and state change is recorded in a signed, tamper-evident audit chain.
Query -> Retrieval -> Reranking -> Context Budgeting -> Grounded ActionCapabilities
Capability | Implementation |
Ingestion | Fixed, sentence and recursive chunking with token overlap and exact character offsets; SHA-256 digests per document and chunk; document versions with |
Content controls | Prompt-injection screening per chunk with trust-dependent thresholds (quarantined chunks are never retrievable); credentials redacted before storage or embedding |
Hybrid retrieval | Okapi BM25 + dense vectors fused with reciprocal rank fusion; cross-encoder reranking (lexical or hosted |
Vector backends | In-process exact cosine search rebuilt from PostgreSQL, or pgvector HNSW ( |
Knowledge graph | Pattern or model-grounded entity and relation extraction; entity resolution (blocking, Jaro-Winkler, acronyms, union-find); assertions with |
GraphRAG | Hierarchical Louvain communities with extractive or model summaries; local search (personalised PageRank) and global search over community summaries |
Context engineering | Query-focused compression, near-duplicate removal, section budgets for passages, graph facts and community summaries; every source keeps provenance; spotlighted rendering |
Agentic workflow | Planner (passages, local, global), iterative retrieval with query expansion, attributed generation, groundedness evaluation, policy-gated release (answered, abstained, withheld, pending approval) |
Evaluation | Groundedness per claim (supported / partial / contradicted / unsupported), citation precision and coverage; retrieval recall, precision, MRR and nDCG against golden sets |
Identity and authorization | Every call authorized by agent-identity-fabric |
Agent protocols | MCP server (official SDK, streamable HTTP) with six typed tools; A2A Agent Card and JSON-RPC |
Audit and observability | Hash-chained Ed25519-signed audit events; Prometheus metrics, OpenTelemetry traces, JSON logs with correlation IDs, SLO alerts, Grafana dashboard |
Shared controls (policy engine, audit chain, content guard, model router, logging, telemetry) come from agentic-core.
Related MCP server: Modular RAG MCP Server
Quick start (local)
Requires Docker. No API keys or cloud credentials are needed: the stack uses the deterministic hashing embedder, PostgreSQL with pgvector, a mock OIDC issuer and an OpenTelemetry collector.
docker compose up --build
TOKEN=$(curl -s -X POST localhost:8081/agents/token \
-d grant_type=client_credentials -d client_id=analyst -d client_secret=local \
-d scope="rag:*" | jq -r .access_token)
curl -s -X POST localhost:8080/v1/collections -H "Authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
-d '{"name":"supplier-risk","classification":2,"owner":"risk-team"}'
curl -s localhost:8080/.well-known/agent-card.json | jq .skillsDevelopment
uv sync
make check # ruff, black, mypy --strict, bandit, contracts, tests (coverage >= 90%)
make integration # PostgreSQL + pgvector tests (needs GRAPHRAG_TEST_DATABASE_URL)Test suites: tests/unit, tests/security (attacks mapped to the threat
model, test_t<n>_...), tests/chaos (dependency failures and replica
consistency), tests/performance (latency budgets; locustfile.py for load),
tests/e2e (HTTP, MCP and A2A lifecycle plus a property-based OpenAPI contract
test), tests/integration (PostgreSQL with both vector backends).
API
All /v1 routes require Authorization: Bearer <agent credential>; the
optional X-Purpose-Of-Use header declares a purpose of use (required for
restricted collections).
Endpoint | Scope | Purpose |
|
| Create a collection with a classification and owner |
|
| Inventory |
|
| Ingest a document version |
|
| Documents and their chunks with offsets and digests |
|
| Right-to-erasure cascade |
|
| Hybrid retrieval with score breakdown |
|
| Budgeted, attributed context pack for the caller's own model |
|
| Agentic RAG answer with citations, groundedness and release decision |
|
| Entity resolution, communities and summaries |
|
| Entity lookup by name or alias |
|
| k-hop neighbourhood, optionally |
|
| Community summaries by level |
|
| Judge an attributed answer against its sources |
|
| Recall, precision, MRR, nDCG on a golden set |
| per tool | MCP streamable HTTP endpoint |
| none | A2A Agent Card |
|
| A2A JSON-RPC |
| none | Operations |
Full contract: docs/api/openapi.json; JSON Schemas in schemas/.
MCP tools
Tool | Purpose |
| Hybrid retrieval over one collection |
| Planned, budgeted, attributed context pack |
| Grounded answer with citations, groundedness report and release decision |
| Find an entity by name and return its graph neighbourhood |
| Per-claim groundedness of an attributed answer |
| Chunk, screen, embed and graph-extract a document version |
Deployment
Layer | Location |
Container image |
|
Helm chart |
|
Namespace and secret sync |
|
Cloud infrastructure |
|
AWS is the reference deployment (EKS, RDS for PostgreSQL, Bedrock, S3 Object Lock). See the startup runbook.
Documentation
ADRs: hybrid retrieval, temporal assertions, revision-checked indexes, groundedness-gated release, local implementations behind interfaces, ingestion content controls
Runbooks: startup, monitoring, incident response, rollback, disaster recovery, reindex and erasure
License
Apache-2.0
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
- WauldoOAuthcom.wauldo
Stateless agentic tools over MCP: concept extraction, long-context, knowledge graph, planning.
Multiple MCP tools, persistent graph memory, token-saving data pointers, and more.
MCP facade over the Nebelus Construction API. ~48 tools give full agent build parity: create/update/probe agents, edit graphs, attach knowledge and vector stores, wire connectors, set governance policies and locked guardrails, enable grounding-trace, and read deployment wiring. Purpose-built for regulated industries: data residency is enforced per region (EU / GCC-KSA), with PII controls and an audit trail. Agents are created as drafts — no deploy tool is exposed over MCP by design; publishing happens in the Nebelus console.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables document-based Q&A with multi-modal RAG, hybrid retrieval, knowledge graph reasoning, and multi-agent orchestration via MCP tools.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to perform retrieval-augmented generation with hybrid search, reranking, multi-modal image processing, and RAG evaluation through standardized MCP tools.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to use a hybrid dense+sparse RAG system with tag-based long-term memory (importance, knowledge-type decay, access-frequency boost) via MCP tools for document ingestion, hybrid search, staged reranking, forgetting, and index management.MIT
- FlicenseNot gradedqualityBmaintenanceEnables retrieval-augmented question answering with source-grounded citations, document retrieval, and idempotent ingestion through MCP tools.-