共享单车数据服务

提供实时共享单车数据和停车位信息的MCP服务器,支持查找最近的单车和停车位。

  • by colinterface
  • Python
  • 混合部署
  • 更新于
在 GitHub 查看 colinterface/bay-wheels-mcp

使用说明

Bay Wheels MCP服务器

这是一个MCP服务器,提供对Bay Wheels实时自行车共享数据的访问。

特性

  • 查找最近的自行车(标准或电动自行车)
  • 查找最近有可用空间的码头
  • 在寻找单辆自行车时,支持检查免费自行车(无桩)

设置

Claude Desktop(本地开发)

将此添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "bay-wheels": {
      "command": "/opt/homebrew/bin/uv",
      "args": [
        "--directory",
        "/path/to/bay-wheels-mcp",
        "run",
        "server.py"
      ]
    }
  }
}

请确保更新路径以匹配您的本地安装目录。

手动测试(stdio)

您可以使用Claude Desktop直接运行服务器进行测试:

uv run server.py

部署

Docker部署

快速开始

# Build the image
docker build -t bay-wheels-mcp .

# Run the container
docker run -p 8000:8000 bay-wheels-mcp

# Test the health check
curl http://localhost:8000/health

使用Docker Compose

# Start the server
docker-compose up -d

# Check logs
docker-compose logs -f

# Stop the server
docker-compose down

环境变量

  • PORT -服务器端口(默认值:8000)
  • HOST -绑定主机(默认值:0.0.0.0)

健康检查

服务器在以下位置公开健康检查端点 /health 对于容器编排:

curl http://localhost:8000/health
# Response: {"status":"healthy","service":"bay-wheels-mcp","version":"0.1.0"}

平台特定部署

AWS ECS/Fargate

  1. 将图像推送到ECR:
docker build -t bay-wheels-mcp .
docker tag bay-wheels-mcp:latest <aws-account>.dkr.ecr.<region>.amazonaws.com/bay-wheels-mcp:latest
docker push <aws-account>.dkr.ecr.<region>.amazonaws.com/bay-wheels-mcp:latest
  1. 创建启用健康检查的ECS任务定义
  2. 使用负载均衡器作为ECS服务部署

谷歌云运行

gcloud builds submit --tag gcr.io/<project-id>/bay-wheels-mcp
gcloud run deploy bay-wheels-mcp --image gcr.io/<project-id>/bay-wheels-mcp --port 8000

Fly.io

fly launch --dockerfile Dockerfile
fly deploy

Azure容器实例

使用Azure门户或Azure CLI部署暴露了端口8000的Docker映像。

连接移动应用程序

部署的服务器使用StreamableHTTP传输。配置您的MCP客户端以连接到:

URL: https://your-deployed-server.com/

看 MCP文件 有关客户端集成的详细信息。

工具

find_nearest_bike

查找最近的自行车可用性。

  • latitude:浮动
  • longitude:浮动
  • count:int(默认值1)
  • bike_type:str(可选,“经典自行车”或“电动自行车”)

find_nearest_dock_spaces

查找带有返回空格的最近码头。

  • latitude:浮动
  • longitude:浮动
  • count:int(默认值1)