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-time 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-time 0.1.2
File Size Uploaded Provenance
nipanbo_mcp_server_time-0.1.2.tar.gz 10.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 21.1 kB

Release files / nipanbo_mcp_server_time-0.1.2.tar.gz

Download URL nipanbo_mcp_server_time-0.1.2.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
33f852666f60ffd0f9d5aa3e2d7dd397ea32e5d7a07fd7af2f9e7ac5f711b66f
BLAKE2b-256 checksum
How to use checksums
d7a13444a844e8771c48cdb44121f364cf761eebe1b80a262a8630037146e878
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_time-0.1.2-py3-none-any.whl

Download URL nipanbo_mcp_server_time-0.1.2-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59a8c553956fb41cd82d16f059c30160f0bf14ce149cd7046186fea04046c07d
BLAKE2b-256 checksum
How to use checksums
290a2a52ff92ca01d75601394fb3fa0ed7bb1f769efb5df737896fea53a7ab41
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-time 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