How canlin-zhang/rtfm works
rtfm is a local MCP server that indexes documentation files and Git-backed documentation repositories, then returns searchable results and grounded page/line citations. The user workflow runs through an MCP client and registered tools into query operations; when needed, sources are refreshed through staged scanning, selection, reading, extraction, and indexing. The README also documents Claude Code and OpenCode fronts plus the read-the-manual skill. Edges reflect the shown imports, calls, or README statements; unsampled front bootstrap internals are not expanded.
Main entry points: index.py Content index · manifest.py Source manifest · rtfm_server.py MCP server · staging.py Stage and scan
Components 15
Client fronts
- Claude Code front
plugins/claude/bootstrap.py - OpenCode plugin
plugins/opencode/index.ts - Manual skill
skills/read-the-manual/SKILL.md - Front bootstrap
plugins/opencode/bootstrap.py
MCP service
- MCP server
rtfm_server.py - MCP app
rtfm/app.py - Tool registration
rtfm/tools.py
Source management
- Runtime config
rtfm/config.py - Source manifest
rtfm/manifest.py - Git operations
rtfm/git_ops.py
Indexing pipeline
- Stage and scan
rtfm/staging.py - Text extraction
rtfm/extract.py - Content index
rtfm/index.py
Search and results
- Query operations
rtfm/query.py
Other components
- MCP client
Connections 20
- MCP client → MCP server: invokes tools
README.md - Claude Code front → Front bootstrap: launches
- OpenCode plugin → Front bootstrap: launches
plugins/opencode/index.ts - OpenCode plugin → Manual skill: registers
plugins/opencode/index.ts - MCP server → Tool registration: imports registration
rtfm_server.py - MCP server → MCP app: runs
rtfm_server.py - MCP server → Query operations: exports tools
rtfm_server.py - Tool registration → MCP app: registers on
rtfm/tools.py - Tool registration → Query operations: registers functions
rtfm/tools.py - Query operations → Source manifest: loads sources
rtfm/query.py - Query operations → Content index: queries and refreshes
rtfm/query.py - Source manifest → Runtime config: resolves paths
rtfm/manifest.py - Source manifest → Git operations: validates repositories
rtfm/manifest.py - Content index → Runtime config: uses settings
rtfm/index.py - Content index → Source manifest: uses source definitions
rtfm/index.py - Content index → Git operations: refreshes repositories
rtfm/index.py - Content index → Stage and scan: scans and stages
rtfm/index.py - Stage and scan → Source manifest: uses source type
rtfm/staging.py - Stage and scan → Runtime config: uses filters
rtfm/staging.py - Stage and scan → Text extraction: extracts selected files
rtfm/staging.py