Skip to content

ipsiuhang/python-doc-assist-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Python Documentation & Compatibility MCP

A search-first Model Context Protocol (MCP) server for Python library documentation and compatibility assistance.

Features

This MCP provides two main capabilities:

  1. Library Compatibility Checking: Discover dependency chains and compatibility between libraries, frameworks, and system components.

    • Find compatible CUDA versions for PyTorch
    • Check NVIDIA driver requirements for specific CUDA versions
    • Get recommended version combinations for stable setups
  2. Documentation Lookup: Retrieve documentation for specific functions or classes with version-specific information.

    • Get function signatures, parameters, and return values
    • Find usage examples
    • Support for multiple libraries simultaneously

How It Works

This MCP follows a "search-first" approach:

  1. When a request comes in, it constructs optimized search queries
  2. These queries are delegated to external search MCPs (like Brave Browser MCP)
  3. Results are processed to extract structured information
  4. Formatted data is returned to the LLM for presentation to the user

The architecture consists of:

  • SearchDelegate: Handles delegation to external search MCPs
  • QueryConstructor: Builds optimized search queries for different needs
  • ResultProcessor: Extracts structured information from search results
  • Main server that exposes MCP tools

Tools

get_library_compatibility

Discover library dependencies and check compatibility between components.

{
  "library": "pytorch",
  "version": "2.2.0",
  "with": ["cuda", "nvidia driver"]
}

get_function_documentation

Retrieve documentation for specific library functions or classes.

{
  "library": "pytorch",
  "version": "2.2.0",
  "function": "DataLoader",
  "multiple_libraries": [
    {
      "library": "numpy",
      "version": "1.24.0",
      "function": "array"
    }
  ]
}

Installation

  1. Clone this repository
  2. Add to your MCP settings configuration:
{
  "mcpServers": {
    "python-doc-assist": {
      "command": "node",
      "args": [
        "/path/to/python-doc-assist/index.js"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Development

This MCP is currently implemented as a simplified version without external dependencies. For a production implementation, it would need:

  1. Proper MCP SDK integration
  2. Integration with actual search MCPs
  3. Better result processing and extraction

License

MIT

About

A search-first MCP for Python library documentation and compatibility assistance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors