Skip to main content

Baidu Map MCP Server (Python)

搭建Python虚拟环境

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

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

--verbose
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已经启用

测试

行程规划:

Metadata

Release files for nipanbo-mcp-server-baidu-maps 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nipanbo-mcp-server-baidu-maps 0.1.2
File Size Uploaded Provenance
nipanbo_mcp_server_baidu_maps-0.1.2.tar.gz 10.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nipanbo-mcp-server-baidu-maps 0.1.2
File Interpreter ABI Platform
nipanbo_mcp_server_baidu_maps-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.2 kB

Release files / nipanbo_mcp_server_baidu_maps-0.1.2.tar.gz

Download URL nipanbo_mcp_server_baidu_maps-0.1.2.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a2ce37515c733f0622a92d9af6c5dffd620842c867129e29ecc99939a4e23d8c
BLAKE2b-256 checksum
How to use checksums
ed17c10c3aa26b677c3817f5b5a74d770a055096fdd42f6ebbffd61c2644d2fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / nipanbo_mcp_server_baidu_maps-0.1.2-py3-none-any.whl

Download URL nipanbo_mcp_server_baidu_maps-0.1.2-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e593212af94c185c869367301ce1d02064cb09360a2ffd731e4d5205002d0219
BLAKE2b-256 checksum
How to use checksums
7270ffd07dbf76b312da50ac004bacf33464733a949f2e3475c9d3220f8f219d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Security for nipanbo-mcp-server-baidu-maps 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page