Home
Login

An MCP server designed for the Scrapbox/Cosense platform, supporting page retrieval, search, and creation functionalities.

MITTypeScript 24worldninescrapbox-cosense-mcp Last Updated: 2025-06-15

Scrapbox Cosense MCP Server Project Introduction

Project Overview

scrapbox-cosense-mcp is an MCP (Model Context Protocol) server specifically designed for the cosense/scrapbox platform. Developed by worldnine and hosted on GitHub, this project aims to provide AI applications with a standardized interface to Scrapbox knowledge bases.

What is Scrapbox/Cosense?

Cosense is a knowledge management platform whose core philosophy is "the key to productivity lies in knowledge." It allows users to share experiences, accumulate knowledge, and easily achieve compound knowledge growth within an organization.

Core Features

1. get_page (Get Page)

  • Description: Retrieves page content from cosense/Scrapbox.
  • Input: Page title.
  • Output: Page content, metadata, link information, and editor information.

2. list_pages (List Pages)

  • Description: Retrieves a list of pages within a project.
  • Limitation: Returns a maximum of 1000 pages.
  • Output: A list of titles of all pages within the project.

3. search_pages (Search Pages)

  • Description: Performs a full-text search within a project.
  • Search Capabilities: Supports basic search, AND search, OR search, and NOT search.
  • Limitation: Returns a maximum of 100 search results.
  • Output: A list of page titles that match the search criteria.

4. create_pages (Create Pages)

  • Description: Generates a page URL.
  • Input: Page title and optional body content.
  • Output: A URL that can be opened in a browser.

Installation and Configuration

Local Development Installation

# Clone the project
git clone https://github.com/worldnine/scrapbox-cosense-mcp.git
cd scrapbox-cosense-mcp

# Install dependencies
npm install

# Build the server
npm run build

# Automatically rebuild during development
npm run watch

Claude Desktop Integration Configuration

To use this server in Claude Desktop, you need to add the server settings to the configuration file:

macOS Configuration File Path:

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

Windows Configuration File Path:

%APPDATA%/Claude/claude_desktop_config.json

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 Variable Description

Required Variables

  • COSENSE_PROJECT_NAME: Project name (required).
    • If not set, the server will exit with an error upon startup.

Optional Variables

  • COSENSE_SID: Scrapbox/Cosense authentication session ID.

    • Required to access private projects.
    • If not set, only public projects can be accessed.
  • API_DOMAIN: API domain (default: "scrapbox.io").

    • Provides an option for environments that may need to use "cosen.se".
  • SERVICE_LABEL: Service identifier (default: "cosense (scrapbox)").

  • COSENSE_PAGE_LIMIT: Initial page retrieval limit (default: 100).

    • Valid range: 1-1000.
    • The default value is automatically used if the value is out of range.
  • COSENSE_SORT_METHOD: Initial page retrieval order (default: "updated").

    • Possible values: updated/created/accessed/linked/views/title.
    • Only affects initial resource retrieval, not the list_pages tool.

Debugging Tools

Since the MCP server communicates via stdio, debugging can be difficult. The project recommends using MCP Inspector for debugging:

npm run inspector

The Inspector will provide a URL that can be accessed in a browser to use the debugging tool.

Project Features

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

  2. Security: Supports access to private projects via session ID, ensuring data security.

  3. Flexible Configuration: Provides various environment variable options to adapt to different usage scenarios.

  4. Developer-Friendly: Offers automatic rebuilding in development mode and dedicated debugging tools.

Use Cases

  • Knowledge Management Automation: Integrate Scrapbox to enable page read/write functionality for knowledge management, collaborative note-taking, and chatbot applications.
  • AI Assistant Enhancement: Provides AI applications with the ability to access structured knowledge bases.
  • Content Retrieval Optimization: Efficiently retrieve and search Scrapbox content through a standardized API.
  • Collaboration Tool Integration: Integrate Scrapbox's collaboration features into other AI tools.

Technical Architecture

This project is based on the Model Context Protocol architecture, allowing developers to expose data through the MCP server or build AI applications (MCP clients). The project is developed using Node.js and TypeScript, following the MCP standard protocol specifications.

Summary

scrapbox-cosense-mcp is a fully functional MCP server implementation that provides AI applications with a standardized way to interact with Scrapbox knowledge bases. It not only supports basic page operations but also offers powerful search capabilities and secure private project access, making it an ideal tool for building intelligent knowledge management systems.

Star History Chart