docserver-mcp
v0.1.0
Published
Version-aware MCP documentation server with FTS5 search. Indexes docs from tools, skills, and CLIs into a searchable SQLite database.
Maintainers
Readme
DocServer
A version-aware MCP documentation server. Indexes docs from your tools, skills, and CLIs into a searchable SQLite database with full-text search (FTS5). Checks versions daily and only re-indexes when something changes.
What It Does
- Tracks tool versions — knows when OpenClaw, skills, or CLIs get updated
- Indexes documentation — markdown files, CLI help output, anything text-based
- Full-text search — FTS5-powered search across all indexed docs
- MCP protocol — exposes tools via Model Context Protocol (stdio transport)
- Daily refresh — cron job checks for version changes and re-indexes as needed
Architecture
┌─────────────┐ stdio ┌─────────────┐ SQLite/FTS5 ┌──────────┐
│ MCP Client │ ◄────────────► │ server.mjs │ ◄──────────────────► │ docs.db │
│ (mcporter, │ │ (Node.js) │ │ │
│ agent, │ └──────┬──────┘ └──────────┘
│ Claude) │ │
└─────────────┘ │ reads from
▼
┌───────────────┐
│ Doc Sources │
│ - local dirs │
│ - CLI --help │
│ - skill files │
└───────────────┘Files
| File | Purpose |
|---|---|
| server.mjs | MCP server — handles all tool calls, DB operations, doc ingestion |
| refresh.sh | Cron wrapper — runs a one-shot refresh and logs results |
| package.json | Node dependencies |
| .gitignore | Excludes node_modules/ from version control |
Dependencies
- Node.js >= 18
- npm packages:
@modelcontextprotocol/sdk,better-sqlite3,glob - No external services required — everything is local SQLite
Installation
# 1. Clone or copy the docserver directory
mkdir -p ~/docserver
cp server.mjs refresh.sh package.json ~/docserver/
cd ~/docserver
# 2. Install dependencies
npm install
# 3. Create the data directory (auto-created on first run too)
mkdir -p ~/.docserver
# 4. Run initial index
# This starts the server, seeds default tools, indexes everything, then exits
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"setup","version":"1.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"docs_refresh","arguments":{}}}\n' | node server.mjs
# 5. (Optional) Register with mcporter
mcporter config add docserver \
--command node \
--arg ~/docserver/server.mjs \
--scope home \
--description "Version-aware tool documentation server with FTS5 search"
# 6. Verify
mcporter call docserver.docs_listMCP Tools
docs_list
List all tracked tools with versions, page counts, and last update times.
mcporter call docserver.docs_listdocs_search
Full-text search across all indexed documentation.
| Param | Type | Required | Description |
|---|---|---|---|
| query | string | yes | Search terms |
| tool | string | no | Filter to one tool |
| limit | number | no | Max results (default 10) |
mcporter call docserver.docs_search query="model config primary"
mcporter call docserver.docs_search query="heartbeat" tool="openclaw"docs_get
Retrieve full documentation content for a tool.
| Param | Type | Required | Description |
|---|---|---|---|
| tool | string | yes | Tool name (e.g. openclaw, skill:discord, gh) |
| section | string | no | Specific section (omit for all) |
mcporter call docserver.docs_get tool="openclaw" section="configuration"
mcporter call docserver.docs_get tool="gh"docs_refresh
Check versions and re-index any tools that changed. Skips unchanged tools.
| Param | Type | Required | Description |
|---|---|---|---|
| tool | string | no | Refresh one tool (omit for all) |
mcporter call docserver.docs_refresh
mcporter call docserver.docs_refresh tool="openclaw"docs_add
Register a new tool for tracking.
| Param | Type | Required | Description |
|---|---|---|---|
| name | string | yes | Unique tool identifier |
| type | string | yes | openclaw, skill, cli, or api |
| source | string | yes | Path to docs dir, or cmd:command for CLI help |
| version_cmd | string | no | Shell command that outputs the version |
# Track a local docs directory
mcporter call docserver.docs_add \
name="myapp" type="cli" \
source="cmd:myapp --help" \
version_cmd="myapp --version"
# Track a directory of markdown files
mcporter call docserver.docs_add \
name="wiki" type="api" \
source="/path/to/wiki/docs"docs_remove
Remove a tool and all its indexed pages.
mcporter call docserver.docs_remove name="myapp"Daily Cron Refresh
The refresh script runs the server in one-shot mode, calls docs_refresh, and logs a summary.
# Add to crontab (runs at 4:15 AM daily)
crontab -e
# Add this line:
15 4 * * * /home/pinchy/docserver/refresh.sh >> ~/.docserver/refresh.log 2>&1Log output looks like:
[docserver refresh] 2026-03-02T04:15:01-05:00
Total: 63 | Updated: 2 | Unchanged: 61
↻ openclaw → v2026.3.1 (654 pages)
↻ gh → v2.47.0 (1 pages)CLI Wrapper (Optional)
A convenience script at ~/.local/bin/docserver:
docserver list # Show all tracked tools
docserver search "query" # Full-text search
docserver get openclaw # Get all docs for a tool
docserver get openclaw gateway # Get specific section
docserver refresh # Run manual refreshTo install:
# Copy the wrapper (see below) to ~/.local/bin/docserver
chmod +x ~/.local/bin/docserver
# Make sure ~/.local/bin is in your PATHHow It Decides What to Index
On first run (docs_refresh):
- Seeds default tools — auto-detects OpenClaw install, all skills, common CLIs on PATH
- Runs version commands for each tool
- Ingests all docs (markdown files from directories, or --help output from CLIs)
On subsequent runs:
- Runs version commands again
- Compares to stored version
- Only re-indexes if version changed — skips everything else
- Skills without version commands always skip after first index (re-index manually with
docs_refresh tool="skill:name")
Database
- Location:
~/.docserver/docs.db(override withDOCSERVER_DATAenv var) - Engine: SQLite with WAL mode
- Tables:
tools— registered tools, versions, sourcesdoc_pages— individual doc pages with contentdoc_fts— FTS5 virtual table for full-text search
What Gets Indexed (Current Defaults)
| Tool | Type | Source | Pages |
|---|---|---|---|
| openclaw | core | ~/.npm-global/lib/node_modules/openclaw/docs/ | ~654 |
| skill:* | skill | Each skill's directory (SKILL.md + any .md files) | 1-7 each |
| gh | cli | gh --help output | 1 |
| git | cli | git --help output | 1 |
| camsnap | cli | camsnap --help output | 1 |
| mcporter | cli | mcporter --help output | 1 |
| ffmpeg | cli | ffmpeg -h output (first 50 lines) | 1 |
Future Plans
- HTTP/SSE transport — run as a network service, not just stdio
- Docker container — host-independent, run anywhere
- Remote doc sources — fetch from URLs, npm registries, GitHub releases, swagger endpoints
- API docs — Home Assistant, Frigate, Portainer, Gitea swagger auto-import
- Semantic search — RAGFlow integration alongside FTS5 keyword search
