mcpField
๐Ÿง 
๐Ÿง  Model Context Protocol (MCP)

๐Ÿง  Model Context Protocol (MCP)

Local
github.com/Ginga1402AI & Agents2Updated 81w ago

About ๐Ÿง  Model Context Protocol (MCP)

An open-source Python demo of MCP clients and servers using LangChain MCP Adapters and Ollama. It includes math and simulated weather servers, plus single- and multi-server client examples.

Key features

  1. 01Demonstrate math and weather MCP servers
  2. 02Connect a client to a single server
  3. 03Discover tools across multiple servers
  4. 04Use LangChain MCP Adapters with Ollama

Use cases

  1. 01Learn basic MCP client-server interactions
  2. 02Try a client with math tools
  3. 03Explore tool discovery across two servers

MCP support

Includes MCP servers exposing simple math operations and simulated weather responses, alongside clients that connect to one or both servers.

Configuration

Local server config is the same for every client. Copy it into your clientโ€™s MCP config file.

No install method listed yet

We havenโ€™t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

๐Ÿง  Model Context Protocol (MCP)

An open-source standard to seamlessly connect Large Language Models (LLMs) with the external world โ€” databases, APIs, services, and more.


๐ŸŒ What is MCP?

Model Context Protocol (MCP) is a new open-source protocol designed to empower LLMs by enabling them to interface with external tools, services, and data sources. Acting as a translator layer, MCP allows models to interact with APIs, databases, and other services in a standardized, extensible, and scalable way.


๐Ÿšจ The Problem

LLMs alone can't execute real-world tasks โ€” they only generate text. To build powerful AI assistants, we need to integrate them with tools like:

  • Email services
  • Search APIs
  • Databases
  • Custom scripts

But integrating multiple tools is hard. APIs vary widely, maintenance is a headache, and scalability is painful.


โœ… MCP as a Solution

MCP provides a standardized interface that abstracts away the complexities of tool integration. Similar to how REST standardized web services, MCP standardizes how LLMs talk to tools โ€” making integration cleaner, easier, and future-proof.


๐Ÿ”ฎ Why MCP?

MCP helps you build agents and complex workflows on top of LLMs. LLMs frequently need to integrate with data and tools, and MCP provides:

  1. A growing list of pre-built integrations that your LLM can directly plug into
  2. The flexibility to switch between LLM providers and vendors
  3. Best practices for securing your data within your infrastructure

๐Ÿงฉ Architecture & Components

ComponentDescription
MCP ClientThe LLM-facing component. Can reside in chat apps, dev tools, or assistants.
MCP ServerBuilt by service providers. Translates service functionality (e.g., database queries, API calls) into a format LLMs can understand.
MCP ProtocolThe two-way transport layer enabling secure, structured communication between client and server.
ServiceThe actual tool or external resource being accessed (e.g., Weather API, SQL DB).

๐Ÿ” How It Works (Flow Example)

README image
  1. User sends query via an MCP host (e.g., chat app).
  2. MCP Client identifies the need for an external tool.
  3. MCP Server advertises available tools.
  4. LLM decides which tool(s) to use and instructs the client.
  5. Client sends request to relevant MCP Server.
  6. Server connects to the external service and retrieves data.
  7. Response flows back to the LLM for final output generation.

โœจ Key Benefits

  • โœ… Simplified Tool Integration
  • ๐Ÿš€ Extended LLM Capabilities
  • ๐Ÿ› ๏ธ Scalable, Maintainable Architecture
  • ๐Ÿค Standardized Communication Layer
  • ๐Ÿ’ก Fosters Innovation for AI App Developers

๐Ÿ› ๏ธ Tech Stack Used

  • Python - Python forms the backbone of CodeBuddy, providing robust support for integration with various libraries and frameworks.
  • Langchain - LangChain is a framework designed to simplify the creation of applications using large language models.
  • Ollama - It provides a simple API for creating, running, and managing models, as well as a library of pre-built models that can be easily used in a variety of applications.
  • langchain-mcp-adapters - This library provides a lightweight wrapper that makes Anthropic Model Context Protocol (MCP) tools compatible with LangChain and LangGraph.

๐Ÿงฉ Files Overview

FileDescription
client.pyA basic MCP client interacting only with a single mathserver.
mathserver.pyAn MCP server that exposes simple math operations (e.g., addition, multiplication).
weatherserver.pyAn MCP server simulating weather data responses.
multiclient.pyA multi-client setup where the MCP client can connect to both the math and weather servers.

๐Ÿ”„ How It Works

  1. The client.py script simulates an AI assistant (or LLM) interacting with the Math MCP Server only.

  2. The multiclient.py script demonstrates a more advanced use-case where the MCP client discovers and uses tools from multiple servers (Math + Weather).

  3. mathserver.py and weatherserver.py expose capabilities that can be consumed by MCP clients.

๐Ÿš€ Running the Demo

  1. Start the Servers:

    python mathserver.py
    python weatherserver.py
    
    
  2. Run Single-Client Demo:

    python client.py
    
    
  3. Run Multi-Client Demo:

    python multiclient.py
    
    

๐Ÿš€ Get Involved

Contributions are welcome! If you have suggestions or would like to enhance this project, please fork the repository and submit a pull request.

Interested in contributing to MCP? Stay tuned for:

  • Contribution guidelines
  • Roadmap
  • Issue templates

Feel free to โญ๏ธ the repo and join the discussion!


License

This project is licensed under the MIT License. See the LICENSE file for more details.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.