MCP-Server

MCP-Server

0

This project is an MCP service leveraging Baidu Map API to provide geocoding, directions, weather, and more. Designed to be extensible, it supports stdio and HTTP communication, making it versatile for integration and deployment.

Baidu Map MCP Service

This project is a Model Context Protocol (MCP) service based on the Baidu Map API providing the following capabilities:

  • Geocoding Service
  • Reverse Geocoding Service
  • Place Search Service
  • Place Detail Retrieval Service
  • Distance Matrix Calculation
  • Directions Service
  • Weather Query Service
  • IP Location Service
  • Road Traffic Query Service
  • POI Intelligent Annotation

The project demonstrates building an MCP service from scratch, including defining capabilities, execution interfaces, and containerized deployment. It supports local communication through stdio and remote calling via HTTP.

Communication Modes

The service supports two communication modes:

  • Stdio Mode: Communicates through standard input/output with the MCP client, suitable for local integration.
  • HTTP Mode: Runs a web server to receive and respond to MCP requests. Provides endpoints for MCP requests, health checks, and API documentation.

Technology Stack

  • Language: TypeScript
  • Runtime: Node.js
  • Web Framework: Express
  • Param Validation: TypeScript type system
  • Environment Configuration: dotenv
  • Containerization: Docker

Quick Start

  • Clone the repository
  • Install dependencies
  • Build and launch (stdio mode by default) or HTTP mode by setting MCP_MODE=http

Configuration

Configure the service with environment variables or a .env file, including options for mode, HTTP port and host, CORS, and log level.