MCP demo with math and weather servers and LangChain/Ollama clients

MCP demo with math and weather servers and LangChain/Ollama clients

model-context-protocol-mcp-demo-with-langchain-mcp-adapters-ollama•byginga1402

A demonstration project providing two MCP servers, one for simple math operations and one simulating weather data, with clients that connect to them using LangChain, langchain-mcp-adapters and Ollama.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides an MCP server exposing simple math operations such as addition and multiplication.
  • •Provides an MCP server that simulates weather data responses.
  • •Includes a basic MCP client that interacts only with the math server.
  • •Includes a multi-client that discovers and uses tools from both the math and weather servers.

BEST FOR

  • •Demonstrating how an MCP client connects to a single MCP server.
  • •Exploring a multi-server setup where a client discovers and uses tools from several MCP servers.

ABOUT MODEL-CONTEXT-PROTOCOL-MCP-DEMO-WITH-LANGCHAIN-MCP-ADAPTERS-OLLAMA

MCP demo with math and weather servers and LangChain/Ollama clients is cataloged as an MCP server attributed to ginga1402. A demonstration project providing two MCP servers, one for simple math operations and one simulating weather data, with clients that connect to them using LangChain, langchain-mcp-adapters and Ollama. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP demo with math and weather servers and LangChain/Ollama clients are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What is the difference between the single-client and multi-client demos?

The single-client demo interacts only with the math server, while the multi-client demo discovers and uses tools from both the math and weather servers.

Upstream README

View this exact version on GitHub

README.md · ffb5c5cb43fc · Fetched 2026-11-13 10:47:40 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

🧠 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)

  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.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP demo with math and weather servers and LangChain/Ollama clients from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/model-context-protocol-mcp-demo-with-langchain-mcp-adapters-ollama)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools