
worldnine/scrapbox-cosense-mcp 是从 https://github.com/worldnine/scrapbox-cosense-mcp. 导入的 MCP 服务器候选
概览
worldnine/scrapbox-cosense-mcp 是从 https://github.com/worldnine/scrapbox-cosense-mcp. 导入的 MCP 服务器候选
概述(AI 翻译)
日本語文档 / 日语
概述
Cosense(前称Scrapbox)的MCP服务器。
| 工具 | 描述 | 需要认证 |
|---|---|---|
get_page |
获取页面内容、元数据和链接 | 针对私人项目 |
list_pages |
浏览带有排序和分页功能的页面(最多1000页) | 私人项目 |
search_pages |
带关键词高亮的全文搜索(最多100条结果) | 针对私人项目 |
create_page |
创建带有Markdown/Scrapbox正文的页面 | 是的 |
get_page_url |
为页面生成直接URL | 否 |
insert_lines |
在页面指定行后插入文本 | 是的 |
edit_lines |
替换完全匹配的行,包括多行块(第一次匹配,或全部匹配matchAll) |
是的 |
delete_lines |
删除完全匹配的行,包括多行块(第一次匹配,或全部匹配matchAll) |
是的 |
delete_page |
删除页面 — 选择加入,见下文 | 是的 |
rewrite_page |
替换页面的全部内容 — 选择加入,见下文 | 是的 |
get_smart_context |
获取页面及其链接页面(1跳/2跳),采用AI优化格式 | 是的 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
scrapbox-cosense-mcp
Overview
MCP server for Cosense (formerly Scrapbox).
| Tool | Description | Auth Required |
|---|---|---|
get_page |
Get page content, metadata, and links | For private projects |
list_pages |
Browse pages with sorting and pagination (max 1000) | For private projects |
search_pages |
Full-text search with keyword highlighting (max 100 results) | For private projects |
create_page |
Create a page with a Markdown/Scrapbox body | Yes |
get_page_url |
Generate direct URL for a page | No |
insert_lines |
Insert text after a specified line in a page | Yes |
edit_lines |
Replace exact-match line(s), including a multi-line block (first match, or all with matchAll) |
Yes |
delete_lines |
Delete exact-match line(s), including a multi-line block (first match, or all with matchAll) |
Yes |
delete_page |
Delete a page — opt-in, see below | Yes |
rewrite_page |
Replace a page’s entire content — opt-in, see below | Yes |
get_smart_context |
Get a page and its linked pages (1-hop/2-hop) in AI-optimized format | Yes |
create_page, insert_lines, edit_lines, and rewrite_page support a format parameter ("markdown" or "scrapbox") to control content conversion.
edit_lines replaces only the first matching line by default. Set matchAll: true to replace every occurrence. The default is deliberately conservative: a line such as a bullet marker or a blank line can repeat many times in a page, and replacing all of them at once is rarely what the caller intended.
targetLineText may contain newlines to match a contiguous block of lines. The block is replaced as a whole, so n lines can become m lines (for example, collapsing several lines into one). Block matches with matchAll: true are non-overlapping.
delete_lines uses the same exact-match (and block) semantics but removes the matched lines instead of replacing them. It refuses to delete the title line (the first line), because that would rename or remove the page itself — use delete_page for that.
delete_page and rewrite_page are opt-in
delete_page and rewrite_page are not registered unless COSENSE_ENABLE_DELETE=true is set. Without it neither tool appears in the tool list at all, so an agent cannot call them even by mistake. This server is often added to a shared MCP configuration, so whole-page destruction is exposed only to those who deliberately turn it on.
The reasoning: insert_lines, edit_lines, and delete_lines all require an exact match, which is only possible if the caller has actually read the page — they can only destroy lines they already know. delete_page and rewrite_page act on the entire page regardless of whether the caller has read it, so they get a separate opt-in gate.
delete_page removes the whole page. There is no undo. Two further guards are built in:
安装
npx -y scrapbox-cosense-mcp配置
{
"mcpServers": {
"cosense-notes": {
"command": "npx",
"args": ["-y", "scrapbox-cosense-mcp"],
"env": {
"COSENSE_PROJECT_NAME": "notes",
"COSENSE_MCP_PAT": "your-personal-access-token",
"COSENSE_TOOL_SUFFIX": "notes",
"COSENSE_ENABLE_DELETE": "true"
}
},
"cosense-archive": {
"command": "npx",
"args": ["-y", "scrapbox-cosense-mcp"],
"env": {
"COSENSE_PROJECT_NAME": "archive",
"COSENSE_MCP_PAT": "your-personal-access-token",
"COSENSE_TOOL_SUFFIX": "archive"
}
}
}
}