Skip to main content

MCP Server Baidu Maps

Project description

Baidu Map MCP Server (Python)

搭建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

iflow_mcp_mcp_server_baidu_maps-0.2.4.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

iflow_mcp_mcp_server_baidu_maps-0.2.4-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_mcp_server_baidu_maps-0.2.4.tar.gz.

File metadata

File hashes

Hashes for iflow_mcp_mcp_server_baidu_maps-0.2.4.tar.gz
Algorithm Hash digest
SHA256 13807c499215c85d342a441007e05126f82527264b3789101d31ea2637f4de77
MD5 e3a1a3ceb274e2eadac56c5a4dd9f4df
BLAKE2b-256 29e79aa3447308e001ada8b857aa5215c4f949785808eed2dd2a6ccc0b449cf4

See more details on using hashes here.

File details

Details for the file iflow_mcp_mcp_server_baidu_maps-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for iflow_mcp_mcp_server_baidu_maps-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a7804217a481ac111995c1b6ad55716fbd97098a0ffd6a0538456a1cc82225a8
MD5 a6eed9e5a867687496efe27bba879434
BLAKE2b-256 2f43c5e77fcd04526b318ed4b8ee83452986ca058dcceae22508489a187bf006

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