Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Create and activate a virtual environment

    • Windows: python -m venv .venv && ..venv\Scripts\activate
    • macOS/Linux: python3 -m venv .venv && source .venv/bin/activate
  2. 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
  3. Create and populate environment variables

    • Copy .env.example to .env and insert your GROQ_API_KEY or other required vars
  4. Start the MCP servers

    • Start math server: python math_server.py
    • Start weather server: python weather_server.py
  5. 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

Sponsor this space

Reach thousands of developers