FastMCP LangGraph Webinar Demo
A terminal-based MCP server that provides tools like web search, URL fetching, note management, and calculations, and connects them to a LangGraph ReAct agent for multi-step tasks.
README
<div align="center"> <h1>FastMCP + LangGraph Webinar Demo</h1> <p><b>A terminal-based MCP demo that connects a FastMCP server to a LangGraph ReAct agent.</b></p> </div>
<div align="center"> <img alt="Python" src="https://img.shields.io/badge/-Python-3776AB?style=for-the-badge&logo=python&logoColor=white" /> <img alt="FastMCP" src="https://img.shields.io/badge/-FastMCP-111111?style=for-the-badge&logo=fastapi&logoColor=white" /> <img alt="LangGraph" src="https://img.shields.io/badge/-LangGraph-0B1F33?style=for-the-badge&logo=langchain&logoColor=white" /> <img alt="OpenAI" src="https://img.shields.io/badge/-OpenAI-412991?style=for-the-badge&logo=openai&logoColor=white" /> <img alt="Tavily" src="https://img.shields.io/badge/-Tavily-1E88E5?style=for-the-badge&logo=google-chrome&logoColor=white" /> <img alt="httpx" src="https://img.shields.io/badge/-httpx-1C7ED6?style=for-the-badge&logo=python&logoColor=white" /> </div>
What this project does
This repo is a clean CLI demo for MCP tool use.
- Starts a FastMCP server with 6 tools
- Connects the server to a LangGraph ReAct agent
- Lets you test tools manually from the terminal
- Lets the agent choose tools for multi-step tasks
Included files
demo_mcp_server.py- MCP server with all toolsdemo_agent.py- interactive CLI runnerrequirements.txt- Python dependencies.env.example- local env template
Skills used
- Python
- FastMCP
- LangGraph
- MCP
- OpenAI API
- Tavily search API
- HTTP requests
- Agentic workflows
- Tool calling and tool selection
- Prompt engineering for ReAct-style agents
- Multi-step reasoning with external tools
- MCP server and client orchestration
- Web search and page fetching for grounding
- Safe task-specific automation from the terminal
Features
web_search- Tavily-backed searchfetch_url- fetches a URL and strips HTMLsave_note- writes text files undertmp/mcp_notes/read_note- reads saved notes backlist_notes- lists saved notes and sizescalculate- safe math evaluation for expressions likesqrt(144) + pi
Requirements
- Python 3.10+
OPENAI_API_KEYfor the agent sectionTAVILY_API_KEYforweb_search
Setup
pip install -r requirements.txt
Create a .env file in the project root with:
OPENAI_API_KEY=your_openai_key
OPENAI_MODEL=gpt-4o-mini
TAVILY_API_KEY=your_tavily_key
If you only want to test the tools and skip the agent, OPENAI_API_KEY is not required.
Run
python demo_agent.py
Tools-only mode:
python demo_agent.py --tools-only
How the demo works
- The runner starts the MCP server over stdio.
- It discovers the available tools.
- You can call tools manually from the terminal.
- If
OPENAI_API_KEYis set, the LangGraph agent runs preset or custom prompts.
Environment variables
OPENAI_API_KEY- required for the agentOPENAI_MODEL- optional, defaults togpt-4o-miniTAVILY_API_KEY- enablesweb_search
Notes
web_searchfails cleanly ifTAVILY_API_KEYis missing.- Saved notes live in
tmp/mcp_notes/next to the scripts. save_notesanitizes filenames before writing.
Troubleshooting
- If imports fail, run
pip install -r requirements.txtagain. - If the server file is missing, keep
demo_agent.pyanddemo_mcp_server.pyin the same folder. - If the agent section is skipped, set
OPENAI_API_KEYin.env.
License
No license file is included in this repo.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。