Mcp-Server
0
This project implements a Model Context Protocol (MCP) server designed to provide large language models with real-time access to current documentation for Python libraries, solving outdated code suggestion issues. It dynamically fetches the latest library documentation using advanced tooling and integrates seamlessly with compatible clients.
MCP Server for Up-to-Date Library Documentation
Features
- MCP Standard: Implements Model Context Protocol for integration with clients like Claude Desktop and Claude Code.
get_docs
Tool: Searches official documentation sites using Serper API.- Libraries Supported: Langchain, LlamaIndex, OpenAI
- Content Fetching: Utilizes
httpx
andBeautifulSoup
to extract documentation text.
Architecture Overview
- MCP Host initiates coding assistance request.
- MCP Client connects to the running MCP Server.
- LLM uses
get_docs
tool for up-to-date information. - Constructs site-specific search query.
- Uses Serper API for documentation page links.
- Fetches and extracts text for accurate code suggestions.
Prerequisites
- Python 3.11+
uv
Package Manager- Serper API Key
- Node.js/npx (Optional for debugging)
Installation & Setup
- Clone repository and initialize project.
- Activate virtual environment.
- Install dependencies.
Configuration
- Create
.env
with Serper API key for configuration.
Usage
- Run MCP Server: Activate environment and use
uv run main.py
. - Integrate with MCP Clients like Claude Desktop and Claude Code.
Development & Debugging
- Use MCP Inspector with Node.js/npx for debugging server capabilities.
License
- Licensed under the MIT License.