Scrapbox Cosense MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides access to Scrapbox/Cosense pages, allowing retrieval of page content, metadata, links, and editor information, listing pages in a project, full-text search across pages, and generating page URLs.

scrapbox-cosense-mcp

English | Japanese

English

MCP server for cosense/scrapbox .

Features

  • get_page
    • Get page content from cosense/Scrapbox
      • Input: Page title
      • Output: Page content, metadata, links, and editor information
  • list_pages
    • Get a list of pages in the project (max 1000 pages)
      • Output: List of page titles in the project
  • search_pages
    • Full-text search across all pages in the project (max 100 pages)
      • Supports basic search, AND search, OR search, and NOT search
      • Output: List of page titles in search results
  • create_pages
    • Generate page URLs
      • Input: Page title and optional body text
      • Output: URL that can be opened in a browser

Development

Install dependencies:

npm install

Build the server:

npm run build

Auto-rebuild during development:

npm run watch

Installation

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

To use with Claude Desktop, add the server configuration as follows:

For MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json For Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "scrapbox-cosense-mcp": { "command": "npx", "args": ["github:worldnine/scrapbox-cosense-mcp"], "env": { "COSENSE_PROJECT_NAME": "your_project_name", "COSENSE_SID": "your_sid", // Required for private projects "COSENSE_PAGE_LIMIT": "25", // Optional (default: 100) "COSENSE_SORT_METHOD": "created", // Optional (default: "updated") "SERVICE_LABEL": "scrapbox(cosense)" // Optional (default: "cosense(scrapbox)") } } } }

Environment Variables

This server uses the following environment variables:

Required Environment Variables

  • COSENSE_PROJECT_NAME : Project name
  • COSENSE_SID : Session ID for Scrapbox/Cosense authentication (required for private projects)

Optional Environment Variables

  • API_DOMAIN : API domain (default: "scrapbox.io")
  • SERVICE_LABEL : Service identifier (default: "cosense (scrapbox)")
  • COSENSE_PAGE_LIMIT : Initial page fetch limit (1-1000, default: 100)
  • COSENSE_SORT_METHOD : Initial page fetch order (updated/created/accessed/linked/views/title, default: updated)

Environment Variable Behavior

  • COSENSE_PROJECT_NAME : Required environment variable. Server will exit with an error if not set.
  • COSENSE_SID : Required for accessing private projects. If not set, only public projects are accessible.
  • API_DOMAIN :
    • Use "scrapbox.io" if not set
    • While unverified with domains other than "scrapbox.io" in the author's environment, this option exists in case some environments require "cosen.se"
  • COSENSE_PAGE_LIMIT :
    • Uses 100 if not set
    • Uses 100 if value is invalid (non-numeric or out of range)
    • Valid range: 1-1000
  • COSENSE_SORT_METHOD :
    • Uses 'updated' if not set
    • Uses 'updated' if value is invalid
    • Does not affect list_pages tool behavior (only used for initial resource fetch)

Debugging

Since MCP servers communicate via stdio, debugging can be challenging. Using MCP Inspector is recommended. You can run it with:

npm run inspector

The Inspector provides a URL to access debugging tools in the browser.

Japanese

This is an MCP server for cosense/scrapbox .

function

  • get_page
    • Get page content from cosense/Scrapbox
      • Input: Page title
      • Output: Page content, metadata, links, editor info
  • list_pages
    • Get a list of pages in a project (up to 1000)
      • Output: A list of page titles in the project
  • search_pages
    • Full-text search across all pages in a project (up to 100 results)
      • Supports basic search, AND search, OR search, and NOT search
      • Output: List of page titles in search results
  • create_pages
    • Generate URL for the page
      • Input: Page title and optional body text
      • Output: A URL that can be opened in a browser

Development method

Install dependencies:

npm install

Build the server:

npm run build

Automatic rebuild during development:

npm run watch

How to install

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

To use it with Claude Desktop, add the following server config:

For MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json For Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "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", // オプション(デフォルト: 100) "COSENSE_SORT_METHOD": "created", // オプション(デフォルト: "updated") "SERVICE_LABEL": "scrapbox(cosense)" // オプション(デフォルト: "cosense(scrapbox)") } } } }

environmental variables

This server uses the following environment variables:

Required Environment Variables

  • COSENSE_PROJECT_NAME : Project name
  • COSENSE_SID : Scrapbox/Cosense authentication session ID (required for private projects)

Optional Environment Variables

  • API_DOMAIN : API domain (default: "scrapbox.io")
  • SERVICE_LABEL : Service identification name (default: "cosense (scrapbox)")
  • COSENSE_PAGE_LIMIT : Number of pages to initially retrieve (1-1000, default: 100)
  • COSENSE_SORT_METHOD : Page order at initial retrieval (updated/created/accessed/linked/views/title, default: updated)

Behavior of environment variables

  • COSENSE_PROJECT_NAME : This is a required environment variable, if not set the server will exit with an error on startup.
  • COSENSE_SID : Required for accessing private projects. If not set, only public projects can be accessed.
  • API_DOMAIN :
    • If not set, "scrapbox.io" will be used.
    • In the author's environment, values other than "scrapbox.io" have not been verified, but there may be environments in which it will not work unless it is "cosen.se", so this is an option just in case.
  • COSENSE_PAGE_LIMIT :
    • If not set, use 100
    • For invalid values (non-numeric or out of range) use 100
    • Valid range: 1-1000
  • COSENSE_SORT_METHOD :
    • If not set, 'updated' is used.
    • For invalid values use 'updated'
    • Does not affect the operation of the list_pages tool (used only when obtaining initial resources)

How to debug

MCP servers can be difficult to debug because they communicate over stdio. We recommend using MCP Inspector , which can be run with the following command:

npm run inspector

Inspector provides a URL to access the debugging tools in your browser.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

This server facilitates interaction with cosense/Scrapbox projects, enabling users to retrieve, list, search, and create pages while supporting various query operations and secure access to private projects.

  1. English
    1. Features
    2. Development
    3. Installation
    4. Environment Variables
    5. Debugging
  2. 日本語
    1. 機能
      1. 開発方法
        1. インストール方法
          1. 環境変数
            1. 必須の環境変数
            2. オプションの環境変数
            3. 環境変数の挙動について
            4. デバッグ方法
          ID: 8huixkwpe2