Scrapbox MCP server

Integrates with Scrapbox to enable reading and writing pages for knowledge management, collaborative note-taking, and chatbot applications.
Back to servers
Setup instructions
Provider
worldnine
Release date
Jan 13, 2025
Language
TypeScript
Stats
29 stars

This MCP server enables seamless integration between Claude and Scrapbox/Cosense, allowing you to access, search, and create content in your knowledge base directly from the AI interface.

Installation

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

Configuration

To use with Claude Desktop, add the server configuration to your Claude config file:

For MacOS:

~/Library/Application\ Support/Claude/claude_desktop_config.json

For Windows:

%APPDATA%/Claude/claude_desktop_config.json

Basic configuration example:

{
  "mcpServers": {
    "scrapbox-cosense-mcp": {
      "command": "npx",
      "args": ["github:worldnine/scrapbox-cosense-mcp"],
      "env": {
        "COSENSE_PROJECT_NAME": "your_project_name",
        "COSENSE_SID": "your_sid", 
        "COSENSE_PAGE_LIMIT": "25", 
        "COSENSE_SORT_METHOD": "created", 
        "SERVICE_LABEL": "scrapbox(cosense)" 
      }
    }
  }
}

Environment Variables

Required Variables

  • COSENSE_PROJECT_NAME: Your Scrapbox project name
  • COSENSE_SID: Session ID for authentication (required for private projects)

Optional Variables

  • API_DOMAIN: API domain (default: "scrapbox.io")
  • SERVICE_LABEL: Service identifier in tool descriptions
  • COSENSE_PAGE_LIMIT: Initial page fetch limit (1-1000, default: 100)
  • COSENSE_SORT_METHOD: Initial sort order (updated/created/accessed/linked/views/title)
  • COSENSE_TOOL_SUFFIX: Tool name suffix for multiple server instances
  • COSENSE_CONVERT_NUMBERED_LISTS: Convert numbered lists to bullet lists (true/false)

Getting Your SID Cookie

For private Scrapbox projects, you'll need the connect.sid cookie:

  1. Navigate to your Scrapbox project and ensure you're logged in
  2. Open browser Developer Tools (F12 or Ctrl+Shift+I)
  3. Go to Application tab → Cookies → https://scrapbox.io
  4. Find the connect.sid cookie
  5. Use the decoded value (with : instead of %3A) as your COSENSE_SID

Example format:

s:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Usage Examples

Once configured, you can use these tools in Claude:

Get a specific page

Please get the content of page "Meeting Notes" using get_page.

List recent pages

Please list the 10 most recently updated pages using list_pages.

Search for content

Please search for pages containing "JavaScript tutorial" using search_pages.

Create a new page

Please create a new page titled "Today's Learning" using create_page.

Get page URL

Please get the URL for page "Project Plan" using get_page_url.

Insert content into a page

Please insert "New task: Complete documentation" after the line "# Tasks" in page "Project Status" using insert_lines.

Multiple Project Support

Method 1: Single Server with Optional Parameters

All tools support an optional projectName parameter:

Please get the content of page "Design Guidelines" from project "help-ja" using get_page.

Method 2: Multiple Server Instances

For multiple private projects with different credentials, use separate server instances:

{
  "mcpServers": {
    "main-scrapbox": {
      "command": "npx",
      "args": ["github:worldnine/scrapbox-cosense-mcp"],
      "env": {
        "COSENSE_PROJECT_NAME": "main-project",
        "COSENSE_SID": "s:main_sid_here...",
        "COSENSE_TOOL_SUFFIX": "main",
        "SERVICE_LABEL": "Main Scrapbox"
      }
    },
    "team-cosense": {
      "command": "npx",
      "args": ["github:worldnine/scrapbox-cosense-mcp"],
      "env": {
        "COSENSE_PROJECT_NAME": "team-workspace",
        "COSENSE_SID": "s:team_sid_here...",
        "COSENSE_TOOL_SUFFIX": "team",
        "SERVICE_LABEL": "Team Cosense"
      }
    }
  }
}

This creates tools with suffixes (like get_page_main and get_page_team), allowing Claude to work with multiple projects.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "scrapbox-cosense-mcp" '{"command":"npx","args":["github:worldnine/scrapbox-cosense-mcp"],"env":{"COSENSE_PROJECT_NAME":"your_project_name","COSENSE_SID":"your_sid","COSENSE_PAGE_LIMIT":"25","COSENSE_SORT_METHOD":"created","SERVICE_LABEL":"scrapbox(cosense)"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "scrapbox-cosense-mcp": {
            "command": "npx",
            "args": [
                "github:worldnine/scrapbox-cosense-mcp"
            ],
            "env": {
                "COSENSE_PROJECT_NAME": "your_project_name",
                "COSENSE_SID": "your_sid",
                "COSENSE_PAGE_LIMIT": "25",
                "COSENSE_SORT_METHOD": "created",
                "SERVICE_LABEL": "scrapbox(cosense)"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "scrapbox-cosense-mcp": {
            "command": "npx",
            "args": [
                "github:worldnine/scrapbox-cosense-mcp"
            ],
            "env": {
                "COSENSE_PROJECT_NAME": "your_project_name",
                "COSENSE_SID": "your_sid",
                "COSENSE_PAGE_LIMIT": "25",
                "COSENSE_SORT_METHOD": "created",
                "SERVICE_LABEL": "scrapbox(cosense)"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later