mcp

Baidu Map MCP Server

GitHub Stars

338

User Rating

Not Rated

Favorites

0

Views

46

Forks

37

Issues

12

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Python 3.10以上

Installation

Installation

Prerequisites

Please specify required software and versions:
Python: 3.10 or higher

Installation Steps

1. Clone Repository

bash
git clone https://github.com/baidu-maps/mcp
cd mcp

2. Install Dependencies

bash
pip install -r requirements.txt

3. Start Server

bash
python server.py

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check Python version and reinstall dependencies. Issue: API not responding Solution: Check server logs and review configurations.

Configuration

Configuration

Basic Configuration

Server Setup

Edit config.json to configure the MCP server:
json
{
  "server": {
    "port": 3000,
    "logLevel": "info"
  }
}

Environment Variables

Set the following environment variables as needed:
bash
export API_KEY="your-api-key"
export DEBUG="true"

Advanced Configuration

Security Settings

Store API keys in environment variables or secure configuration files
Set appropriate file access permissions
Adjust logging levels

Performance Tuning

Configure timeout values
Limit concurrent executions
Set up caching

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Programmatic Usage

python
import requests

def call_mcp_tool(tool_name, params):
    response = requests.post(
        'http://localhost:3000/mcp/call',
        json={
            'tool': tool_name,
            'parameters': params
        }
    )
    return response.json()

Usage example

result = call_mcp_tool('geocode', {'address': 'Beijing'}) print(result)

Use Cases

Developing a travel assistant application.
Building a logistics platform.
Implementing smart city solutions.
Enhancing agents powered by LLMs.
Developing navigation apps utilizing real-time traffic information.