mcp-client-server-demo

neuralware/mcp-client-server-demo

3.2

If you are the rightful owner of mcp-client-server-demo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This project demonstrates the integration of a simple MCP server with LangGraph, showcasing calculator tools via the MCP protocol.

Tools
1
Resources
0
Prompts
0

MCP Server with LangGraph Integration

This project demonstrates how to create a simple MCP server exposing calculator tools and connect it to a LangGraph agent using the MCP protocol.

Project Structure

  • mcp_server/: Contains the MCP server implementation.
  • langgraph_client/: Contains the LangGraph client code that connects to the MCP server.
  • pyproject.toml: Python dependencies.

Setup

  1. Clone the repository
git clone https://github.com/neuralware/mcp-client-server-demo.git
  1. Create environment and install dependencies
uv sync
  1. Activate the environment
source .venv/bin/activate

Running the MCP Server

You can run the MCP server over HTTP as follows -

python mcp_server/server.py

This runs the MCP server locally using http transport.

Running the LangGraph Client

In a separate terminal (with the virtual environment activated), run:

python langgraph_client/client.py

This will start the LangGraph agent, connect to the MCP server, and send a sample query to calculate (3 + 5) * 12.

Notes

  • The current example uses streamable-http transport, other options available are stdio and sse.
  • Extend the MCP server with more tools and resources as needed.
  • Use secure authentication and TLS when exposing MCP servers over networks.

Feel free to explore and expand this toy project for your AI tool integrations!