Skip to content

feat: add MCP server for headless wiki operations (no Tauri/GUI)#117

Open
toughhou wants to merge 2 commits intonashsu:mainfrom
toughhou:feat/mcp-server
Open

feat: add MCP server for headless wiki operations (no Tauri/GUI)#117
toughhou wants to merge 2 commits intonashsu:mainfrom
toughhou:feat/mcp-server

Conversation

@toughhou
Copy link
Copy Markdown

@toughhou toughhou commented May 2, 2026

Summary

Adds a standalone MCP (Model Context Protocol) server that exposes llm_wiki's backend logic as AI-callable tools — without requiring the Tauri desktop app. This lets users give Claude Desktop, VS Code Copilot Chat, Cursor, or any MCP host direct access to their wiki knowledge base.

New: mcp-server/

mcp-server/
├── README.md          # Setup + Claude Desktop/VS Code config
├── package.json       # @modelcontextprotocol/sdk + graphology deps
├── tsconfig.json
└── src/
    ├── index.ts       # MCP server (stdio transport)
    ├── lib/           # Patched copies of graph-relevance, wiki-graph,
    │                  # graph-insights, search, path-utils
    ├── shims/
    │   ├── fs-node.ts        # Tauri IPC → Node.js fs drop-in
    │   ├── stores-node.ts    # zustand stores → module-level state
    │   └── embedding-stub.ts # Vector search stub (graceful degradation)
    └── types/wiki.ts

MCP Tools

Tool Description
wiki_status Page count + type breakdown
wiki_search BM25 keyword search with optional RRF vector fusion
wiki_graph Louvain community detection, JSON or summary format
wiki_insights Surprising cross-community connections + knowledge gaps
wiki_lint Orphaned pages, isolated nodes, structural issues

Quick Start

cd mcp-server && npm install && npm run build

# Claude Desktop: add to claude_desktop_config.json
# VS Code: add to .vscode/mcp.json
WIKI_PATH=/path/to/project node dist/index.js

Architecture Notes

The Tauri IPC boundary (@/commands/fs) is the only thing tying the TypeScript logic to the desktop app. The shims/fs-node.ts replaces all invoke() calls with standard fs module operations, making graph-relevance.ts, wiki-graph.ts, graph-insights.ts, and search.ts fully portable.

Works without Tauri: ✅ graph, search, insights, lint
Requires Tauri (not ported): ❌ ingest (PDF/DOCX extraction), deep-research (web fetch), sweep-reviews

Testing

cd mcp-server && npm install && npm run build

# Verify MCP protocol response
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node dist/index.js
# → Returns all 5 tools

# Test with real wiki
WIKI_PATH=/path/to/your/project node dist/index.js

toughhou and others added 2 commits May 2, 2026 01:20
- 新增 SKILL.md(技能定义,10个命令:init/ingest/search/graph/insights/deep-research 等)
- 新增 HERMES.md(Hermes 入口骨架)
- 新增 install.sh(支持 --platform hermes/claude)
- 新增 skill/src/fs-node.ts(Tauri IPC → Node.js fs 完整替换层)
- 新增 skill/src/stores-node.ts(React stores → 模块状态替换)
- 新增 skill/src/cli.ts(CLI 入口,graph/insights/search/status 命令当前可用)
- 新增 skill/package.json + tsconfig.skill.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MCP Server (mcp-server/):
- 5 MCP tools: wiki_status, wiki_search, wiki_graph, wiki_insights, wiki_lint
- Standalone Node.js package — no Tauri/GUI required
- Claude Desktop + VS Code Copilot chat compatible
- tsconfig path aliases replaced with explicit patched lib copies
- Degrades gracefully: BM25 search works without vector/LLM config

Skill CLI (skill/):
- Rebuilt as self-contained package (no path aliases, no Tauri deps)
- src/lib/: patched copies of graph-relevance, wiki-graph, graph-insights, search, path-utils
- src/shims/: fs-node.ts (Tauri IPC → Node.js fs), stores-node.ts, embedding-stub.ts
- src/types/wiki.ts: extracted FileNode/WikiProject types
- Commands: graph, insights, search, status, init, lint
- All commands tested and working

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant