Dynamic LangGraph MCP Agent
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Dynamic LangGraph MCP AgentWhat's the weather in Tokyo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ Dynamic LangGraph MCP Agent
A production-ready agent system that automatically discovers and uses tools from MCP (Model Context Protocol) servers using LangGraph's ReAct architecture.
โจ Features
๐ค LangGraph ReAct Agent - Built-in reasoning and multi-step planning
๐ Automatic Tool Discovery - No hardcoding, just add MCP servers and go
๐ง LLM-Powered Routing - Gemini Flash intelligently selects the right tools
๐ Multi-Server Support - Connect to unlimited MCP servers
๐ Multi-Step Reasoning - Agent can chain multiple tools to solve complex tasks
โจ Zero Configuration - Add tools and they work instantly
Related MCP server: mcp-server
๐ Project Structure
mcp-agent/
โโโ agents.py # Main application (FastAPI + LangGraph)
โโโ mcp_server.py # MCP server with agricultural tools
โโโ config.json # MCP server configuration
โโโ .env # Environment variables (API keys)
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ ARCHITECTURE.md # System architecture documentation
โโโ DATAFLOW.md # Complete data flow explanation๐ Quick Start
1. Install Dependencies
pip install -r requirements.txt2. Set Up Environment Variables
Create a .env file:
GOOGLE_API_KEY=your_google_api_key_hereGet your API key from: https://aistudio.google.com/app/apikey
3. Configure MCP Servers
Edit config.json with your MCP server paths:
{
"mcpServers": {
"agricultural-server": {
"command": "python",
"args": ["mcp_server.py"],
"env": {
"PYTHONIOENCODING": "utf-8"
}
}
}
}Important: Use full paths on Windows:
{
"command": "D:\\Python\\python.exe",
"args": ["D:\\projects\\mcp-agent\\mcp_server.py"]
}4. Start the Server
python agents.py5. Test the Agent
Visit http://localhost:8000/docs
Or use cURL:
curl -X POST "http://localhost:8000/chat" \
-H "Content-Type: application/json" \
-d '{"message": "What is the weather in Tokyo?"}'๐ Available Tools
Tool | Description | Arguments |
| Real-time weather data | city (string) |
| Agricultural information | query (string) |
| Sample blog posts | limit (integer) |
๐งช Example Queries
# Weather query โ Uses get_current_weather
"What's the weather in Paris?"
# Agriculture query โ Uses get_pesticide_seed_info
"Tell me about organic farming techniques"
# Content query โ Uses get_placeholder_posts
"Show me 5 interesting articles"
# Multi-step reasoning โ Uses multiple tools
"What's the weather in Mumbai and what crops grow best there?"๐ง API Endpoints
POST /chat
Main endpoint for chatting with the agent
Request:
{
"message": "Your query here"
}Response:
{
"response": "Agent's answer",
"intermediate_steps": ["Tool used: get_current_weather"],
"error": null
}GET / - Server info
GET /tools - List all tools
GET /health - Health check
๐ Adding New Tools
Edit mcp_server.py:
@mcp_server.list_tools()
async def list_tools() -> list[Tool]:
return [
# ... existing tools ...
Tool(
name="my_new_tool",
description="What this tool does",
inputSchema={
"type": "object",
"properties": {
"param": {"type": "string"}
},
"required": ["param"]
}
)
]Restart the agent - tools are auto-discovered!
๐ Troubleshooting
"GOOGLE_API_KEY not found"
Create
.envfile with your API key
"No MCP servers found"
Check
config.jsonexists and has correct paths
"Agent not initialized"
Verify MCP server starts independently:
python mcp_server.py
๐ Resources
LangGraph: https://langchain-ai.github.io/langgraph/
MCP Protocol: https://modelcontextprotocol.io
Gemini API: https://ai.google.dev/
See ARCHITECTURE.md for system design. See DATAFLOW.md for data flow details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sudhiksha1502-glitch/MCP--Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server