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