Skip to main content
Glama
MapmyIndia Mappls MCP Server

MapmyIndia Mappls MCP Server

MapmyIndia (Mappls) MCP Server (FastMCP)

一个面向 MapmyIndia (Mappls) REST API 的高性能 Model Context Protocol (MCP) 服务器,基于 FastMCP 开源框架构建。

该服务器使 AI 助手(如 Claude、Gemini、ChatGPT、Cursor 和 Antigravity)能够查询地理数据、执行地理编码、生成驾车和步行路线、计算距离矩阵 ETA、发现兴趣点(POI),并查询印度各地的 eLoc 地点详情。


功能特性

  • FastMCP 框架:基于 Prefect HQ 的 fastmcp Python 框架构建,支持自动 schema 生成、稳健的验证和低延迟。

  • 灵活的身份验证:

    • 静态访问令牌模式:直接传入 bearer MAPPLS_ACCESS_TOKEN。

    • OAuth 2.0 客户端凭证流程:传入 MAPPLS_CLIENT_ID 和 MAPPLS_CLIENT_SECRET,实现令牌自动生成和过期前自动刷新。

  • 全面的 Mappls 工具:

    • mappls_geocode:将地点名称转换为经纬度坐标和 eLoc 代码。

    • mappls_reverse_geocode:将坐标转换为格式化的地址详情。

    • mappls_autosuggest:实时预测性地点搜索建议。

    • mappls_get_directions:路线导航(驾车、骑行、步行、卡车),提供逐向步骤。

    • mappls_distance_matrix:N 对 M 的出行时间和距离矩阵计算。

    • mappls_snap_to_road:将带有噪声的 GPS 坐标轨迹匹配到道路网络。

    • mappls_search_nearby:发现附近的兴趣点(餐厅、ATM、医院、电动汽车充电桩、加油站)。

    • mappls_place_details:检索任意 6 位 Mappls eLoc 代码的丰富属性。

    • mappls_text_search:支持拼写纠正的 AI 智能地点搜索。

  • 内置 MCP 提示词(Prompts):预配置的模板,如 plan_itinerary 和 optimize_logistics_hub。

  • 双传输支持:可通过 stdio(适用于桌面应用)或 sse(适用于 HTTP 微服务)运行。

  • 离线 / 模拟模式:未提供 API 密钥时,可在 dry-run 模式下无缝运行。


Related MCP server: NextBillion.ai MCP Server

安装与设置

1. 环境要求

  • Python 3.10 或更高版本

  • MapmyIndia (Mappls) 开发者凭证或访问令牌(来自 Mappls Console)

2. 环境配置

克隆或复制此仓库,然后根据 .env.example 创建 .env 文件:

cp .env.example .env

编辑 .env 并填写你的 Mappls 令牌或客户端凭证:

# Option A: Direct Access Token (Recommended for Token Input)
MAPPLS_ACCESS_TOKEN=your_access_token_here

# Option B: Client Credentials
MAPPLS_CLIENT_ID=your_client_id_here
MAPPLS_CLIENT_SECRET=your_client_secret_here

MCP_TRANSPORT=stdio

3. 安装包

以可编辑模式安装该包:

pip install -e .

或安装包含开发依赖的版本:

pip install -e ".[dev]"

面向所有人的快速设置(通过 uvx 直接从 GitHub 运行)

任何人都可以通过 uvx(随 uv 附带)直接从 GitHub 使用此 MCP 服务器,无需克隆或本地安装。

1. Claude Desktop(claude_desktop_config.json)

{
  "mcpServers": {
    "mappls": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/Bhupendrajee07/MMI-MCP.git",
        "mmi-mcp"
      ],
      "env": {
        "MAPPLS_CLIENT_ID": "YOUR_MAPPLS_CLIENT_ID",
        "MAPPLS_CLIENT_SECRET": "YOUR_MAPPLS_CLIENT_SECRET"
      }
    }
  }
}

2. Antigravity / Cursor / VS Code(mcp_config.json)

{
  "mcpServers": {
    "mappls": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/Bhupendrajee07/MMI-MCP.git",
        "mmi-mcp"
      ],
      "env": {
        "MAPPLS_ACCESS_TOKEN": "YOUR_MAPPLS_ACCESS_TOKEN"
      }
    }
  }
}

本地开发与使用

通过 Stdio 运行(默认)

mmi-mcp
# or
python -m mmi_mcp.server --transport stdio

通过 SSE 运行(HTTP 服务器)

python -m mmi_mcp.server --transport sse --host 127.0.0.1 --port 8000

运行测试

运行单元测试和集成测试套件:

$env:PYTHONPATH="src"; python -m pytest tests/ -v

许可证

MIT License

Available Tools

9 tools
mappls_autosuggestMappls AutosuggestA

Auto-suggest location search predictions for user input as text is typed. Returns ranked place recommendations.

Inputs: query (required), zoom, location. Returns: object

mappls_distance_matrixMappls Distance MatrixA

Calculate travel distances and durations matrix between multiple origin and destination points in India.

Inputs: origins (required), destinations (required), profile. Returns: object

mappls_geocodeMappls GeocodeA

Geocode an address or location text to retrieve latitude, longitude, eLoc code, and standardized address details in India.

Inputs: address (required), region. Returns: object

mappls_get_directionsMappls Get DirectionsB

Get driving, walking, biking, or trucking navigation directions between origin and destination coordinates/eLocs in India.

Inputs: origin (required), destination (required), profile, resource, +1 more. Returns: object

mappls_place_detailsMappls Place DetailsB

Retrieve rich location attributes and details for a location using its 6-character Mappls eLoc code.

Inputs: eloc (required). Returns: object

mappls_reverse_geocodeMappls Reverse GeocodeA

Reverse geocode a pair of geographic coordinates (latitude and longitude) to get the corresponding formatted address and administrative details.

Inputs: latitude (required), longitude (required). Returns: object

mappls_search_nearbyMappls Search NearbyA

Search points of interest (POIs) such as restaurants, fuel stations, ATMs, EV chargers, hospitals, hotels near given coordinates.

Inputs: keywords (required), latitude (required), longitude (required), page, +1 more. Returns: object

mappls_snap_to_roadMappls Snap To RoadA

Snap raw GPS coordinates trace to the nearest road network segments to smooth GPS noise.

Inputs: coordinates (required), profile. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool maps to a distinct location API operation: geocoding, reverse geocoding, typeahead suggestions, routing, distance matrix, road snapping, nearby POI search, place details, and text search. The only real overlap is between autosuggest and text_search, but their descriptions clarify the intended use cases.

    Naming Consistency4/5

    All tools share a consistent mappls_ prefix and snake_case format. Most names follow a verb-plus-object style like get_directions or search_nearby, though a few are bare nouns such as distance_matrix and place_details, so the pattern is clean but not perfectly uniform.

    Tool Count5/5

    Nine tools is well-scoped for a location/mapping server. Each tool covers a distinct workflow with no obvious redundancy, and the count is within the ideal range for an MCP toolset.

    Completeness4/5

    The server covers the core read-only location lifecycle well: geocode and reverse geocode, place search and details, directions, distance matrix, and map matching. Advanced features like static map rendering or route optimization are absent, but common mapping workflows have no critical gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers