Cosense MCP Server

Cosense MCP Server

site icon
2025.03.24 5
TypeScript页面管理内容管理其它
Cosense MCP Server 是一个用于 [Cosense](https://cosen.se) 的 MCP 服务器。它提供了一系列工具用于与 Cosense 页面进行交互,包括获取页面、列出页面、搜索页面以及插入文本等功能。该服务需要配置环境变量 `COSENSE_PROJECT_NAME` 和 `COSENSE_SID` 以进行身份验证和项目识别。
View on GitHub

Overview

基本能力

产品定位

Cosense MCP Server 是一个用于管理和操作 Cosense 页面的中间件服务。

核心功能

  • get_page: 获取指定标题的页面
  • list_pages: 列出资源中可用的页面
  • search_pages: 搜索包含指定查询字符串的页面
  • insert_lines: 在页面的指定行后插入文本

适用场景

  • 需要自动化管理 Cosense 页面的场景
  • 需要批量操作或搜索 Cosense 页面的场景
  • 需要在 Cosense 页面中动态插入内容的场景

工具列表

  • get_page: 获取指定标题的页面
  • list_pages: 列出资源中可用的页面
  • search_pages: 搜索包含指定查询字符串的页面
  • insert_lines: 在页面的指定行后插入文本

常见问题解答

  • 需要配置 COSENSE_PROJECT_NAMECOSENSE_SID 环境变量
  • COSENSE_SID 包含敏感信息,需谨慎处理
  • 调试建议使用 MCP Inspector

使用教程

使用依赖

JSR registry 配置

对于 Linux/macOS:

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

对于 Windows (PowerShell):

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

安装教程

从 npm registry 运行

配置 MCP 客户端:

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

从源码运行

克隆并构建:

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

配置 MCP 客户端:

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

调试方式

使用 MCP Inspector 进行调试:

npm run inspect

许可证

None