Skip to main content
Glama

onecall-mcp

一个 MCP(Model Context Protocol)服务器,将 10 个经过生产验证、无需认证的公共 API 作为工具提供给 AI 代理。

基于 onecall 构建。零 API 密钥。仅用 Python 标准库。MIT。

weather_current(location)              # wttr.in
weather_forecast(lat, lon, days)       # open-meteo
fx_convert(amount, from, to)           # frankfurter (ECB)
fx_rates(base, symbols)                # frankfurter
crypto_price(ids, vs_currency)         # coingecko
geocode(query, limit)                  # openstreetmap nominatim
country_info(query)                    # REST Countries
time_in_zone(timezone)                 # timeapi.io
hn_front()                             # Hacker News top 10
hn_search(query, limit)                # Hacker News Algolia search

为什么存在

大多数 AI 代理需要调用天气、外汇、加密货币、地理编码、时间、国家和新闻查询。这些数据在开放网络上免费可得。但代理需要的是工具,而不是 URL。该服务器在一个进程中为任何兼容 MCP 的客户端(Claude Desktop、Cursor、Windsurf、Cline、OpenAI Codex CLI 等)提供全部 10 个工具。

Related MCP server: tes-mcp-server

安装

Claude Desktop

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "onecall": {
      "command": "python3",
      "args": ["/path/to/onecall-mcp/src/onecall_mcp_server.py"]
    }
  }
}

Cursor

设置 → 功能 → Model Context Protocol → 添加新的全局 MCP 服务器。使用相同的 command/args。

Windsurf / Cline / 其他

结构相同——command 是 python 解释器,args 是 onecall_mcp_server.py 的绝对路径。

验证

# End-to-end JSON-RPC over stdio test
bash tests/mcp_stdio_smoke.sh

上次运行:10/10 通过(2026-08-26)。Initialize、tools/list、tools/call 均返回正确的 JSON-RPC 2.0,并包含实时 API 数据。

架构

  • 仅使用标准库。 不依赖 mcp 包,不需要 requests,也不需要 SDK。只需 urllib + json + asyncio。

  • stdio JSON-RPC 2.0。 遵循 MCP 规范 2024-11-05。

  • 复用 onecall 的 _lib/http.py 以实现重试、URL 编码、统一信封。

  • --demo 标志会打印工具目录并运行一次实时调用,适合进行健全性检查。

冒烟测试记录(2026-08-26)

=== Passed: 10  Failed: 0 ===

10 个断言,涵盖:协议握手、能力协商、工具发现、工具调用、实时 API 响应。

路线图

  • 添加其余 4 个 onecall 包装器(sunrise、catfact、cataas、nager holidays)

  • HTTP 传输(目前仅 stdio)

  • 每次调用的用量跟踪 + x402 稳定币付费墙集成

  • 上架至 glama.ai、smithery.ai、mcpmarket.com、mcpservers.org

许可证

MIT。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to access real-time and historical weather data through multiple weather APIs including OpenMeteo, Tomorrow.io, and OpenWeatherMap. Provides comprehensive meteorological information including current conditions, forecasts, historical data, and weather alerts.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Exposes public weather and climate data through a standardized API, allowing AI agents to retrieve current conditions, 7-day forecasts, and historical data. It enables weather-aware automation and data enrichment for conversational agents and travel planning.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides 7 tools for weather (geocoding, current conditions) and country data (capital, currency, population, dial code, flag) via Open-Meteo and CountriesNow APIs, designed for multi-agent AI systems.
    1
    -