Skip to main content

MCP Server Baidu Maps Enhanced - HTTP call Baidu Map API for MCP

Project description

Baidu Map MCP Server (Python)

🚀 快速启动(推荐)

使用 UVX 一键启动

uvx mcp-server-baidu-maps-enhanced

在 Cursor/Cherry Studio 中配置

{
  "mcpServers": {
    "baidu-maps-enhanced": {
      "command": "uvx",
      "args": ["mcp-server-baidu-maps-enhanced"],
      "env": {
        "BAIDU_MAPS_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

包地址: https://pypi.org/project/mcp-server-baidu-maps-enhanced/


传统方式:搭建 Python 虚拟环境

我们推荐通过uv构建虚拟环境来运行 MCP server,关于`uv 你可以在这里找到一些说明。

按照官方流程,你会安装Python包管理工具uv。除此之外,你也可以尝试其他方法(如Anaconda)来创建你的Python虚拟环境。

通过uv添加mcp依赖

uv add "mcp[cli]"

验证 mcp 依赖是否安装成功,执行如下命令

uv run mcp

当出现下图时代表安装成功

通过uv安装python,最低版本要求为 3.11

uv python install 3.11

获取 MCP Server

前往百度地图 Mcp Server 官方开源仓库下载

配置本地项目

通过uv创建一个项目

uv init mcp_server_baidu_maps

map.py拷贝到该目录下,通过如下命令测试 mcp server 是否正常运行

uv run --with mcp[cli] mcp run {YOUR_PATH}/mcp_server_baidu_maps/map.py
# 如果是mac,需要加转义符
uv run --with mcp\[cli\] mcp run {YOUR_PATH}/mcp_server_baidu_maps/map.py

如果没有报错则 MCP Server 启动成功

在 Cursor 中使用

打开Cursor配置,在 MCP 中添加 MCP Server

在文件中添加如下内容后保存

{
  "mcpServers": {
    "baidu-map": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "{YOUR_PATH}/mcp_server_baidu_maps/map.py"
      ],
      "env": {
        "BAIDU_MAPS_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

回到配置,此时百度 MCP Server 已经启用

测试

行程规划:

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

bach_baidu_maps-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

bach_baidu_maps-1.0.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file bach_baidu_maps-1.0.0.tar.gz.

File metadata

  • Download URL: bach_baidu_maps-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for bach_baidu_maps-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8c1149f86c4a77c181dd92efdffa14c37e1581b0217e1fc898d448852be62eae
MD5 036de64b1c3806454f8f2ed130eb4c81
BLAKE2b-256 3b4d3f343539aa00ea55755218ff02c3c918babc35988fecc9c6c9702062792d

See more details on using hashes here.

File details

Details for the file bach_baidu_maps-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bach_baidu_maps-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2ea4efbdcabc159c9edddcc0bf0dcf9d92ada11a7fd5018e48e6dad5d097b4b
MD5 60b99f1ae5aa7c058450862a24923ed1
BLAKE2b-256 f0b287a5307edbc857b9ab75441bdb8e5eddea0e454421801e484a735a295bc7

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