MCP
This repository contains Model Context Protocol (MCP) server implementations that demonstrate how to create and integrate custom tools and data sources with AI applications. MCP is an open-source standard that enables AI applications like Claude or ChatGPT to connect to external systems, data sources, and tools in a standardized way.
claude mcp add --transport stdio omchoksi108-mcp-server python math_server.py \ --env GROQ_API_KEY="your-groq-api-key"
How to use
This MCP repository provides two Python-based servers that expose tools for AI agents via the MCP protocol. The math_server offers basic arithmetic operations (addition and multiplication) over stdio, enabling fast, synchronous computation with simple IO channels. The weather_server provides location-based weather information over a streamable-http transport, allowing streaming data retrieval and progressive updates. Together, these servers demonstrate how to extend AI capabilities with external functionality in a standardized way and how to connect a client to multiple servers from the same MCP bundle. To use them, start the servers with Python and then run the client demo to see math calculations and weather queries in action. The client.py script will exercise both servers through the MCP protocol, showing how to invoke the math operations and fetch weather data via the HTTP-based transport.
How to install
Prerequisites:
- Python 3.8+ (recommended 3.9+)
- A virtual environment tool (venv is included with Python)
- Internet access to install dependencies via uv (uvx) sync as described below
Step-by-step installation:
-
Create and activate a virtual environment
- Windows: python -m venv .venv && ..venv\Scripts\activate
- macOS/Linux: python3 -m venv .venv && source .venv/bin/activate
-
Install dependencies using uv sync (as per the repo's guide)
- uv sync
- If you have a requirements file, install: pip install -r requirements.txt
-
Create and populate environment variables
- Copy .env.example to .env and insert your GROQ_API_KEY or other required vars
-
Start the MCP servers
- Start math server: python math_server.py
- Start weather server: python weather_server.py
-
Run the client demonstration
- python client.py
Notes:
- The math server uses stdio transport; the weather server uses streamable-http transport. They may need to be started in separate terminal sessions.
- If you modify server ports or endpoints, ensure the client is configured to connect to the updated addresses.
- The GROQ_API_KEY is required by the client and may be needed by the weather data provider depending on implementation details.
Additional notes
Tips and common issues:
- Ensure your Python virtual environment is active before starting servers and running the client.
- If you encounter port binding errors, check that the weather server (streamable-http) and math server (stdio) are not conflicting on any ports used by the client.
- Set GROQ_API_KEY in a .env file or environment to avoid auth errors in the client and potential weather data retrieval.
- If using Windows, paths in args may require normalization; ensure math_server.py and weather_server.py exist at the repository root or adjust paths accordingly.
- Review the MCP documentation to understand how to add additional servers or swap transports if you extend this example.
Related MCP Servers
AgentChat
AgentChat 是一个基于 LLM 的智能体交流平台,内置默认 Agent 并支持用户自定义 Agent。通过多轮对话和任务协作,Agent 可以理解并协助完成复杂任务。项目集成 LangChain、Function Call、MCP 协议、RAG、Memory、Milvus 和 ElasticSearch 等技术,实现高效的知识检索与工具调用,使用 FastAPI 构建高性能后端服务。
aws-cost-explorer
MCP server for understanding AWS spend
mcp-python-interpreter
MCP Python Interpreter: run python code. Python-mcp-server, mcp-python-server, Code Executor
mcp-playground
A Streamlit-based chat app for LLMs with plug-and-play tool support via Model Context Protocol (MCP), powered by LangChain, LangGraph, and Docker.
MCP-MultiServer-Interoperable-Agent2Agent-LangGraph-AI-System
This project demonstrates a decoupled real-time agent architecture that connects LangGraph agents to remote tools served by custom MCP (Modular Command Protocol) servers. The architecture enables a flexible and scalable multi-agent system where each tool can be hosted independently (via SSE or STDIO), offering modularity and cloud-deployable execut
ai-learning
AI Learning: A comprehensive repository for Artificial Intelligence and Machine Learning resources, primarily using Jupyter Notebooks and Python. Explore tutorials, projects, and guides covering foundational to advanced concepts in AI, ML, DL and Gen/Agentic Ai.