MCP with Langchain Sample Setup
@TaQuangTu
关于 MCP with Langchain Sample Setup
Sample MCP Server & Client setup, compatible with LangChain
基本信息
配置
工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is MCP with Langchain Sample Setup?
MCP with Langchain Sample Setup is a demonstration project that implements the Model Context Protocol (MCP) with Langchain. It includes three sample MCP servers (math, weather, and which_llm_to_use), each exposing one or two functions, and a Streamlit-based MCP client that bridges users with those servers. It is intended for developers exploring MCP and Langchain integration.
How to use MCP with Langchain Sample Setup?
Start each of the three MCP servers in the mcp_servers folder on ports 8000, 8001, and 8002 (e.g., nohup python math_mcp_server.py > math.log 2>&1 &). Then export your OpenAI API key and launch the Streamlit client with streamlit run my_chat_bot_app.py. The web UI will be available on port 8501.
Key features of MCP with Langchain Sample Setup
- Three sample MCP servers: math, weather, and which_llm_to_use
- Each server provides one or two functions
- Streamlit-based web UI as the MCP client
- Bridges user requests to multiple MCP servers
- Demonstrates MCP integration with Langchain and OpenAI
Use cases of MCP with Langchain Sample Setup
- Learning how to set up and run multiple MCP servers concurrently
- Testing interactions between a chat interface and math, weather, or LLM-selection tools
- Prototyping applications that combine several MCP services under a single client
FAQ from MCP with Langchain Sample Setup
What MCP servers are included?
Three sample servers: math_mcp_server, weather_mcp_server, and which_llm_to_use_mcp_server, each with one or two functions.
What ports do the MCP servers use?
They listen on ports 8000, 8001, and 8002 respectively.
How do I start the client?
Set the OPENAI_API_KEY environment variable and run streamlit run my_chat_bot_app.py. The client starts a web UI on port 8501.
Do I need an API key?
Yes, an OpenAI API key is required and must be set as the OPENAI_API_KEY environment variable.
What runtime dependencies are required?
Python is needed to run the servers and client. The project uses Streamlit and the OpenAI library, though exact dependency details are not listed in the README.
AI 与智能体 分类下的更多 MCP 服务器
Just Prompt - A lightweight MCP server for LLM providers
dislerjust-prompt is an MCP server that provides a unified interface to top LLM providers (OpenAI, Anthropic, Google Gemini, Groq, DeepSeek, and Ollama)
mcp-hfspace MCP Server 🤗
evalstateMCP Server to Use HuggingFace spaces, easy configuration and Claude Desktop mode.
Perplexity Ask MCP Server
ppl-aiThe official MCP server implementation for the Perplexity API Platform
Hass-MCP
voskaControl and query Home Assistant from Claude and other LLMs — a Model Context Protocol (MCP) server.
Shell and Coding agent for Claude and other mcp clients
rusiaamanShell and coding agent on mcp clients
评论