使用说明
Cosense MCP服务器
MCP服务器 科森斯.
工具
以下工具可用于与Cosense页面交互:
get_page:检索具有指定标题的页面list_pages:列出资源中的可用页面search_pages:搜索包含指定查询字符串的页面insert_lines:在页面中的指定行后插入文本
安装
先决条件
设置以下环境变量:
COSENSE_PROJECT_NAME--您的Cosense项目名称。COSENSE_SID--用于身份验证的会话cookie。需要用于编写页面和阅读私人页面。把这当作秘密。看https://scrapbox.io/scrapboxlab/connect.sid了解更多详情。
对于VS代码用户
使用以下一键安装按钮之一:
备注:单击按钮后,替换
your_project_name和your_sid配置中的实际值。对于手动设置,您还可以编辑.vscode/mcp.json直接。
适用于Claude桌面用户
将以下配置之一添加到您的 claude_desktop_config.json:
使用pnpm
{
"mcpServers": {
"cosense-mcp-server": {
"command": "pnpm",
"args": ["-s", "dlx", "@yosider/cosense-mcp-server"],
"env": {
"COSENSE_PROJECT_NAME": "your_project_name",
"COSENSE_SID": "your_sid"
}
}
}
}
使用纱线
{
"mcpServers": {
"cosense-mcp-server": {
"command": "yarn",
"args": ["dlx", "-q", "@yosider/cosense-mcp-server"],
"env": {
"COSENSE_PROJECT_NAME": "your_project_name",
"COSENSE_SID": "your_sid"
}
}
}
}
使用npx
此包依赖于JSR托管的包。 npx 需要将JSR注册表添加到 ~/.npmrc 第一。
步骤1:将JSR注册表添加到 ~/.npmrc
Linux/macOS:
echo "@jsr:registry=https://npm.jsr.io" >> ~/.npmrc
Windows(PowerShell):
echo "@jsr:registry=https://npm.jsr.io" >> $env:USERPROFILE\\.npmrc
步骤2:添加配置
{
"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
pnpm install
pnpm run build
然后配置您的MCP客户端以使用本地构建:
{
"mcpServers": {
"cosense-mcp-server": {
"command": "node",
"args": ["/path/to/cosense-mcp-server/build/index.js"],
"env": {
"COSENSE_PROJECT_NAME": "your_project_name",
"COSENSE_SID": "your_sid"
}
}
}
}
调试
由于MCP服务器通过stdio进行通信,调试可能具有挑战性。我们建议使用 MCP检查员,可作为包脚本使用:
pnpm run inspect
检查器将提供一个URL,用于访问浏览器中的调试工具。
致谢
这个项目是从 funwariosii/cosense mcp服务器.
