An advanced implementation of the Model Context Protocol (MCP) for intelligent documentation exploration. Powered by LangChain, LangGraph, and Groq LLMs.
This project implements a state-of-the-art LangChain Documentation Agent using the high-level FastMCP framework. It bridges the gap between static documentation and interactive AI by allowing an autonomous agent to search, fetch, and summarize technical docs in real-time through the Model Context Protocol.
- FastMCP Server: A specialized MCP server (
server/scraper.py) that exposes tools for semantic search and content extraction from the LangChain documentation ecosystem. - LangGraph Orchestrator: An agentic loop implemented in
agent/agent.pythat utilizes LangGraph's native handling of JSON-schema tools to solve standardlangchain_classiccompatibility issues. - Groq Inference: Utilizes Llama 3.3 (70B) via Groq for ultra-fast, high-reasoning capabilities, enabling the agent to execute complex multi-step research tasks.
- Semantic Documentation Search: Deep-search capabilities across LangChain's official guides, tutorials, and API references.
- Autonomous Tool Selection: The agent intelligently decides when to list topics, search for specific keywords, or fetch full page content.
- Conflict Resolution: Implements the definitive fix for MCP tool-input schema mismatches by leveraging LangGraph's object-passing architecture.
- Background Orchestration: Automated background server startup with health polling ensures the agent only starts once the MCP bridge is ready.
fastmcp/
├── agent/ # LangGraph Agent logic & MCP Client bridge
├── server/ # FastMCP Server implementation & Scraper logic
├── run.py # Unified entry point for Server + Agent orchestration
├── requirements.txt # Project dependencies
└── .env # API keys and server configuration
Create a .env file with your Groq API Key:
GROQ_API_KEY=gsk_your_key_here
MCP_SERVER_HOST=localhost
MCP_SERVER_PORT=8000python -m venv env
source env/Scripts/activate # Windows
pip install -r requirements.txtpython run.pyThis command will:
- Start the FastMCP Server in a background daemon thread.
- Wait for the server to pass its Health Check.
- Initialize the LangGraph Agent.
- Begin an interactive session or execute pre-defined documentation queries.
"Leveraging the Model Context Protocol to build agents that truly understand their tools."