PyMCP Sum Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PyMCP Sum Serveradd 15 and 27"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pymcp
a MCP server
SDK
https://github.com/modelcontextprotocol/python-sdk
Related MCP server: Addition MCP Server
项目结构
src/
└── mcp_server/
├── __init__.py
└── sum_int.py # MCP服务器实现,提供两个整数相加功能
tests/
├── test_sum_int.py # 基础功能测试
├── test_sum_int_with_real_llm.py # 真实LLM调用测试
├── test_sum_int_with_agent.py # 使用LangChain Agent的测试 (stdio方式)
├── test_sum_int_with_agent_sse.py # 使用LangChain Agent的测试 (SSE方式)
└── test_sum_int_with_agent_streamable_http.py # 使用LangChain Agent的测试 (Streamable HTTP方式)环境初始化
安装依赖
使用 uv 管理依赖:
# 安装生产依赖
uv pip install -e .
# 安装测试依赖(包括生产依赖)
uv pip install -e .[test]环境变量配置
复制 .env.example 文件并重命名为 .env,然后根据你的实际情况修改其中的值:
cp .env.example .env环境变量说明:
LLM_BASE_URL:LLM API的基础URLLLM_API_KEY:访问LLM API的密钥LLM_MODEL:要使用的模型名称MCP_SERVER_PORT:MCP服务器端口(默认为8000)
运行MCP服务器
MCP服务器支持多种传输方式:
stdio方式(默认)
# 运行MCP服务器(stdio方式)
uv run mcp dev src/mcp_server/sum_int.py
# 或者直接运行
python src/mcp_server/sum_int.py
# 或者显式指定stdio方式
python src/mcp_server/sum_int.py stdioSSE方式
# 使用SSE方式运行
python src/mcp_server/sum_int.py sse服务器将在 http://127.0.0.1:8000 启动
Streamable HTTP方式
# 使用Streamable HTTP方式运行
python src/mcp_server/sum_int.py streamable-http服务器将在 http://127.0.0.1:8000 启动
执行测试
基础功能测试
python tests/test_sum_int.py真实LLM调用测试
python tests/test_sum_int_with_real_llm.py使用LangChain Agent的测试 (stdio方式)
python tests/test_sum_int_with_agent.py使用LangChain Agent的测试 (SSE方式)
python tests/test_sum_int_with_agent_sse.py使用LangChain Agent的测试 (Streamable HTTP方式)
python tests/test_sum_int_with_agent_streamable_http.py依赖说明
生产依赖:
mcp[cli]>=1.12.4- MCP Python SDK
测试依赖:
openai>=1.99.9- OpenAI Python客户端python-dotenv>=1.0.1- 环境变量加载工具httpx[socks]>=0.28.1- HTTP客户端(支持SOCKS代理)langchain>=0.3.27- LangChain核心库langchain-openai>=0.3.29- LangChain的OpenAI集成langchain-mcp-adapters>=0.1.9- LangChain与MCP的适配器langgraph>=0.6.4- LangGraph库,用于构建agent工作流
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseCqualityDmaintenanceA demonstration MCP server that provides a simple addition tool for learning how to create and deploy servers following the Model-Context-Protocol specification. Serves as a basic example for developers getting started with MCP server development.Last updated1
- Alicense-qualityDmaintenanceA simple demonstration MCP server that provides a basic arithmetic tool for adding two numbers together, showcasing how to build custom MCP servers with input validation.Last updated17ISC
- FlicenseDqualityDmaintenanceA demonstration MCP server built with fastmcp that provides basic utility tools including number addition and greeting functionality. Integrates with Gemini CLI to enable natural language interaction with simple mathematical and greeting operations.Last updated2
- Alicense-qualityDmaintenanceA simple tutorial MCP server that provides a basic addition tool for adding two numbers together, demonstrating fundamental MCP server implementation.Last updated18ISC
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ChaosXu/pymcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server