ContextFlow MCP Server
Provides a connector that ingests data from GitHub repositories into the context engine, proven end-to-end against real infrastructure.
Optional graph store backend that powers the knowledge graph layer for entity resolution and relationship traversal.
Connector for ingesting Notion workspace pages and content into the context engine; implemented and verified against mocked APIs but not yet against live workspaces.
Local embedding provider that enables fully local semantic search and retrieval with no hosted API keys required.
Embedding provider used for real semantic search quality when ingesting and retrieving documents, enabled via an API key and provider setting.
Serves as both a metadata store backend and a data connector, allowing ContextFlow to ingest PostgreSQL databases and persist metadata for larger deployments.
Connector for ingesting Slack workspace content into the context engine; implemented and verified against mocked APIs but not yet against live workspaces.
Embedding provider (SpacyEmbeddingProvider with the en_core_web_lg model) offering fully local, zero-API-key vector generation for retrieval.
Built-in metadata store backend that provides persistent local-first storage for ingested documents and context without a long-running server.
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., "@ContextFlow MCP Serverwhat context do we have on the Acme renewal?"
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.
ContextFlow
Open-source context infrastructure for AI agents.
Give your agents the right context at the right time — regardless of which LLM, agent framework, or data stack you use.
Quick Start · Docs · Architecture · Contributing
Why ContextFlow
Before — naive RAG
Agent → Vector DB → Top 5 chunks → LLMWith ContextFlow
Agent → Context Engine → Context Pack → LLM
│
├── Semantic Search
├── Knowledge Graph
├── Memory
├── Permissions
├── Freshness
├── Conflict Detection
└── Context CompilerAI agents don't primarily need more tokens. They need the right context at the right time.
Related MCP server: ContextAtlas
Quick Start
git clone https://github.com/yourorg/contextflow
cd contextflow
pip install -e .
contextflow demoThat's the whole thing — contextflow demo writes sample docs, ingests
them, runs a search, and builds a Context Pack, so you see the full
flow work with zero configuration before touching your own data. This
has been verified end-to-end from a clean clone into a fresh virtualenv
with no pre-existing dependencies — see docs/getting_started.md for
the exact commands.
For your own data:
contextflow init
contextflow ingest ./your-docs
contextflow search "your query"
contextflow context-pack "your question"ingest, search, and context-pack are separate commands that
persist to .contextflow/ on disk — no long-running process required.
For Postgres/Qdrant/Neo4j instead of the local-first defaults:
cp .env.example .env
docker compose upfrom contextflow import ContextEngine
engine = ContextEngine()
context = engine.retrieve(
query="Why did our revenue drop last quarter?"
)
print(context)Note on retrieval quality: with no configuration, semantic search uses a dependency-free hashing placeholder with no real language understanding — fine for the quickstart above, not for real retrieval quality. Set
CONTEXTOS_EMBEDDING_PROVIDER=openai(orollama/cohere) plus the matching API key before ingesting real data:export CONTEXTOS_EMBEDDING_PROVIDER=openai export OPENAI_API_KEY=sk-... contextflow ingest ./docsSee
src/contextflow/embeddings/— Ollama runs fully locally if you'd rather not use a hosted API.
Other local-first commands
contextflow trace "your query" # see exactly what the retrieval pipeline did
contextflow mcp # expose an MCP server to Claude, Cursor, etc.context-pack prints a readable panel:
╭──────────────────────────── Context Pack ────────────────────────────╮
│ Query: What decisions were made about payments? │
│ │
│ Documents │
│ • Stripe was selected as the payment processor. The migration… │
│ │
│ Sources │
│ • filesystem │
│ │
│ Confidence: 100% │
╰────────────────────────────────────────────────────────────────────────╯Swap in Postgres, Qdrant, and Neo4j later when you need to scale — see docs/deployment.
The core abstraction: Context Pack
Instead of raw chunks:
context = engine.context_pack(
task="prepare customer renewal",
entity="Acme",
){
"entity": "Acme",
"facts": [],
"people": [],
"projects": [],
"conversations": [],
"documents": [],
"decisions": [],
"risks": [],
"relationships": [],
"sources": [],
"conflicts": [],
"confidence": 0.94
}MCP native
ContextFlow ships an MCP server out of the box, so any MCP-compatible agent (Claude, Cursor, custom agents, ...) can call:
search_context()
get_entity()
get_context_pack()
get_relationships()
get_memory()
get_source()
explain_context()contextflow mcpModular by design
Don't want the knowledge graph? Don't install it. Every subsystem is an interface with swappable backends:
Layer | Interface | Built-in backends |
Vector |
| pgvector, Qdrant |
Graph |
| Neo4j (optional) |
Metadata |
| SQLite, PostgreSQL |
Connector |
| GitHub, PostgreSQL, filesystem |
See ARCHITECTURE.md for the full picture and ROADMAP.md for what's built vs. planned in v0.1.
Repository layout
src/contextflow/
├── core/ # Context Object, Context Pack, Entity, Relationship
├── ingestion/ # Parsing, chunking, normalization, dedup
├── retrieval/ # Semantic, keyword, graph, hybrid, reranking
├── graph/ # Graph building, entity resolution, traversal
├── memory/ # Working / session / user / agent / org memory
├── compiler/ # Context compilation, compression, conflict detection
├── governance/ # Permissions, policies, PII detection, audit
├── evaluation/ # Retrieval + faithfulness benchmarks
├── connectors/ # GitHub, PostgreSQL, filesystem (+ Connector SDK)
├── mcp/ # MCP server and tools
├── api/ # REST API
└── cli/ # `contextflow` command-line toolStatus
ContextFlow is v0.1 — early, opinionated, and built for contribution. What's
real today: persistent local storage, hybrid retrieval, real embedding
providers (OpenAI/Cohere/Ollama), API key auth shared by the REST API and
MCP-over-HTTP, RBAC + tenant isolation + pattern-based PII detection +
queryable audit logging, five-tier memory (session/user/agent/org
persisted, working ephemeral by design), real pipeline tracing/
observability (contextflow trace), a real TypeScript SDK (sdk/typescript)
tested against a live server, ContextBench v0.1 (a real, non-trivial
retrieval benchmark with Recall/Precision/MRR/NDCG and an honestly
documented synthetic-data methodology), real measured performance/scale
benchmarks that found and fixed a genuine O(n²) ingestion bug
(contextflow benchmark-scale), GitHub/PostgreSQL/filesystem
connectors proven end-to-end against real infrastructure, Slack and
Notion connectors proven against mocked APIs but not yet live workspaces,
a naive-but-functional knowledge graph, a runnable evaluation harness, and
the CLI/REST/MCP surfaces above.
The honest gap: benchmarked against LoCoMo (a real external benchmark
also used by Mem0/Zep/Letta — see benchmarks/external/locomo/), the
zero-config default scored 8.5% Recall@5. The best configuration tested
in this environment — SpacyEmbeddingProvider with en_core_web_lg,
fully local, zero API keys — reached 27.3%, a real ~3.2x improvement.
This does not beat the benchmark: a comparable published system
reports 93.9% on the same dataset. The remaining gap has two specific,
identified causes (no trained sentence encoder or LLM-based fact
extraction was accessible in this sandbox), not a mystery — see
benchmarks/external/locomo/RESULTS.md for the full honest accounting.
See ROADMAP.md for the full phased plan — including what's shipped, what's partially built, and what's still just direction — and CONTRIBUTING.md for how to help.
License
Apache 2.0 — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Cross-tool persistent memory and context for AI assistants over MCP.
1
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA read-only Model Context Protocol server that exposes a semantic knowledge base to AI agents via 27 tools. It enables querying of documents and data integrated from sources like Notion, SharePoint, HubSpot, and Slack.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents to retrieve and manage code context with hybrid search, project memory, and observability via MCP tools.29MIT
- FlicenseCqualityDmaintenanceProvides RAG (Retrieval-Augmented Generation) capabilities via Contextual AI, enabling query processing and context-aware responses with citations. Integrates with MCP clients like Cursor IDE and Claude Desktop.1-
- FlicenseNot gradedqualityCmaintenanceExposes a provenance-aware knowledge graph to AI agents over MCP, providing tools like get_fact and search_documents that return precise answers with source citations.1-