KnowledgeMCP
Give your docs an MCP endpoint. Every AI agent can use them.
https://github.com/user-attachments/assets/304fa31a-5138-4d02-b407-4c518f6a4145
KnowledgeMCP turns any documentation source (websites, PDFs, Confluence, Notion, S3, GitHub) into a standards-compliant Model Context Protocol (MCP) endpoint. Claude, GitHub Copilot, Cursor, and any other MCP-compatible agent can search and read those docs instantly — with no LLM calls at query time (we use a tiny local embedding model + hybrid BM25/kNN search in OpenSearch).
- 🔌 MCP-native — three tools (
docs_search,code_sample_search,docs_fetch) any agent can plug into - 💰 Zero-cost query path — local embeddings + OpenSearch hybrid search. No OpenAI/Bedrock fees per query.
- 🐳
docker compose upworks — runs fully local, no AWS account, no credit card - ☁️ Production-ready AWS path when you want it — Lambda + DynamoDB + SQS + S3 + managed OpenSearch via the bundled SAM template
Quick start
git clone https://github.com/hashwnath/KMCP.git
cd KMCP
make up # docker compose up -d --build
Then:
- Dashboard → http://localhost:3000 (signup → add a source → search)
- Admin REST API → http://localhost:8081
- MCP endpoint → http://localhost:8000/mcp/{your-tenant-slug}
First-time start downloads the fastembed model (~30 MB) and OpenSearch (~700 MB image).
How agents use it
Point any MCP client at your tenant URL:
{
"mcpServers": {
"MyDocs": {
"url": "http://localhost:8000/mcp/your-tenant-slug",
"type": "http"
}
}
}
The agent gets three tools:
Architecture
┌────────────────────────────────────────────────────────────┐
│ AI Agents (Claude, Cursor, Copilot, Continue, ...) │
└──────────────────────────┬─────────────────────────────────┘
│ POST /mcp/{tenant_slug}
┌──────────────────────────▼─────────────────────────────────┐
│ MCP Server (FastMCP) — docs_search / code_search / fetch │
└──────────────────────────┬─────────────────────────────────┘
┌──────────────┼──────────────┐
▼ ▼ ▼
┌───────────────┐ ┌──────────┐ ┌──────────────┐
│ OpenSearch │ │ SQLite │ │ Filesystem │
│ (BM25 + kNN) │ │ tenants │ │ blobs │
│ ~768 token │ │ sources │ │ uploads │
│ chunks │ │ jobs │ │ │
└───────────────┘ └──────────┘ └──────────────┘
▲
┌──────────────────────────┴─────────────────────────────────┐
│ Admin API (Starlette) + Background Worker │
│ signup/login (JWT) crawl → markdown → chunk → │
│ sources CRUD embed → OpenSearch │
│ analytics │
└────────────────────────────────────────────────────────────┘
(In AWS mode, swap SQLite → DynamoDB, Filesystem → S3, the worker queue → SQS,
and run each service as its own Lambda. The application code is unchanged
because every AWS call routes through src/common/backends/.)
Supported source types
Configuration
Defaults work for local docker-compose. To customise, copy .env.example to .env and edit. The most useful knobs:
AWS production deployment
See docs/AWS_DEPLOYMENT.md for the SAM template (Lambda + DynamoDB + SQS + S3 + OpenSearch + SES), cost estimate, and operational runbook.
Contributing
PRs welcome. See CONTRIBUTING.md for the codebase tour and local dev setup.
make test # full pytest suite (BACKEND=local)
make test-aws # AWS-mocked suite
make up # docker compose up -d --build
License
The AGPL-3.0 license means hosted/SaaS use must publish modifications under the same license. If that's a problem for your use case, please open an issue so we can discuss commercial licensing.
Why KnowledgeMCP?
Community
- GitHub Discussions — questions, ideas, show-and-tell
- Issues — bug reports, feature requests
Acknowledgements
- FastMCP — the MCP server framework
- fastembed — ONNX-runtime embedding library
- OpenSearch — hybrid BM25 + kNN search
- Microsoft Learn MCP server team — for documenting hard-earned lessons that shaped the tenant-context-via-middleware design