rag-mcp-server
БесплатноБез исполняемых скриптовНе проверенAdd foundational CS knowledge (7 classic books) and session-memory search to Claude Code or Claude Desktop via MCP. Lets Claude answer "how does X work?" by…
от gptme★ 19 звёзд на GitHubОб этом скилле
rag-mcp-server Skill
Expose a local BM25 knowledge-base and session index to any MCP client — Claude Code, Claude Desktop, or any gptme instance — so queries like "how does virtual memory work?" resolve to book chapters inline, and "what did we discuss about caching last week?" resolve to past sessions.
Overview
rag-mcp-server is part of the rag package in your gptme agent workspace. It exposes
two search surfaces as MCP tools:
| Tool | What it searches |
|---|---|
search_wisdom |
BM25 index over CC-licensed CS reference books |
list_wisdom_sources |
List of book slugs currently indexed |
search_sessions |
Journal, gptme logs, and Claude Code trajectory index |
Default book set (7): SICP, OSTEP, Pro Git, Think Python, MML Book, RL Intro, Eloquent JavaScript. BM25 precision@3: 0.87 on a curated benchmark set.
Setup
1. Install the package
# From gptme-contrib workspace root
uv sync --all-packages
# Verify the entry point is available
rag-mcp-server --help
2. Build the book (wisdom) index
# Download and index CC-licensed books in one command:
bob-search index-books --preset cs-fundamentals
# Preview without downloading:
bob-search index-books --preset cs-fundamentals --dry-run
# List available presets:
bob-search index-books --list-presets
# For books requiring manual download (follow --dry-run instructions, then):
# gptme-wisdom ingest --source sicp --file ~/books/sicp.md
# Supported manual-ingest slugs: sicp, ostep, pro-git, thinkpython, mml-book,
# rl-intro, eloquentjs
Default wisdom DB: ~/.local/share/gptme/wisdom.db
3. Build the session index (optional)
bob-search index # indexes journal/, gptme logs, Claude Code trajectories
Default session DB: ~/.local/share/bob/session-index.db
4. Run a quick smoke test
# Verify the wisdom index is queryable (should return OSTEP chunks):
bob-search wisdom "virtual memory" --source ostep --top-k 2
# Verify the session index is queryable (if indexed):
bob-search sessions "caching" --limit 2
# Verify the MCP server starts and responds to JSON-RPC:
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1"}},"id":1}' | \
rag-mcp-server | head -1
MCP Configuration
Claude Code
Add to .claude/settings.json in your project (or ~/.claude/settings.json
for global use):
{
"mcpServers": {
"wisdom-rag": {
"command": "rag-mcp-server",
"type": "stdio"
}
}
}
Or add it from the terminal:
claude mcp add wisdom-rag rag-mcp-server
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"wisdom-rag": {
"command": "rag-mcp-server",
"args": []
}
}
}
Custom DB paths (non-default install)
{
"mcpServers": {
"wisdom-rag": {
"command": "rag-mcp-server",
"args": [
"--wisdom-db", "/path/to/wisdom.db",
"--sessions-db", "/path/to/sessions.db"
]
}
}
}
Tools Reference
These MCP tools become available to the agent once the server is configured. Call them when a question would benefit from grounding in CS fundamentals or past session history.
search_wisdom
search_wisdom(query: str, source?: str, top_k?: int = 5) -> list[Chunk]
Searches the indexed book corpus for passages relevant to the query. Each result
includes: source (book slug), title, chapter, content (excerpt), score.
When to call: the user asks "how does X work?" or you need to ground a technical explanation in authoritative CS references.
Example queries that work well:
"how does virtual memory work"→ OSTEP Chapter 13"git rebase vs merge"→ Pro Git"reinforcement learning q-learning"→ RL Intro"higher-order functions in JavaScript"→ Eloquent JS"backpropagation gradient descent"→ MML Book
list_wisdom_sources
list_wisdom_sources() -> list[str]
Returns book slugs currently indexed (e.g. ["ostep", "sicp", "pro-git", ...]).
When to call: before a search_wisdom call if you're unsure which sources
are available, or to verify the index is populated.
search_sessions
search_sessions(query: str, source?: str, limit?: int = 5) -> list[Session]
Searches past sessions (journal, gptme logs, Claude Code trajectories). Each
result includes: source, date, title, summary, path, score.
source can be journal, gptme, or claude_code.
When to call: the user asks "what did we discuss about X?" or you need context from a previous session to inform current work.
Example queries:
"RAG retrieval implementation"→ sessions where RAG was discussed"bug in websocket reconnect"→ debugging sessions from the past- `"how
Установить rag-mcp-server в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rag-mcp-server?
Add foundational CS knowledge (7 classic books) and session-memory search to Claude Code or Claude Desktop via MCP. Lets Claude answer "how does X work?" by querying indexed books inline, and "what did we discuss about Y?" by searching past sessions. Use this skill when setting up or troubleshooting the rag-mcp-server.
Как установить скилл rag-mcp-server?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rag-mcp-server запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic