Skip to main content

MCP server for MyLLMWiki (Obsidian) capture across Cursor, Codex, Claude

Project description

MyLLMWiki MCP Server

Cursor / Codex / Claude Code 的统一 wiki 能力层。MCP 进程在宿主环境运行,不受 Codex 项目沙箱限制,写入 MyLLMWiki 更可靠。

当前版本0.4.0wiki_paths()mcp_schema_version: "0.4"

完整版本历史见 CHANGELOG.md

架构

任意 vibecoding 工具
    │  MCP stdio
    ▼
myllmwiki-mcp (PyPI) / integrations/mcp/
    │  读 config.env + MYLLMWIKI_ROOT
    ▼
MyLLMWiki/wiki/  +  index.md  +  log.md  +  inbox.jsonl
    ▼
Obsidian

与 Skill/Rule 的关系

职责
Skill / Rule 何时沉淀(触发词、质量闸门)
MCP 如何读写(路径、搜索、写页、记 log)
CAPTURE.md 写什么(SSOT 约定)

安装

PyPI(推荐,跨机器)

uvx myllmwiki-mcp
# 或
pip install myllmwiki-mcp

Cursor ~/.cursor/mcp.json

{
  "mcpServers": {
    "myllmwiki": {
      "command": "uvx",
      "args": ["myllmwiki-mcp"],
      "env": {
        "MYLLMWIKI_ROOT": "/Users/jack/MyLLMWiki"
      }
    }
  }
}

本地开发(可编辑安装)

cd /Users/jack/MyLLMWiki/integrations/mcp
./debug.sh setup

# 或从仓库根:
./integrations/install.sh mcp

工具列表

Tool 版本 用途
wiki_paths 0.1 返回可配置路径 + mcp_schema_version
wiki_get_spec 0.1 CAPTURE.md
wiki_read_page 0.1 读任意 wiki 文件
wiki_search 0.3 带过滤器与打分的 wiki 搜索
wiki_get_context 0.3 编码/沉淀前拉取相关页摘要 + 项目页 + 近期 summary
wiki_list_recent 0.1 列出近期 summaries/projects/…
wiki_write_page 0.1 写入/追加页面(仅限受管目录)
wiki_append_log 0.1 追加 log.md 条目
wiki_inbox 0.1 追加会话索引
wiki_capture_checklist 0.1 返回沉淀步骤(用户已触发时)
wiki_update_index 0.2 插入/更新 index.md 分区表格行
wiki_list_by_status 0.2 按 frontmatter status 列页
wiki_set_status 0.2 设置页 frontmatter status
wiki_capture_session 0.4 原子沉淀:多页 + index + log(失败回滚)

wiki_search 过滤器

可组合:project:NAME tag:TAG category:summary status:raw

示例:WebSocket project:珍选 status:raw category:summary

wiki_capture_session 示例

用户说「沉淀」且 agent 已写好内容后,优先一次调用(可先 dry_run=True 预览):

{
  "project": "珍选管理后台",
  "tool": "cursor",
  "title": "WebSocket 实时推送",
  "pages": [
    {
      "relative_path": "wiki/summaries/2026-05-22-websocket-珍选.md",
      "content": "---\ntype: session\nproject: 珍选管理后台\n---\n# ...",
      "mode": "write"
    },
    {
      "relative_path": "wiki/concepts/WebSocket实时推送.md",
      "content": "...",
      "mode": "append"
    }
  ],
  "index_updates": [
    {
      "section": "summaries",
      "page": "2026-05-22-websocket-珍选",
      "summary": "WebSocket 系统讲解与项目落地",
      "metadata": "capture 2026-05-22"
    },
    {
      "section": "concepts",
      "page": "WebSocket实时推送",
      "summary": "浏览器长连接实时推送模式"
    }
  ],
  "log_bullets": [
    "新建 summary + 更新概念页",
    "项目:珍选管理后台"
  ],
  "dry_run": false
}

返回 ok: true 时,pages / index / log 均已写入;失败则 rolled_back: true

推荐使用流程

用户说「沉淀」后,agent 应:

  1. wiki_capture_checklist(topics=[...], project="...")
  2. wiki_get_context(...)wiki_search(...) — 避免重复建页
  3. wiki_capture_session(...) — 一次完成写页 + index + log(或分步调 wiki_write_page 等)

MCP 不能替代触发闸门 — 仍需要用户说「沉淀」或 rule/skill 约束。

Cursor 配置(本地 venv)

{
  "mcpServers": {
    "myllmwiki": {
      "command": "/Users/jack/MyLLMWiki/integrations/mcp/.venv/bin/myllmwiki-mcp",
      "args": [],
      "env": {
        "MYLLMWIKI_ROOT": "/Users/jack/MyLLMWiki"
      }
    }
  }
}

Codex 配置

~/.codex/config.toml

[mcp_servers.myllmwiki]
type = "stdio"
command = "uvx"
args = ["myllmwiki-mcp"]

[mcp_servers.myllmwiki.env]
MYLLMWIKI_ROOT = "/Users/jack/MyLLMWiki"

Claude Code 配置

{
  "mcpServers": {
    "myllmwiki": {
      "command": "uvx",
      "args": ["myllmwiki-mcp"],
      "env": {
        "MYLLMWIKI_ROOT": "/Users/jack/MyLLMWiki"
      }
    }
  }
}

可配置目录

与 CLI 相同:编辑 integrations/config.env,或通过 MYLLMWIKI_CONFIG 指向配置文件。

本地测试

cd integrations/mcp
./debug.sh setup
./debug.sh smoke
./debug.sh inspector   # MCP Inspector

发布 PyPI

每次发版:改版本号 → 更新 CHANGELOG.md → 更新本 README → ./debug.sh smoke → 构建上传

cd integrations/mcp
./debug.sh publish
twine upload dist/myllmwiki_mcp-0.4.0*

用户侧更新:uvx myllmwiki-mcp 会自动拉最新版(或重启 MCP 连接)。

版本历史(摘要)

版本 要点
0.4.0 wiki_capture_session 原子沉淀
0.3.0 wiki_get_context、增强 wiki_search
0.2.0 wiki_update_indexwiki_list_by_statuswiki_set_status
0.1.0 基线读写 + checklist

详见 CHANGELOG.md

优劣

MCP Skill + 直接写文件
跨工具 ✅ 同一 server ❌ 每工具一套
Codex 沙箱 ✅ 进程外写入 ❌ 常需 escalation
路径校验 ✅ server 内统一 ❌ 靠 prompt
原子沉淀 ✅ v0.4+ ❌ 多步易漏
需安装 uvx / venv symlink 即可

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myllmwiki_mcp-0.4.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

myllmwiki_mcp-0.4.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file myllmwiki_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: myllmwiki_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for myllmwiki_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1f37ef8c6a7c9bc24ee581c526a3efa51272583e567f42050d37b93f09bd0b92
MD5 f62efbc80cdfc9595cad7636c104f0a7
BLAKE2b-256 2964db9dca9c32f8a1291529a85e955a01f77de95597bacd02af31babad28aab

See more details on using hashes here.

File details

Details for the file myllmwiki_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: myllmwiki_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for myllmwiki_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21e5efa70c76504f76f8cf7aed86ef521949ef9e78c66b07438184a8c1eb408e
MD5 e0031494ac4e4ed41bda855fb7029e47
BLAKE2b-256 46ace3bac870e8e6c3dcdf14c8fbb432347fab1a3ab50759fc6e69383d9331c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page