Mcp-Server

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 and BeautifulSoup to extract documentation text.

Architecture Overview

  1. MCP Host initiates coding assistance request.
  2. MCP Client connects to the running MCP Server.
  3. LLM uses get_docs tool for up-to-date information.
  4. Constructs site-specific search query.
  5. Uses Serper API for documentation page links.
  6. 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

  1. Clone repository and initialize project.
  2. Activate virtual environment.
  3. 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.