Back to MCP directory
publicPublicdnsLocal runtime

JR East Train Delay

JR东日本列车延迟信息MCP服务器

article

README

🚀 JR东日本 预警信息 MCP服务器

本项目是一个用于获取JR东日本预警信息的MCP服务器,可通过简单的安装和配置流程为你提供服务。

🚀 快速开始

📦 安装指南

在项目根目录下执行以下命令进行依赖安装:

npm install

🔨 构建项目

安装完成后,使用以下命令构建项目:

npm run build

🧪 测试项目

构建完成后,可使用以下命令进行测试:

npx vitest run

🚀 启动服务器

构建和测试通过后,你可以选择以下两种方式启动服务器: 方式一:

node build/index.js

方式二:通过package.jsonbin配置,使用以下命令:

npx jr-east-delay

💻 使用示例

从MCP客户端使用

通过Claude Desktop或MCP Inspector等MCP客户端调用「getDelays」工具,即可获取JR东日本的预警信息。

MCP客户端配置示例

在Claude Desktop或MCP Inspector等客户端中使用本服务器时,请在设置文件(例如:claude_desktop_config.json)中添加以下内容:

示例1: 当node命令在路径中可用时

"jr-east-delay": {
  "command": "node",
  "args": ["/Users/your-path/mcp-jr-east-delay/build/index.js"]
}

示例2: 指定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 文件中。
  • MCP协议的通信测试可以使用MCP Inspector等客户端工具。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client