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.0.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.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: amap_api_mcp_goki-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c2b768cfda76792879be024f945d3b99cfc431875f45a49df3297aa14fd230d0
MD5 edba9dca860548c591f52483512dc104
BLAKE2b-256 34a2ae1ec6532fdca31d57c0f62ffe1a1ef212d1ace6cbf93da0f6441a389643

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for amap_api_mcp_goki-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db9b1b6fa06ff0e6427f24db250ac5b4bdf9572cc7799bf54be055abe6563e7e
MD5 7e3fadf576c9f335ddcb49e31076c756
BLAKE2b-256 e68ceb398443f7e4a446b0a29f93a0f9da45448fb45462c75e5b1833ed64f627

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