wiki-nexus
v0.1.1
Published
Zero-server knowledge graph engine for markdown wikis — CLI + MCP tools
Maintainers
Readme
wiki-nexus
Zero-server knowledge graph engine for markdown wikis. Indexes pages, wikilinks, tags, topic clusters, and knowledge flows into SQLite, then exposes them through MCP tools and a REST API.
The core principle: precomputed relational intelligence. All clustering, relationship mapping, staleness detection, and impact analysis is computed at index time — not at query time via expensive LLM multi-hop. Even smaller models get complete structural context in a single tool call.
Install
npm install -g wiki-nexusOr use without installing:
npx wiki-nexus analyzeQuick start
# Index your wiki
cd ~/my-knowledge-base
wiki-nexus analyze
# See what was built
wiki-nexus status
# → 52 pages, 187 edges, 6 clusters, 0 broken links
# Search
wiki-nexus query "compression methods"
# Hook up to Claude Code
wiki-nexus setup
# Start HTTP API
wiki-nexus serveCLI commands
| Command | Description |
|---------|-------------|
| wiki-nexus analyze [path] | Index a wiki directory |
| wiki-nexus status | Show index status |
| wiki-nexus query <query> | Search the wiki |
| wiki-nexus list | List all indexed wikis |
| wiki-nexus clean | Delete index |
| wiki-nexus mcp | Start MCP server (stdio) |
| wiki-nexus serve | Start HTTP API server |
| wiki-nexus setup | Configure MCP for your editor |
Flags
wiki-nexus analyze --force # Full re-index
wiki-nexus analyze --embeddings # Enable semantic search
wiki-nexus analyze --index-dir ./data # Custom index location
wiki-nexus serve --port 8080 # Custom port
wiki-nexus query "topic" --limit 5 # Limit results
wiki-nexus clean --all --force # Delete all indexesMCP tools
Once indexed, the MCP server exposes 8 tools for AI agents:
| Tool | What it returns |
|------|----------------|
| wiki_query | Hybrid search results (BM25 + semantic + RRF fusion) |
| wiki_context | 360-degree page view — all relationships, clusters, flows, staleness |
| wiki_impact | Blast radius — what pages are affected if this page changes |
| wiki_clusters | Topic clusters with members and cohesion scores |
| wiki_lint | Health check — broken links, orphans, stale pages |
| wiki_flows | Knowledge flow tracing from sources through derived pages |
| wiki_stats | Wiki-level statistics |
| list_wikis | All indexed wikis |
Editor setup
wiki-nexus setup # Auto-detects Claude Code, Cursor, Codex, Claw CodeOr manually:
Claude Code:
claude mcp add wiki-nexus -- npx wiki-nexus mcpCursor (~/.cursor/mcp.json):
{
"mcpServers": {
"wiki-nexus": {
"command": "npx",
"args": ["wiki-nexus", "mcp"]
}
}
}HTTP API
wiki-nexus serve| Endpoint | Maps to |
|----------|---------|
| GET /api/wikis | list_wikis |
| GET /api/wikis/:name/stats | wiki_stats |
| GET /api/wikis/:name/query?q=... | wiki_query |
| GET /api/wikis/:name/pages/:slug/context | wiki_context |
| GET /api/wikis/:name/pages/:slug/impact | wiki_impact |
| GET /api/wikis/:name/clusters | wiki_clusters |
| GET /api/wikis/:name/lint | wiki_lint |
| GET /api/wikis/:name/flows | wiki_flows |
Wiki format
WikiNexus works with markdown wikis that use:
- YAML frontmatter with
title,tags,sources,updated [[slug]]wikilinks where slug = filename without.md- Flat structure in
wiki/pages/ SCHEMA.mdat wiki root (optional, helps detection)
How it works
- Parse — extracts frontmatter, wikilinks, headings from every
.mdfile - Build graph — pages become nodes, wikilinks become edges, stored in SQLite
- Cluster — Louvain community detection groups pages into topic clusters
- Trace flows — follows how knowledge flows from source documents through derived pages
- Analyze — detects broken links, orphan pages, stale content, missing backlinks
- Search — BM25 keyword search + optional semantic embeddings with RRF fusion
All computed at index time. MCP tools just read precomputed results.
Packages
| Package | Purpose |
|---------|---------|
| wiki-nexus | CLI binary + HTTP API |
| @wiki-nexus/core | Core indexing engine |
| @wiki-nexus/mcp-server | MCP stdio server |
License
MIT
