Skip to main content
Glama
shrish346

docs-rag-mcp

by shrish346
README.md
# 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.

![Searching](assets/searching.png)
![Completed](assets/completed.png)

TDQS

A4/5.0

Scored across 1 tool

Disambiguation5/5

Only one tool exists, so there is no possibility of confusion between overlapping tools. The purpose of search_docs is singular and clear.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness4/5

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.

Maintenance

ActivityInactive
ResponsivenessNo issues