MCP ExplorerExplorer

Langchain Mcp Adapters Example

@Asya02on 10 months ago
3 MIT
FreeCommunity
AI Systems
Example MCP server for GigaChat with math functions and clients.

Overview

What is Langchain Mcp Adapters Example

langchain-mcp-adapters-example is a simple example of an MCP server designed for GigaChat, showcasing basic mathematical operations.

Use cases

Use cases include executing mathematical operations, developing and testing MCP clients, and integrating with GigaChat for enhanced functionalities.

How to use

To use langchain-mcp-adapters-example, set up GigaChat credentials in a .env file, install the required packages, and run the client using ‘uv run client.py’. For HTTP interactions, start the server in SSE mode with ‘uv run math_server.py sse’ and then run the HTTP client with ‘uv run client_http.py’.

Key features

Key features include a local MCP server with two mathematical functions, a local interaction client, and an HTTP interaction client that operates in SSE mode.

Where to use

langchain-mcp-adapters-example can be used in educational environments for teaching basic programming concepts, in development for testing MCP interactions, and in applications requiring simple mathematical computations.

Content

langchain-mcp-adapters-example

Simple MCP example for GigaChat

Components

1.	math_server.py – MCP server with two mathematical functions.
2.	client.py – MCP client for local interactions (automatically starts the MCP server).
3.	client_http.py – MCP client for HTTP interactions (requires the server to be started in SSE mode).

Stdio mode (local)

Configuration

  1. Setup GigaChat credentials in .env
  2. Install requirements

Run client and server (do not start server directly!)

uv run client.py

Example output:

uv run client.py 
[03/10/25 15:00:47] INFO     Processing request of type ListToolsRequest       server.py:534
[03/10/25 15:00:51] INFO     Processing request of type CallToolRequest        server.py:534
[03/10/25 15:00:52] INFO     Processing request of type CallToolRequest        server.py:534
Результат выражения (3 + 5) умноженное на 12 равен 96.

HTTP mode (SSE)

Start server

uv run math_server.py sse

Run client

uv run client_http.py

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers