docs MCP server: opt-in co-op docs search (stdio, stdlib-only BM25 over co-op/docs)

This commit is contained in:
inference-bot committed 2026-10-17 18:14:30 -06:00
1 parent ddcd0dc272
commit 806244dd5c
2 files changed
+289 -1

No files matched your search

+33 -1
View File
@@ -1,3 +1,35 @@
# inference-docs-mcp
Inference Cooperative docs MCP server — opt-in docs search for the co-op chat
The Inference Cooperative documentation as an **MCP server** — members opt in
per conversation and can search the co-op docs (getting started, models, API
access, charter, policies) from the chat.
## Design
- **MCP over stdio**, implemented with Python stdlib only (newline-delimited
JSON-RPC 2.0) — no dependencies to install.
- The corpus is fetched at runtime from the public `co-op/docs` repo
(Gitea raw API), chunked by `##` heading, and ranked with BM25. The index
rebuilds lazily when older than 30 minutes, so doc edits show up without
any redeploy.
- Runs as a child process of the chat frontend (LibreChat spawns it via its
`mcpServers` config with `type: stdio`).
## Deploy (LibreChat sandbox)
```bash
cloudron push --app <chat-app-id> server.py /app/data/inference-docs-mcp/server.py
# librechat.yaml:
# mcpServers:
# inference-docs:
# type: stdio
# command: python3
# args: ["/app/data/inference-docs-mcp/server.py"]
```
Restart the chat app; the tool (`search_docs`) registers on boot.
## Tool
`search_docs(query, limit?)` → the most relevant doc sections with their
doc title + heading context.