MCP Docs Assistant
An MCP server that retrieves documentation from official sources (LangChain, LlamaIndex, OpenAI, uv) using Serper API, extracts page content, and provides context for LLM-based answers.
README
MCP Docs Assistant
A Python MCP project that exposes documentation retrieval as a tool and demonstrates how an agentic LLM client can use that tool to answer developer questions with fetched source context.
The main workflow runs an MCP server over stdio, searches supported official documentation sites through Serper, extracts readable page content, and passes the retrieved context to a Groq-hosted LLM for a grounded response. The repository also includes a small context-sharing MCP server example for storing and retrieving agent context in memory.
Key Features
- MCP stdio server with a
get_docstool for documentation lookup. - Search constrained to supported official docs: LangChain, LlamaIndex, OpenAI, and uv.
- Async HTTP fetching with
httpxand cleaned page extraction viatrafilatura. - Example MCP client that discovers tools, calls the server, and sends retrieved context to Groq.
- Simple agentic workflow pattern: discover a tool, retrieve external context, then generate a grounded answer.
- Separate context-sharing server example with tools for
share_context,retrieve_context, andlist_all_context.
Tech Stack
- Python
- MCP / FastMCP
- httpx
- python-dotenv
- Serper API
- Groq API
- trafilatura
Project Structure
.
|-- mcp_server.py # Main docs-retrieval MCP server
|-- client.py # Example MCP client and LLM response flow
|-- utils.py # HTML cleanup and Groq completion helper
|-- mcp-context-sharing/
| `-- src/server/main.py # In-memory context-sharing MCP server example
|-- requirements.txt # Python dependency snapshot
|-- .env.example # Required environment variables
`-- pyproject.toml # Placeholder project metadata
Setup
Create and activate a virtual environment:
python -m venv .venv
.venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
pip install fastmcp groq trafilatura
Create a local environment file:
copy .env.example .env
Then add API keys:
SERPER_API_KEY=your_serper_api_key
GROQ_API_KEY=your_groq_api_key
Run Locally
Run the example client, which starts mcp_server.py over stdio, lists available tools, calls get_docs, and asks Groq to answer from the returned context:
python client.py
Run the docs server directly:
python mcp_server.py
Run the context-sharing server example:
python mcp-context-sharing/src/server/main.py
Usage Flow
client.pystarts the MCP server with stdio transport.- The client initializes an MCP session and lists available tools.
- It calls
get_docswith a developer query and supported library name. mcp_server.pysearches the relevant official docs domain through Serper.- Matching pages are fetched, cleaned, labeled with source URLs, and returned.
- The client sends the retrieved context to Groq and prints the answer.
Supported library values:
langchain
llama-index
openai
uv
Testing and Build
No automated test suite or build pipeline is currently defined. For a smoke test, configure the environment variables and run:
python client.py
Deployment Notes
The current implementation is designed for local MCP stdio execution. It does not include a hosted API service, persistent storage layer, or production deployment configuration.
Future Scope
- Add tests around tool behavior, error handling, and response shaping.
- Move supported docs sources into configuration.
- Add caching or persistence for fetched documentation.
- Package the server with complete dependency metadata in
pyproject.toml.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.