PyMCP Sum Server

PyMCP Sum Server

A simple MCP server that provides integer addition functionality. Enables users to perform basic arithmetic operations by adding two integers together through natural language interactions.

Category
Visit Server

README

pymcp

a MCP server

SDK

https://github.com/modelcontextprotocol/python-sdk

项目结构

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的测试

环境初始化

安装依赖

使用 uv 管理依赖:

# 安装生产依赖
uv pip install -e .

# 安装测试依赖(包括生产依赖)
uv pip install -e .[test]

配置环境变量

创建 .env 文件并配置LLM相关参数:

cp .env.example .env

编辑 .env 文件,添加以下内容:

LLM_BASE_URL=https://api.siliconflow.cn/v1
LLM_API_KEY=your_api_key_here
LLM_MODEL=Qwen/Qwen3-8B

运行MCP服务器

# 运行MCP服务器
uv run mcp dev src/mcp_server/sum_int.py

或者直接运行:

python src/mcp_server/sum_int.py

真实LLM调用测试

python tests/test_sum_int_with_real_llm.py

使用LangChain Agent的测试

python tests/test_sum_int_with_agent.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工作流

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured