Content
# Tool List
## 📋 Project Overview
This tutorial is a hands-on learning material for developers who are new to the **Model Context Protocol (MCP)**. We will learn how to build a powerful AI agent that utilizes various external tools and services by integrating LangGraph and MCP.
### 🎯 Learning Objectives
- Understand the core concepts and architecture of MCP
- Develop an MCP server using FastMCP
- Effectively integrate LangGraph and MCP
- Manage and orchestrate multiple MCP servers
- Implement a practical RAG system
## 🚀 Key Features
- **Standardized Protocol**: Implement tool interfaces following the MCP standard
- **Various Transmission Methods**: Support for stdio and Streamable HTTP
- **Dynamic Tool Discovery**: Automatic tool discovery and loading at runtime
- **Scalable Architecture**: Support for connecting multiple MCP servers simultaneously
- **Hands-on Learning**: Interactive learning through Jupyter Notebook
## 📁 Project Structure
```
mcp-tutorial/
├── 01-LangGraph-MCP-Tutorial.ipynb # Main tutorial notebook
├── server/ # MCP server implementation
│ ├── mcp_server_local.py # Local weather service (stdio)
│ ├── mcp_server_remote.py # Remote time service (HTTP)
│ ├── mcp_server_rag.py # RAG service (vector search)
│ └── rag/ # RAG-related utilities
│ ├── base.py
│ ├── pdf.py
│ └── utils.py
├── assets/ # Images and resources
├── pyproject.toml # Project settings
└── .env.example # Environment variable example
```
## 🛠 Installation
### Prerequisites
- Python 3.11 or higher
- UV package manager ([installation guide](https://docs.astral.sh/uv/))
### Installation Steps
1. **Clone the Repository**
```bash
git clone https://github.com/teddynote-lab/mcp-tutorial.git
cd mcp-tutorial
```
2. **Set Environment Variables**
```bash
cp .env.example .env
# Open .env file and input necessary API keys
```
3. **Install Dependencies**
```bash
# Create a virtual environment and install packages using UV
uv sync
# Activate the virtual environment
source .venv/bin/activate # macOS/Linux
# or
.venv\Scripts\activate # Windows
```
## 🎓 Learning Path
### Part 1: MCP Basics
- Understand the MCP protocol
- Learn the basic architecture
### Part 2: Create a Basic MCP Server
- Implement a server using FastMCP
- Understand the stdio transmission method
### Part 3: Configure MultiServerMCPClient
- Manage multiple servers
- Dynamically load tools
### Part 4: Integrate React Agent and MCP
- Configure LangGraph React Agent
- Bind MCP tools
### Part 5: Integrate ToolNode and MCP
- Build custom workflows
- Implement fine-grained control
### Part 6: Utilize External MCP Servers
- Integrate with Smithery AI platform
- Integrate third-party tools
### Part 7: Integrate with Dify MCP Server
- Utilize the Dify platform
- Practical integration example
## 💻 Execution
### Run MCP Server
```bash
# Local weather server (stdio)
uv run python server/mcp_server_local.py
# Remote time server (HTTP, port 8002)
uv run python server/mcp_server_remote.py
# RAG server (document search)
uv run python server/mcp_server_rag.py
```
### Test with MCP Inspector
```bash
# Test MCP server in browser
npx @modelcontextprotocol/inspector
```
### Run Tutorial
```bash
# Run Jupyter Notebook
jupyter notebook 01-LangGraph-MCP-Tutorial.ipynb
```
## 🔧 Environment Settings
The following environment variables are required in the `.env` file:
```env
# Required
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_key
# Optional (additional features)
LANGCHAIN_API_KEY=your_langchain_api_key
CONTEXT7_API_KEY=your_context7_api_key
```
## 📚 Key Dependencies
- **LangGraph**: Build AI agent workflows
- **FastMCP**: MCP server development framework
- **langchain-mcp-adapters**: LangChain-MCP integration
- **FAISS**: Vector storage (for RAG)
- **PyMuPDF**: PDF document processing
## 🤝 Contribution
This project is created for educational purposes. If you find any improvements or bugs, please register an issue.
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## 📖 References
- [MCP Official Documentation](https://modelcontextprotocol.io/)
- [LangGraph Documentation](https://langchain-ai.github.io/langgraph/)
- [FastMCP GitHub](https://github.com/jlowin/fastmcp)
- [Smithery AI](https://smithery.ai/)
## 🎥 Learning Resources
- [TeddyNote YouTube Channel](https://www.youtube.com/@teddynote)
- [RAG Advanced Online Lecture](https://teddylee777.github.io/)
## 📄 License
This project is for educational purposes only. See [LICENSE](LICENSE) file for details.
## ✨ Made by
**Made by [TeddyNote LAB](https://github.com/teddynote-lab)**
---
<p align="center">
<i>Build the next-generation AI agent with MCP and LangGraph! 🚀</i>
</p>
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.