Skip to main content
Glama
yosider
by yosider

Cosense MCP 服务器

Cosense的 MCP 服务器。

工具

以下工具可用于与 Cosense 页面进行交互:

  • get_page :检索具有指定标题的页面

  • list_pages :列出资源中可用的页面

  • search_pages :搜索包含指定查询字符串的页面

  • insert_lines :在页面的指定行后插入文本

Related MCP server: MCP Tool

MCP 客户端配置

需要以下环境变量:

  • COSENSE_PROJECT_NAME :项目名称

  • COSENSE_SID :用于身份验证的会话 ID

    • 写入页面和读取私有页面所必需的

    • 小心处理,因为它包含敏感信息

    • 更多详细信息,请参阅scrapboxlab/connect.sid

从 npm 注册表运行

JSR 注册表配置

此包依赖于托管在 JSR 上的@cosense/std和@cosense/types 。在使用 npx 之前,您需要全局配置 JSR 注册表:

对于 Linux/macOS:

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

对于 Windows (PowerShell):

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

或者,如果您不想修改全局设置,请从源代码运行(请参阅下面的部分)

客户端json配置

配置 JSR 注册表后,配置您的 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

客户端json配置

{
  "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 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:

npm run inspect

检查器将提供一个 URL 来访问浏览器中的调试工具。

致谢

该项目是从funwarioisii/cosense-mcp-server分叉而来的。

Available Tools

4 tools
get_pageB

Get a page with the specified title from the Cosense project.

ParametersJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the page

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, error handling for missing pages, or side effects. The term 'get' implies reading, but this is not explicitly stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the tool's purpose without any unnecessary words. It is well-structured and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple get operation with one parameter, the description is minimally adequate. However, it omits details about the return value and error conditions, which would be helpful since no output schema is provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already has 100% coverage with a description for the 'title' parameter. The description does not add additional meaning beyond what the schema provides, so it meets the baseline for schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get a page with the specified title from the Cosense project,' using a specific verb and resource. It distinguishes itself from siblings like list_pages (listing) and search_pages (searching) by focusing on retrieval by title.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool over siblings or when not to use it. The description merely defines the action without contextual usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

insert_linesA

Insert lines after the specified target line in a Cosense page. If the target line is not found, append to the end of the page.

ParametersJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the page to modify
targetLineTextYesText of the line after which to insert new content. If not found, content will be appended to the end.
textYesText to insert. If you want to insert multiple lines, use \n for line breaks.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, but the description discloses the main action and the fallback behavior when target is not found. It does not mention potential side effects, error handling (e.g., page not found), or behavior with multiple matching target lines, but overall behavior is clear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the main action, and contains no fluff. Every sentence adds essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple insertion tool with three parameters, the description adequately covers the key behaviors (insert after target line, fallback append). It lacks mention of error cases (e.g., page not existing) or duplicate target lines, but these are not critical for basic understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides 100% coverage for parameter descriptions. The tool description adds value by clarifying the fallback behavior of 'targetLineText' (append if not found), which is not in the schema. This enhances meaning beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'insert lines' and specifies the resource 'Cosense page' and location 'after the specified target line'. It clearly distinguishes from siblings (get_page, list_pages, search_pages) which are read-only tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for inserting lines after a target or appending, but does not explicitly state when to use it vs. alternatives, nor does it provide exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_pagesC

List Cosense pages in the project.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.9/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite having no annotations, the description fails to disclose any behavioral traits such as being read-only, having side effects, or requiring authentication. The agent gets no safety context beyond the verb 'list.'

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, succinct clause with no extraneous words. It is front-loaded and perfectly concise for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema and annotations, the description lacks information about return format, whether all pages are listed, or any ordering. This is insufficient for full autonomous use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters and schema coverage at 100%, the description adds value by specifying the resource ('Cosense pages') and scope ('in the project'), which is not captured by the empty input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it lists Cosense pages in a project, using a specific verb and resource. It differentiates from siblings like get_page (single page) and search_pages (filtered). However, it does not specify if it returns all pages or just a subset, lacking slight scope detail.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like get_page, insert_lines, or search_pages. The agent must infer context from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_pagesB

Search for pages containing the specified query string in the Cosense project.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string (space separated)

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description does not disclose behavioral traits such as read-only nature, case sensitivity, pagination, or result limits. It only restates the function name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no redundant information. Highly concise and front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple tool with one parameter and no output schema. However, lacks details on return format, result ordering, or behavior for empty/missing queries.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with one parameter described as 'Search query string (space separated)'. The description does not add meaning beyond the schema, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (search) and the resource (pages containing query string) and specifies the context (Cosense project). It distinguishes from siblings like get_page (single page) and list_pages (list all) by using 'Search', but does not explicitly contrast.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., list_pages or get_page). No mention of when-not-to-use or conditions like partial matching, pagination, or sorting.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedget_page
    • First observedinsert_lines
    • First observedlist_pages
    • First observedsearch_pages

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinct purpose: get_page retrieves a specific page, insert_lines modifies page content, list_pages enumerates pages, and search_pages queries by text. No functional overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores (get_page, insert_lines, list_pages, search_pages), making them predictable and easy to understand.

Tool Count4/5

With 4 tools, the set is concise but covers essential operations for a Cosense server: reading, writing, listing, and searching. It is slightly minimal but appropriate for the domain.

Completeness3/5

The tools cover basic CRUD-like operations (get, insert, list, search) but lack delete or create functionality for pages explicitly. Insert_lines may create content but not a new page. Some gaps exist.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers