Multiple Project Support

March 20, 2026 ยท View on GitHub

Method 1: Single Server with Optional Parameters

All tools accept an optional projectName parameter to target different projects from a single server instance.

# Default project (uses COSENSE_PROJECT_NAME)
get_page "Meeting Notes"

# Specific project
get_page "Design Guidelines" projectName="help-ja"

Limitation: Works best with public projects or projects sharing the same authentication credentials.

Run separate MCP server instances with unique COSENSE_TOOL_SUFFIX values:

{
  "mcpServers": {
    "main-scrapbox": {
      "command": "npx",
      "args": ["-y", "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": ["-y", "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 distinct tools like get_page_main and get_page_team, allowing LLMs to automatically select the correct project.

Configuration Guide

VariablePurposeExample
COSENSE_PROJECT_NAMEActual project name for API callsmain-project
COSENSE_SIDSession ID for this projects:xxx...
COSENSE_TOOL_SUFFIXUnique suffix for tool namesmain
SERVICE_LABELDisplay name in tool descriptionsMain Scrapbox