oneCoderMan/mcp-server
3.1
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides an overview and details of the MCP Server-side code, including its features, tools, resources, and usage instructions.
一、项目描述
这是一份 MCP 的 Server 端代码
1.1 运行
默认端口 8090
// JDK 21
mvn install -Dmaven.test.skip=true
java -jar target/mcp-server-0.0.1-SNAPSHOT.jar
// 后台启动
nohup java -jar mcp-server-0.0.1-SNAPSHOT.jar &
可视化客户端工具
// Node.js: ^22.7.5
npx @modelcontextprotocol/inspector@0.16.5
2.3 功能
- 支持 WebFlux 和 STDIO 两种通信方式
- 提供天气预报查询服务(基于 OpenMeteo API)
- 提供空气质量信息查询服务(模拟数据)
- 支持响应式编程模型
- 支持工具函数的动态注册和调用
二、一些概念
- MCP Hosts run the AI models
- MCP Clients initiate requests
- MCP Servers serve context, tools, and capabilities
参考文档
MCP JAVA SDK https://github.com/modelcontextprotocol/java-sdk
MCP start https://github.com/microsoft/mcp-for-beginners/blob/main/03-GettingStarted/README.md