Get the FREE Ultimate OpenClaw Setup Guide →

mcp

Baidu Map MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio baidu-maps-mcp npx -y @baidumap/mcp-server-baidu-map \
  --env BAIDU_MAP_API_KEY="<YOUR_API_KEY>"

How to use

Baidu Map MCP Server provides a suite of MCP-compliant geospatial APIs that you can call from any MCP client, including LLMs and agent platforms. The server exposes a collection of tools such as map_geocode, map_reverse_geocode, map_search_places, map_directions, map_weather, and more, enabling workflows from geocoding and POI search to route planning and weather lookups. To use it, obtain an API key from Baidu Maps Open Platform and configure it in your MCP client configuration so the server can authenticate requests. You can run either the Python or Node.js deployment depending on your stack, and then wire up your MCP client to point at the server via the provided mcpServers block. The server is designed to work efficiently with SSE for low-latency streaming responses, making it suitable for real-time navigation assistants and travel planners.

How to install

Prerequisites:

  • Python 3.10–3.12 or Node.js with npm/yarn
  • Access to Baidu Maps API Key
  • Internet access to install packages

Option A: Python deployment

  1. Create a virtual environment (optional but recommended): python -m venv venv source venv/bin/activate # Linux/macOS .\venv\Scripts\activate # Windows
  2. Install the package (if distributing via PyPI): pip install mcp-server-baidu-maps
  3. Run the server: python -m mcp_server_baidu_maps
  4. In your MCP client, configure the server with the API key: { "mcpServers": { "baidu-maps": { "command": "python", "args": ["-m", "mcp_server_baidu_maps"], "env": { "BAIDU_MAPS_API_KEY": "<YOUR_API_KEY>" } } } }

Option B: Node.js deployment

  1. Install the node package: npm install @baidumap/mcp-server-baidu-map
  2. Run the server (via npx): npx -y @baidumap/mcp-server-baidu-map
  3. In your MCP client, configure the server: { "mcpServers": { "baidu-map": { "command": "npx", "args": [ "-y", "@baidumap/mcp-server-baidu-map" ], "env": { "BAIDU_MAP_API_KEY": "<YOUR_API_KEY>" } } } }

Notes:

  • The API keys should be kept secret and not exposed in client-side code.
  • If you plan to use advanced features like map_poi_extract, ensure you have the necessary permissions on your Baidu Maps account.

Additional notes

Tips and common considerations: - SSE is recommended for stable, low-latency streaming responses. - Ensure your Baidu Maps API key has MCP (SSE) access enabled. - Some advanced features (e.g., map_poi_extract) require elevated permissions. - Use environment variables to securely manage API keys. - When running on shared infrastructure, consider rate limits and caching for frequently requested POIs or routes. - Verify CORS and network access if your MCP client runs in a different environment or behind a proxy.

Related MCP Servers

Sponsor this space

Reach thousands of developers