mcp-cosense
Provides tools for reading, searching, and safely editing Cosense (Scrapbox) projects, including browsing pages, full-text and vector search, and a two-step preview-and-submit flow for edits.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-cosense search for roadmap in our Cosense project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-cosense
An MCP server for reading, searching, and safely editing
Cosense projects through Helpfeel's official
@helpfeel/cosense-cli.
The server exposes a fixed set of MCP tools instead of a general shell. Project access is restricted by an exact URL allowlist, and writes use the official CLI's two-step, five-minute preview and submit flow.
Requirements
Node.js 24 or later, or Docker
A Cosense Personal Access Token or project Service Account
Related MCP server: workspace-mcp
Authenticate
Credentials are stored by the official Cosense CLI under ~/.cosense. Pass the
Cosense origin to store a Personal Access Token, or an exact project URL to store a
Service Account for that project.
npx mcp-cosense login https://scrapbox.ioThe token is entered interactively and is not passed through MCP.
Local MCP over stdio
Set COSENSE_ALLOWED_PROJECTS to the exact project URLs the server may access. Separate
multiple projects with commas. An empty allowlist disables all Cosense operations.
{
"mcpServers": {
"cosense": {
"command": "npx",
"args": ["-y", "mcp-cosense"],
"env": {
"COSENSE_ALLOWED_PROJECTS": "https://scrapbox.io/example-project"
}
}
}
}Running mcp-cosense without arguments uses stdio. --stdio selects it explicitly.
Docker and Streamable HTTP
Copy .env.example to .env, configure the allowlist, authenticate into the dedicated
volume, and start the server:
cp .env.example .env
docker compose --profile setup run --rm login
docker compose up -d --build serverThe endpoint is http://127.0.0.1:8798/mcp by default. The published port binds only
to loopback unless COSENSE_BIND_ADDRESS is changed.
The image also runs directly:
docker build -t mcp-cosense .
docker run --rm --read-only -p 127.0.0.1:8798:8798 \
-e COSENSE_ALLOWED_PROJECTS=https://scrapbox.io/example-project \
-v mcp-cosense-credentials:/home/cosense/.cosense:ro \
mcp-cosenseTools
browse_pagebrowse_related_pagesread_pagesearch_full_textsearch_vectorpreview_editpreview_new_pagesubmit_edit
preview_edit and preview_new_page do not change Cosense. Only submit_edit mutates
a page. A preview expires after five minutes and can be submitted only once.
Configuration
Variable | Default | Description |
| empty | Comma-separated exact project URLs; empty disables access |
| current home | Home containing |
|
| Per-command timeout |
|
| Per-stream output limit |
|
| Maximum concurrent CLI processes |
|
| HTTP listen address; Docker sets |
|
| HTTP listen port |
| localhost values | Accepted HTTP Host headers |
Security
The Cosense CLI child process receives a minimal environment and no unrelated application secrets.
The Docker image is distroless, unprivileged, and contains neither npm nor a shell.
The Compose service uses a read-only root filesystem, drops all Linux capabilities, and mounts credentials read-only outside the interactive login job.
Input size, output size, execution time, process count, and concurrency are bounded.
Project URLs are checked against the operator-configured allowlist before the CLI is invoked.
Development
npm ci
npm testAvailable Tools
8 toolsbrowse_pageBRead-onlyIdempotent
Read one Cosense page in an agent-friendly format with metadata and links.
Inputs: page_url (required). Returns: content, warnings
preview_editA
Preview an explicitly requested edit without changing the page. First call read_page and use its top-level page ID and lines[].id values. Inspect the returned complete post-edit page before calling submit_edit.
Inputs: page_id (required), operations (required), project_url (required). Returns: content, warnings
preview_new_pageA
Preview creation of a new page without changing Cosense. Use this only for an explicitly requested write. The title and each item in lines represent one Cosense line. Inspect the preview before submitting it.
Inputs: lines (required), title (required), project_url (required). Returns: content, warnings
read_pageARead-onlyIdempotent
Read structured page JSON, including page ID and line IDs used for edits.
Inputs: page_url (required). Returns: data, warnings
search_full_textARead-onlyIdempotent
Search complete Cosense page text with AND or OR matching.
Inputs: query (required), project_url (required), sort, match_any. Returns: data, warnings
search_vectorBRead-onlyIdempotent
Semantically search Cosense titles and link notation.
Inputs: query (required), project_url (required). Returns: data, warnings
submit_editADestructive
Commit one inspected Cosense edit preview. This mutates Cosense. Call it only for the same explicit user write request that produced the preview. Never retry an ambiguous result before read_page confirms whether the intended change already landed.
Inputs: preview_id (required), project_url (required). Returns: content, warnings
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
browse_page and read_page both read a single page, but their purposes are differentiated by output format and edit intent. The search tools, related-pages tool, and preview/submit tools are clearly distinct, so an agent can generally select correctly.
All tool names follow a consistent snake_case verb-first pattern such as browse_, read_, search_, preview_, and submit_. The naming conventions are uniform and predictable across the entire set.
Eight tools is a well-scoped count for a Cosense page server, covering browsing, reading, searching, previewing edits, and submitting writes without unnecessary duplication. Each tool has a clear role in the workflow.
Read, browse, search, edit-preview, and submit workflows are covered, and the preview-before-submit flow is well defined. The main gaps are the lack of explicit page deletion, page history, and a dedicated new-page submission tool, though the core page lifecycle is mostly functional.
Maintenance
Related MCP Connectors
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Governed MCP gateway for business apps: roles, previews, approvals and one audit log.
Safety gateway for MCP tools: checks every call, holds risky ones for approval, hides personal data
One MCP URL for all your connectors — scoped writes, enforced constraints, and a full audit trail.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables AI clients such as ChatGPT and Claude to safely read, analyze, update, verify, and audit GitHub Projects v2 through OAuth-secured MCP connections with role-based access control, guarded writes, bulk preview/approval/apply, checkpoints/deltas, and durable audit trails.40Apache 2.0
- AlicenseAqualityBmaintenanceEnables MCP clients to safely read, write, edit, search, and optionally run commands within one or more named project workspaces, while maintaining a work journal and tracking changes.19MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to read only explicitly allowlisted Linux project files and selected Codex conversation turns. It supports listing projects and files, reading UTF-8 files, bounded text search, and paged reading of authorized conversations.MIT
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients to read a project's Git-backed kickoff, acceptance criteria, handoff package, progress, and next step, and to append validated, audited progress events as project records. It provides short-lived scoped credentials and fail-closed tool allowlisting for safe, resumable AI-assisted development.-