Skip to main content
Glama

Model Context Protocol Multi-Agent Server

Model Context Protocol (MCP) Multi-Agent Demo

This project demonstrates how to set up and communicate with custom Model Context Protocol (MCP) servers in Python. It showcases multi-agent orchestration using LangChain, Groq, and MCP adapters, enabling both local and remote tool integration.

Features

  • Custom MCP Servers: Math and Weather agents, each as independent MCP servers
  • Multi-Transport Communication: Local (stdio) and remote (HTTP) transports
  • LangChain Integration: Unified agent interface for tool invocation
  • Async Orchestration: Efficient, non-blocking agent communication

Components

1. mathserver.py

A custom MCP server providing math operations (add, multiply) via stdio transport.

2. weather.py

A custom MCP server providing weather information via HTTP transport - (Static content for demo).

3. client.py

A Python client that connects to both servers, discovers their tools, and invokes them using a LangChain agent powered by Groq.

Setup Instructions

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
  • Create a .env file with your GROQ_API_KEY:
    GROQ_API_KEY=your_groq_api_key_here
  1. Run the servers:
  • Start the weather server (in one terminal):
    python weather.py
  • The math server is started automatically by the client when needed.
  1. Run the client:
python client.py

Example Output

Math Response: The answer is 900 Weather Response: The weather in delhi is sunny

Learning Outcomes

  • How to build and register custom MCP servers
  • How to enable communication between agents using stdio and HTTP
  • How to orchestrate multi-agent workflows with LangChain

Requirements

  • Python 3.8+
  • See requirements.txt for Python dependencies

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Demonstrates custom MCP servers for math and weather operations, enabling multi-agent orchestration using LangChain, Groq, and MCP adapters for both local and remote tool integration.

  1. Features
    1. Components
      1. 1. mathserver.py
      2. 2. weather.py
      3. 3. client.py
    2. Setup Instructions
      1. Example Output
        1. Learning Outcomes
          1. Requirements
            1. License

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol (MCP) server that enables AI assistants and LLMs to access real-time weather data and forecasts by connecting to the OpenWeatherMap API.
                Last updated -
                Python
                • Apple
              • -
                security
                F
                license
                -
                quality
                A modular server based on Model Context Protocol (MCP) that provides weather queries, mathematical calculations, and search functionalities.
                Last updated -
                TypeScript
              • -
                security
                F
                license
                -
                quality
                A multi-agent system that connects a math server and weather server, allowing users to perform mathematical operations and retrieve weather information based on the numerical results.
                Last updated -
                Python
              • A
                security
                F
                license
                A
                quality
                A simple Node.js MCP server that exposes three tools: greet for personalized messages, calculate for basic math operations, and weather_info for mock weather data retrieval.
                Last updated -
                3
                JavaScript

              View all related MCP servers

              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/DHEERAJPRAKASH/MCP_PROJECT'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server