Context Portal RAG Knowledge Graph MCP Server
Enable AI assistants with precise, up-to-date project knowledge using Context Portal's MCP server to build and serve project-specific RAG knowledge graphs.
Overview
Context Portal’s MCP (Model Context Protocol) server provides a standardized way to build, manage, and serve project-specific retrieval-augmented generation (RAG) knowledge graphs to AI assistants. The server ingests project artifacts (documentation, code, tickets, and other knowledge sources), converts them into embedding-backed vector data, and exposes an MCP-compliant API that LLMs or agent frameworks can call to retrieve precise, up-to-date context for generation or decision-making.
By separating context management from model logic, the MCP server helps teams keep knowledge current, enforce source attribution, and reduce hallucinations in assistant responses. It is useful for developer assistants, support bots, and internal search tools that need to combine structured relationships (knowledge graph edges/metadata) with full-text semantic search.
Features
- Ingest pipelines for common project sources: repo files, docs, tickets, wikis, and exports
- Embedding-based vector store support (FAISS, Qdrant, Pinecone, etc.)
- Graph-style metadata and relationship support for fine-grained context signals
- MCP-compliant HTTP/WebSocket API for retrieval and streaming responses
- Role-based access and API key / secret configuration
- Connectors for popular LLM providers (OpenAI, Anthropic, etc.)
- CLI & dashboard for management, indexing, and monitoring
- Incremental indexing and change detection to keep context fresh
Installation / Configuration
Prerequisites:
- Docker (recommended) or Node/Python runtime depending on distribution
- Vector DB or provider account (Qdrant/Pinecone) and an LLM API key for embeddings
Clone the repo and run with Docker Compose (example):
# start server + vector DB (example includes qdrant)
Example docker-compose snippet:
version: "3.8"
services:
mcp-server:
image: context-portal/mcp-server:latest
env_file: .env
ports:
- "8080:8080"
depends_on:
- qdrant
qdrant:
image: qdrant/qdrant:latest
ports:
- "6333:6333"
Or run locally (general steps):
# install dependencies (example)
# edit .env with credentials, endpoints, and keys
Recommended .env variables
| Variable | Purpose | Example |
|---|---|---|
| PORT | HTTP port for the MCP server | 8080 |
| DATABASE_URL | Primary metadata DB (Postgres/Mongo) | postgres://user:pass@db:5432/context |
| VECTOR_DB_TYPE | Which vector store to use | qdrant, pinecone, faiss |
| VECTOR_DB_URL | Vector DB endpoint | http://qdrant:6333 |
| EMBEDDING_API_KEY | Provider key for embeddings | sk-xxxxx |
| LLM_PROVIDER | LLM API selection for test calls | openai |
| LLM_API_KEY | LLM provider key | sk-xxxxx |
| MCP_SECRET | Secret to sign/authorize MCP clients | s3cr3t |
After configuration, run database migrations (if required) and start the server:
# migrations (example)
# start
Available Tools / Resources
- Connectors: GitHub, GitLab, local filesystem, Confluence/Notion exports, CSV/JSON imports
- Vector stores: Qdrant, FAISS, Pinecone (provider-specific modules)
- LLM adapters: OpenAI, Anthropic, Hugging Face inference endpoints
- Client SDKs / CLI: lightweight CLI to index content and a JS/Python client for querying
- Monitoring: built-in metrics endpoints and logs for ingestion / query latencies
- Dashboard: optional UI to view indexed documents, embeddings, and query traces
API (example usage)
The server exposes MCP-compatible endpoints for retrieval. Example POST to retrieve context:
Example response (abbreviated):
Use Cases
Developer assistant for codebase onboarding
Index README, architecture docs, and design RFCs. When a new engineer asks “How do we deploy services?”, the assistant queries the MCP server for the latest deployment docs and returns a concise answer with citations.PR reviewer augmentation
During CI, the assistant pulls relevant spec sections and previous decisions from the knowledge graph to annotate pull requests with context-aware suggestions and links to related tickets.Customer support knowledge base
Combine product docs, KB articles, and past support tickets to create a RAG-backed assistant that provides up-to-date, cited answers to customers and suggests escalation paths.Security and compliance audits
Build a graph of policies, library versions, and audit findings. Query the MCP server for policy texts and artifact provenance when generating audit reports.
Tips for Developers
- Start small: index a single repo or docs folder to validate the pipeline and tune embedding parameters.
- Use metadata and relationships: store file paths, authors, timestamps, and explicit edges to improve retrieval precision.
- Monitor freshness: enable incremental indexing or webhook-driven updates for sources like GitHub to keep the knowledge graph current.
- Test with multiple LLMs: different models react differently to context length and formatting—benchmark to find the best