mcpField
M
MCP with Langchain Sample Setup

MCP with Langchain Sample Setup

Local
github.com/TaQuangTuAI & Agents0Updated 81w ago

About MCP with Langchain Sample Setup

A LangChain-compatible MCP sample with three servers for math, weather, and model selection, plus a Streamlit chat interface. It is for exploring how a client can connect users to multiple MCP servers.

Key features

  1. 01Three sample MCP servers
  2. 02Math, weather, and model-selection functions
  3. 03Streamlit chat interface
  4. 04Servers listen on separate ports

Use cases

  1. 01Demonstrating a client connected to multiple MCP servers
  2. 02Testing sample functions through a chat interface

MCP support

The project includes three MCP servers, each exposing one or two functions, and a client that bridges users to them.

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

MCP with Langchain Sample Setup

Start MCP servers

There are 3 sample MCP servers created in folder mcp_servers, each has 1 or 2 functions. Start and listen for requests on 3 different ports: 8000, 8001, and 8002.

cd mcp_servers
nohup python math_mcp_server.py > math.log 2>&1 &
nohup python weather_mcp_server.py > weather.log 2>&1 &
nohup python which_llm_to_use_mcp_server.py > which_llm.log 2>&1 &

Start MCP client

MCP client works as an interface bridging users and MCP servers.

export OPENAI_API_KEY=sk-svcacct-Tn_rKHd............................your_key_please
streamlit run my_chat_bot_app.py

The streamlit command will start a web UI listening on port 8501. You can play with the bot from there.

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.