npm install
npm run build
npx vitest run
node build/index.js
或者,通过 package.json 的 bin 设置
npx jr-east-delay
作为命令执行。
通过调用“getDelays”工具,可以从 Claude Desktop 或 MCP Inspector 等 MCP 客户端获取 JR 东日本的迟延信息。
在 Claude Desktop 或 MCP Inspector 等客户端中使用本服务器时,请在配置文件(例如:claude_desktop_config.json)中按如下方式编写:
node 命令在路径中时"jr-east-delay": {
"command": "node",
"args": ["/Users/your-path/mcp-jr-east-delay/build/index.js"]
}
node 的绝对路径时"jr-east-delay": {
"command": "/Users/your-username/.nodebrew/current/bin/node",
"args": ["/Users/your-path/mcp-jr-east-delay/build/index.js"]
}
your-username 更改为您的环境中的实际用户名。your-path 更改为您的环境中的实际路径。node 命令不在路径中,请指定其绝对路径。src/index.test.ts 中编写