Cover image
Try Now
2025-03-30

java-mcp-server

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

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  # 程序入口

扩展指南

要添加新的地图服务功能,请按照以下步骤操作:

  1. model 包中创建相应的实体类
  2. service 包中实现服务逻辑
  3. controller 包中创建控制器并提供API接口
  4. McpController 中集成新功能

许可证

MIT License

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • jae-jae
  • MCP server for fetch web page content using Playwright headless browser.

  • HiveNexus
  • An AI chat bot for small and medium-sized teams, supporting models such as Deepseek, Open AI, Claude, and Gemini. 专为中小团队设计的 AI 聊天应用,支持 Deepseek、Open AI、Claude、Gemini 等模型。

  • patruff
  • Bridge between Ollama and MCP servers, enabling local LLMs to use Model Context Protocol tools

  • ravitemer
  • A powerful Neovim plugin for managing MCP (Model Context Protocol) servers

    Reviews

    3 (1)
    Avatar
    user_86myaZOV
    2025-04-16

    As a loyal user of java-mcp-server, I highly recommend this project by h7ml. The server is robust, easy to navigate, and perfectly designed for Java enthusiasts. The GitHub repository offers clear documentation and seamless integration. This project undoubtedly enhances my server management experience. A must-try for Java developers!