- Java Map Component Platform (Java MCP)
Java Map Component Platform (Java MCP)
Content
Java Map Component Platform (Java MCP)
基于Spring Boot的Java地图组件平台,提供包括地理编码、逆地理编码、天气查询、POI搜索、路径规划等地图服务功能。
功能特性
- 地理编码/逆地理编码:地址与经纬度的互相转换
- 天气查询:根据城市名称或adcode查询天气信息
- POI搜索:关键词搜索、周边搜索、POI详情查询
- 路径规划:支持步行、骑行、驾车、公共交通等多种出行方式
- IP定位:根据IP地址获取位置信息
- 距离测量:计算两点间直线距离、驾车距离或步行距离
技术栈
- Java 17
- Spring Boot 3.4.4
- Spring Data JPA
- H2 数据库
- Jackson JSON
- RESTful API
快速开始
环境要求
- JDK 17+
- Maven 3.6+
获取项目
git clone [repository-url]
cd java-mcp-server
配置
在 src/main/resources/application.properties 中配置高德地图 API Key:
amap.key=your_amap_key_here
构建与运行
mvn clean package
java -jar target/demo-0.0.1-SNAPSHOT.jar
或直接使用 Maven 运行:
mvn spring-boot:run
服务启动后,访问 http://localhost:8080 即可。
API 接口说明
集成接口(/api/mcp/)
| 接口路径 | 方法 | 描述 | 参数 |
|---|---|---|---|
| /status | GET | 获取系统状态信息 | - |
| /geo | GET | 地理编码(地址转坐标) | address, city(可选) |
| /regeo | GET | 逆地理编码(坐标转地址) | location(格式:经度,纬度) |
| /ip | GET | IP定位 | ip(可选) |
| /weather | GET | 天气查询 | city |
| /search | GET | POI搜索 | keywords, city(可选), types(可选) |
| /around | GET | 周边搜索 | location, radius(可选), keywords(可选) |
| /detail | GET | POI详情 | id |
| /walking | GET | 步行路径规划 | origin, destination |
| /bicycling | GET | 骑行路径规划 | origin, destination |
| /driving | GET | 驾车路径规划 | origin, destination |
| /transit | GET | 公共交通路径规划 | origin, destination, city, cityd(可选) |
| /distance | GET | 测量距离 | origins, destination, type(可选) |
独立接口
各功能模块也提供了独立的API接口,详见:
- 位置服务:
/api/location/ - 天气服务:
/api/weather/ - POI服务:
/api/poi/ - 路径规划:
/api/route/ - IP定位:
/api/ip/
开发指南
项目结构
src/main/java/com/example/demo/
├── controller/ # 控制器层
├── model/ # 数据模型层
├── service/ # 服务层
└── DemoApplication.java # 程序入口
扩展指南
要添加新的地图服务功能,请按照以下步骤操作:
- 在
model包中创建相应的实体类 - 在
service包中实现服务逻辑 - 在
controller包中创建控制器并提供API接口 - 在
McpController中集成新功能
许可证
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
Amap Maps高德地图官方 MCP Server