
MCP-server-study
个人学习 MCP
1
Github Watches
0
Github Forks
0
Github Stars
MCP 学习项目⚡
🌟 项目简介
本项目是一个基于MCP协议的学习项目,主要用于学习MCP Server如何实现。 api_server目录内是一个使用FastAPI库实现的一组API服务接口,用来模拟现有系统的java后端服务,本项目内只是实现了加减乘除四则运算。 tests目录下是一个针对api_server的单元测试程序,用来熟悉pytest功能。 mcp_server目录下是mcp的server内容,包含mcp的两种实现方式
第一种是stdio方式
主要就是本地调用,本地运行的方式,主要实现包含在server.py代码中。 使用方式可以使用cline插件进行调用,下面附上cline调用的cfg配置
{
"mcpServers": {
"math": {
"timeout": 60,
"command": "mcp",
"args": [
"run",
"\mcp_server\server.py"
],
"transportType": "stdio",
"disabled": true
}
}
}
stdio运行方式
#进入api_server目录下
python main.py
#启动api 服务
#配置好cline的cfg后
#在cline中测试mcp server
第二种是sse方式
使用uvicon生成一个服务,使用cline插件的remote server方式进行配置连接。 主要功能包含在remote_server.py中,下面附上cline的cfg配置
{
"mcpServers": {
"calculate": {
"autoApprove": [
"calculate_sum",
"calculate_subtract",
"calculate_multiply",
"calculate_divide"
],
"disabled": false,
"timeout": 60,
"url": "http://127.0.0.1:8001/sse",
"transportType": "sse"
}
}
}
sse运行方式
#进入api_server目录下
python main.py
#启动api 服务
#进入mcp_server目录下
python remote_server.py
#启动mcp server
#配置好cline的cfg后
#在cline中测试mcp server
🌟 系统架构
graph LR
Client-->|SSE Streaming| MCP_Server["MCP Server (Port 8001)"]
MCP_Server-->|HTTP RPC| API_Server["API Server (Port 8000)"]
API_Server-.->|Call Function| FUNC[(计算函数)]
subgraph 计算服务
API_Server
end
✨ 核心功能
- 🧮 四则运算工具集(加减乘除)
- 📡 基于SSE的实时消息传输
- ⚡ 异步HTTP客户端支持
- 🔒 强类型输入校验
🛠️ 技术栈
- 框架: Starlette
- 服务器: Uvicorn
- HTTP客户端: HTTPX
- 传输协议: MCP Server-Sent Transports
🚀 快速开始
前置要求
- Python 3.10+
- uv
# 安装依赖
pip install -r requirements.txt
相关推荐
I find academic articles and books for research and literature reviews.
Confidential guide on numerology and astrology, based of GG33 Public information
Advanced software engineer GPT that excels through nailing the basics.
Take an adjectivised noun, and create images making it progressively more adjective!
Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.
Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)
MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.
Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle
La communauté du curseur et de la planche à voile, recherchez des règles et des MCP
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
Reviews

user_R4DptGqm
I've been using Mcp-Server-Study, created by uoky5217, and it has significantly enhanced my server management experience. The comprehensive features and smooth performance are impressive. If you're looking for a reliable and efficient server solution, I highly recommend checking it out on their GitHub page at https://github.com/uoky5217/mcp_server.