AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Scrapbox Cosense Mcp

mcp-worldnine-scrapbox-cosense-mcp · by worldnine

MCP server for Cosense (Scrapbox) — read, search, create, and edit wiki pages from Claude and other AI agents. Also works as a CLI and Claude Code plugin.

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add mcp-worldnine-scrapbox-cosense-mcp

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-worldnine-scrapbox-cosense-mcp)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4d ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Scrapbox Cosense Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

scrapbox-cosense-mcp

[日本語ドキュメント / Japanese](./docs/README_ja.md)

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 via WebSocket API with 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 an exact-match line (first match, or all with matchAll) | Yes | | delete_page | Delete a page by emptying every line — 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, and edit_lines 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.

delete_page is opt-in

delete_page is not registered unless COSENSE_ENABLE_DELETE=true is set. Without it the tool does not appear in the tool list at all, so an agent cannot call it even by mistake. This server is often added to a shared MCP configuration, so deletion is exposed only to those who deliberately turn it on.

Deleting a page empties every one of its lines, and Cosense removes a page once all of its lines are empty. There is no undo. Two further guards are built in:

  • The page must already exist. A missing page returns an error rather than a silent success. (The REST API returns a title line even for a page that was never created, so the check looks at persistent, the same way create_page does.)
  • dryRun: true reports how many lines would be removed and shows the first five of them, without touching the page.

When you run several instances of this server for different projects, set the variable on each instance that should be allowed to delete:

{
  "mcpServers": {
    "cosense-notes": {
      "command": "npx",
      "args": ["-y", "scrapbox-cosense-mcp"],
      "env": {
        "COSENSE_PROJECT_NAME": "notes",
        "COSENSE_SID": "s:your-session-id",
        "COSENSE_TOOL_SUFFIX": "notes",
        "COSENSE_ENABLE_DELETE": "true"
      }
    },
    "cosense-archive": {
      "command": "npx",
      "args": ["-y", "scrapbox-cosense-mcp"],
      "env": {
        "COSENSE_PROJECT_NAME": "archive",
        "COSENSE_SID": "s:your-session-id",
        "COSENSE_TOOL_SUFFIX": "archive"
      }
    }
  }
}

Here the notes instance exposes delete_page_notes, while the archive instance exposes no deletion tool at all.

Note that insert_lines and edit_lines behave differently when the target line is absent. insert_lines appends to the end of the page, because "add this text somewhere" still has a reasonable outcome. edit_lines returns an error and leaves the page untouched, because "replace this specific line" has no meaningful fallback — appending the replacement would silently produce a page the caller never asked for.

Quick Start

Desktop Extension (.mcpb) — Easiest

  1. Download scrapbox-cosense-mcp.mcpb from GitHub Releases
  2. Double-click — Claude Desktop opens an install dialog
  3. Enter your project name (and Session ID for private projects)

Claude Code Plugin

  1. Add the marketplace:

`` /plugin marketplace add worldnine/scrapbox-cosense-mcp ``

  1. Install the plugin:

`` /plugin install scrapbox-cosense@worldnine-scrapbox-cosense-mcp ` Installs globally by default. Use --scope project or --scope local` for other scopes.

  1. Set environment variables in your settings file:

``json { "env": { "COSENSE_PROJECT_NAME": "your_project_name", "COSENSE_SID": "your_sid" } } ` | File | Scope | |------|-------| | ~/.claude/settings.json | All projects (global) | | .claude/settings.local.json` | This project only (gitignored) |

The plugin includes MCP server configuration and a /cosense skill for CLI operations.

Claude Code (Manual MCP Setup)

If you prefer manual configuration over the plugin:

claude mcp add scrapbox-cosense-mcp \
  -e COSENSE_PROJECT_NAME=your_project \
  -e COSENSE_SID=your_sid \
  -- npx -y scrapbox-cosense-mcp

Claude Desktop / Other MCP Clients

Add to your config file:

| Client | Config File | |--------|-------------| | Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json | | Claude Desktop (Windows) | %APPDATA%/Claude/claude_desktop_config.json | | Cursor | .cursor/mcp.json (project root) | | Windsurf | ~/.codeium/windsurf/mcp_config.json |

{
  "mcpServers": {
    "scrapbox-cosense-mcp": {
      "command": "npx",
      "args": ["-y", "scrapbox-cosense-mcp"],
      "env": {
        "COSENSE_PROJECT_NAME": "your_project_name",
        "COSENSE_SID": "your_sid"
      }
    }
  }
}

Build from Source

git clone https://github.com/worldnine/scrapbox-cosense-mcp.git
cd scrapbox-cosense-mcp
npm install && npm run build

Configuration

Required

| Variable | Description | |----------|-------------| | COSENSE_PROJECT_NAME | Your Scrapbox/Cosense project name | | COSENSE_SID | Session ID (connect.sid cookie) for private projects — [How to get it](./docs/authentication.md) |

Optional

| Variable | Default | Description | |----------|---------|-------------| | API_DOMAIN | scrapbox.io | API domain | | SERVICE_LABEL | cosense (scrapbox) | Display name in tool descriptions | | COSENSE_PAGE_LIMIT | 100 | Initial page fetch limit (1–1000) | | COSENSE_SORT_METHOD | updated | Initial sort: updated, created, accessed, linked, views, title | | COSENSE_TOOL_SUFFIX | — | Tool name suffix for multiple instances (e.g. mainget_page_main) | | COSENSE_CONVERT_NUMBERED_LISTS | false | Convert numbered lists to bullet lists in Markdown conversion | | COSENSE_EXCLUDE_PINNED | false | Exclude pinned pages from initial resource list | | COSENSE_ENABLE_DELETE | false | Register the delete_page tool and the delete CLI command. Without it, neither is available |

CLI Usage

The same binary also works as a standalone CLI:

scrapbox-cosense-mcp get "Page Title"
scrapbox-cosense-mcp search "keyword"
scrapbox-cosense-mcp list --sort=updated --limit=20
scrapbox-cosense-mcp create "New Page" --body="Markdown content"
scrapbox-cosense-mcp insert "Page" --after="target line" --text="new text"
scrapbox-cosense-mcp edit "Page" --target="old line" --text="new text"
scrapbox-cosense-mcp delete "Page" --dry-run   # needs COSENSE_ENABLE_DELETE=true
scrapbox-cosense-mcp url "Page Title"

| Flag | Description | |------|-------------| | --compact | Token-efficient compact output (recommended for AI agents) | | --project=NAME | Override project name | | --json | Output as JSON | | --help | Show help (supports --help for details) |

Multiple Projects

All tools accept an optional projectName parameter to target a different project from a single server. For multiple private projects with different credentials, run separate server instances with COSENSE_TOOL_SUFFIX.

See [docs/multiple-projects.md](./docs/multiple-projects.md) for detailed configuration examples.

Development

| Command | Description | |---------|-------------| | npm run build | Build (TypeScript → JavaScript) | | npm run watch | Auto-rebuild during development | | npm test | Run test suite | | npm run lint | Run ESLint | | npm run inspector | Debug with MCP Inspector |

Contributing

  1. Create a feature branch from main
  2. Add tests for your changes
  3. Run npm run lint && npm test
  4. Create a pull request — CI runs automatically

License

MIT


[](https://mseep.ai/app/worldnine-scrapbox-cosense-mcp)

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.