Skip to main content

MCP server for Amap (高德地图) API integration

Project description

Amap API MCP Server

一个用于集成高德地图API的MCP(Model Context Protocol)服务器,提供天气查询等位置相关服务。

功能

  • 实时天气查询:根据城市名称查询当前天气情况
  • 基于高德地图API的地理位置服务

安装

使用uvx安装(推荐)

uvx amap-api-mcp

使用pip安装

pip install amap-api-mcp

配置

  1. 获取高德地图API密钥:

  2. 配置环境变量:

    • 复制 .env.example 文件为 .env
    • .env 文件中设置你的API密钥:
cp .env.example .env
# 编辑 .env 文件,设置 AMAP_KEY=your_actual_api_key

使用方法

作为MCP服务器运行

amap-api-mcp

在Claude Desktop中配置

在Claude Desktop的配置文件中添加以下内容:

{
  "mcpServers": {
    "amap-api": {
      "command": "uvx",
      "args": ["amap-api-mcp"],
      "env": {
        "AMAP_KEY": "your_amap_api_key_here"
      }
    }
  }
}

API工具

天气查询

  • 工具名称: 天气查询
  • 描述: 根据输入的地名使用高德API查询实时天气
  • 参数:
    • city (字符串): 输入具体的城市,最好带上"市"、"区"防止重名

开发

安装开发依赖

pip install -e ".[dev]"

运行测试

pytest

代码格式化

black src/
isort src/

许可证

MIT License

贡献

欢迎提交Issue和Pull Request!

相关链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amap_api_mcp_goki-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amap_api_mcp_goki-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file amap_api_mcp_goki-0.1.1.tar.gz.

File metadata

  • Download URL: amap_api_mcp_goki-0.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for amap_api_mcp_goki-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78867302fb9cd4ddf06fb00adea2cbad3fedbf297abffe8f1896b639e0b5c633
MD5 f35db8974b297bd0eb31ffcb74d73cee
BLAKE2b-256 0d6d47b5e74ad70f3e50222dbdc2dcd64397787febd2853c5065ccd581dea558

See more details on using hashes here.

File details

Details for the file amap_api_mcp_goki-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for amap_api_mcp_goki-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75249b35d96ba412f12a3a2da0a85f826741819e67a1709ab69d6b46b9460a71
MD5 bcc738ef48b2e47423d95102588f9030
BLAKE2b-256 6765d15f7ce5a1f7c02a3088c48e46273b1e7cc46e642669e2cc2e892de7b2eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page