模型上下文协议服务器

一个用于构建和运行MCP服务器的工具,支持与Claude桌面应用集成。

  • by t-shiratori
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 t-shiratori/mcp-server-example-random-num

使用说明

Mcp服务器基本示例

准备mcp服务器应用程序

1.安装软件包

pnpm install

2.建造

pnpm build

Mcp检查员

检查器-模型上下文协议

pnpm start
pnpm inspect

Claude桌面版

下载克劳德桌面版

下载-克劳德

设置桌面配置Claude

在VSCode中打开配置文件。

code ~/Library/Application\ Support/Claude/claude_desktop_config.json

/用户/[user]/库/应用支持/Claude/Claude_desktop_config json

{
  "mcpServers": {
    "RandomNumber": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/build/index.js"]
    }
  }
}

如果你使用 布置.

$ mise which node
/Users/[user]/.local/share/mise/installs/node/22.14.0/bin/node

/用户/[user]/库/应用支持/Claude/Claude_desktop_config json

{
  "mcpServers": {
    "RandomNumber": {
      "command": "/Users/[user]/.local/share/mise/installs/node/22.14.0/bin/node",
      "args": ["/ABSOLUTE/PATH/TO/PARENT/FOLDER/build/index.js"]
    }
  }
}

参考:https://github.com/modelcontextprotocol/servers/issues/64#issuecomment-2503152420

资源