docs-rag-mcp
# docs-rag-mcp
MCP server that searches a local markdown corpus with TF-IDF retrieval and serves full documents as resources.
**Architecture:** `docs/*.md` → chunk + TF-IDF index (`rag.py`) → FastMCP exposes `search_docs` tool and `doc://{path}` resource (`server.py`).
## MCP surface
| Kind | Name | Description |
| -------- | -------------- | ---------------------------------------------------------------- |
| Tool | `search_docs` | `query` + `k` — returns ranked chunks with path, score, excerpt |
| Resource | `doc://{path}` | Full markdown for a relative path (e.g. `doc://rag-patterns.md`) |
## Run
```bash
uv sync
uv run fastmcp run server.py # stdio (Claude Desktop, Cursor)
uv run fastmcp run server.py -t http -p 8000 # HTTP for MCP Inspector
```
## Test
```bash
uv run fastmcp list server.py
uv run fastmcp call server.py search_docs --query "TF-IDF" --k 3
```
Add your own notes under `docs/` and restart the server (or re-run) to re-index.
## Claude Desktop
See `docs/claude-desktop-config.md` for `claude_desktop_config.json` snippet. Use an absolute `--directory` path.


TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between overlapping tools. The purpose of search_docs is singular and clear.
The single tool name 'search_docs' follows a clear verb_noun pattern, which is consistent for the server's scope. There are no other names to compare, so it is perfectly consistent.
A single tool for a docs RAG server is borderline but acceptable, as search is the primary function. However, it feels slightly thin, and additional tools like list_docs or get_doc could enhance usability.
For a documentation search server, search_docs covers the core retrieval need. Minor gaps exist such as no ability to list available document sources or fetch a specific document directly, but these are not critical for basic RAG workflows.