Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AIFire in da houseCheck it out free

cosense-mcp-server

MCP.Pizza Chef: yosider

The Cosense MCP Server is a dedicated MCP server designed to integrate with the Cosense platform, enabling structured, real-time interaction with Cosense pages. It provides tools to retrieve pages by title, list available pages, search pages by query, and insert text into pages. The server requires authentication via session ID for accessing private pages and writing capabilities, ensuring secure operations. It leverages dependencies from the JSR registry, including @cosense/std and @cosense/types, to facilitate smooth integration. This server is ideal for developers looking to build AI-enhanced workflows or agents that interact with Cosense content programmatically through the MCP protocol.

Use This MCP server To

Retrieve Cosense pages by title for content access List all available Cosense pages in a project Search Cosense pages for specific keywords or queries Insert or update text lines within Cosense pages Authenticate and manage private page access securely

README

Cosense MCP Server

A MCP server for Cosense.

Tools

The following tools are available for interacting with Cosense pages:

  • get_page: Retrieves a page with the specified title
  • list_pages: Lists available pages in the resources
  • search_pages: Searches for pages containing the specified query string
  • insert_lines: Inserts text after a specified line in a page

MCP Client Configuration

The following environment variables are required:

  • COSENSE_PROJECT_NAME: Project name
  • COSENSE_SID: Session ID for authentication
    • Required for writing to pages and reading private pages
    • Handle with care as it contains sensitive information
    • For more details, see scrapboxlab/connect.sid

Run from npm registry

JSR registry configuration

This package depends on @cosense/std and @cosense/types which are hosted on JSR. Before using npx, you need to configure the JSR registry globally:

For Linux/macOS:

echo "@jsr:registry=https://npm.jsr.io" >> ~/.npmrc

For Windows (PowerShell):

echo "@jsr:registry=https://npm.jsr.io" >> $env:USERPROFILE\.npmrc

Or if you prefer not to modify global settings, run from source instead (see the section below)

Client json configuration

After configuring JSR registry, configure your MCP client:

{
  "mcpServers": {
    "cosense-mcp-server": {
      "command": "npx",
      "args": ["-y", "@yosider/cosense-mcp-server"],
      "env": {
        "COSENSE_PROJECT_NAME": "your_project_name",
        "COSENSE_SID": "your_sid"
      }
    }
  }
}

Run from source

Clone and build

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

Client json configuration

{
  "mcpServers": {
    "cosense-mcp-server": {
      "command": "npx",
      "args": ["-y", "/path/to/cosense-mcp-server"],
      "env": {
        "COSENSE_PROJECT_NAME": "your_project_name",
        "COSENSE_SID": "your_sid"
      }
    }
  }
}

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspect

The Inspector will provide a URL to access debugging tools in your browser.

Acknowledgments

This project is forked from funwarioisii/cosense-mcp-server.

cosense-mcp-server FAQ

How do I authenticate with the Cosense MCP Server?
You must provide a valid COSENSE_SID session ID environment variable, which is required for reading private pages and writing to pages. Handle this ID securely as it contains sensitive information.
What environment variables are required to run the Cosense MCP Server?
The server requires COSENSE_PROJECT_NAME to specify the project and COSENSE_SID for session authentication.
Can I modify Cosense pages using this MCP server?
Yes, the server supports inserting text lines into pages via the insert_lines tool, allowing programmatic content updates.
Is it possible to search for content within Cosense pages?
Yes, the search_pages tool allows searching pages for specific query strings.
What dependencies does the Cosense MCP Server rely on?
It depends on @cosense/std and @cosense/types packages hosted on the JSR registry for core functionality.
How do I list all pages available in a Cosense project?
Use the list_pages tool provided by the MCP server to retrieve a list of all pages in the project.
Is the Cosense MCP Server suitable for building AI agents?
Yes, it enables AI models to interact with Cosense content in real-time, supporting enhanced workflows and automation.
Where can I find more information about session ID handling?
Refer to the scrapboxlab/connect.sid documentation linked in the server's README for detailed guidance on session management.