Scrapbox/CoSense

A server for the Scrapbox/CoSense platform to retrieve, list, search, and create pages.

scrapbox-cosense-mcp

日本語ドキュメント / Japanese

Overview

MCP server for Cosense (formerly Scrapbox).

ToolDescriptionAuth Required
get_pageGet page content, metadata, and linksFor private projects
list_pagesBrowse pages with sorting and pagination (max 1000)For private projects
search_pagesFull-text search with keyword highlighting (max 100 results)For private projects
create_pageCreate a page via WebSocket API with Markdown/Scrapbox bodyYes
get_page_urlGenerate direct URL for a pageNo
insert_linesInsert text after a specified line in a pageYes
get_smart_contextGet a page and its linked pages (1-hop/2-hop) in AI-optimized formatYes

create_page and insert_lines support a format parameter ("markdown" or "scrapbox") to control content conversion.

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
    
  2. Install the plugin:
    /plugin install scrapbox-cosense@worldnine-scrapbox-cosense-mcp
    
    Installs globally by default. Use --scope project or --scope local for other scopes.
  3. Set environment variables in your settings file:
    {
      "env": {
        "COSENSE_PROJECT_NAME": "your_project_name",
        "COSENSE_SID": "your_sid"
      }
    }
    
    FileScope
    ~/.claude/settings.jsonAll projects (global)
    .claude/settings.local.jsonThis 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:

ClientConfig 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

VariableDescription
COSENSE_PROJECT_NAMEYour Scrapbox/Cosense project name
COSENSE_SIDSession ID (connect.sid cookie) for private projects — How to get it

Optional

VariableDefaultDescription
API_DOMAINscrapbox.ioAPI domain
SERVICE_LABELcosense (scrapbox)Display name in tool descriptions
COSENSE_PAGE_LIMIT100Initial page fetch limit (1–1000)
COSENSE_SORT_METHODupdatedInitial sort: updated, created, accessed, linked, views, title
COSENSE_TOOL_SUFFIXTool name suffix for multiple instances (e.g. mainget_page_main)
COSENSE_CONVERT_NUMBERED_LISTSfalseConvert numbered lists to bullet lists in Markdown conversion
COSENSE_EXCLUDE_PINNEDfalseExclude pinned pages from initial resource list

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 url "Page Title"
FlagDescription
--compactToken-efficient compact output (recommended for AI agents)
--project=NAMEOverride project name
--jsonOutput as JSON
--helpShow help (supports <command> --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 for detailed configuration examples.

Development

CommandDescription
npm run buildBuild (TypeScript → JavaScript)
npm run watchAuto-rebuild during development
npm testRun test suite
npm run lintRun ESLint
npm run inspectorDebug 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


MseeP.ai Security Assessment Badge Scrapbox Cosense Server MCP server

관련 서버

NotebookLM 웹 임포터

원클릭으로 웹 페이지와 YouTube 동영상을 NotebookLM에 가져오기. 200,000명 이상이 사용 중.

Chrome 확장 프로그램 설치