Skip to main content

MCP server that exposes Readium's functionality for document analysis

Project description

Readium MCP

Readium MCP

Python Version Model Context Protocol License: MIT PyPI version

A Model Context Protocol (MCP) server that exposes the powerful documentation analysis functionality of Readium for LLMs like Claude and other MCP-compatible clients.

🔍 What is this?

Readium MCP acts as a bridge between LLMs and any documentation repository, allowing:

  • Analyzing local directories, public/private Git repositories, and URLs
  • Processing multiple file formats (code, Markdown, text)
  • Converting web pages to Markdown for analysis
  • Delivering structured results with summary, file tree, and content

Perfect for when you need an LLM to analyze large bodies of documentation, code repositories, or technical websites.

🚀 Installation

With pip (recommended)

pip install readium-mcp

From source code

# Clone the repository
git clone https://github.com/tu-usuario/readium-mcp.git
cd readium-mcp

# Install dependencies with Poetry
poetry install

🛠️ Usage

Direct execution

readium-mcp

With Poetry (from source code)

poetry run readium-mcp

🔌 Integration with MCP clients

VSCode

Add to your VSCode configuration (settings.json):

{
  "mcp": {
    "servers": {
      "readium": {
        "command": "readium-mcp"
      }
    }
  }
}

Or create a .vscode/mcp.json file in your project:

{
  "servers": {
    "readium": {
      "command": "readium-mcp"
    }
  }
}

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "readium": {
      "command": "readium-mcp"
    }
  }
}

MCP CLI

# Install
mcp install -n readium -- readium-mcp

# Inspect
mcp inspect readium

# Test in console
mcp call-tool readium analyze_docs --path https://github.com/modelcontextprotocol/servers.git

📝 Exposed tools

analyze_docs

Analyzes documentation from a local directory, Git repository, or URL using Readium.

Parameters

Parameter Type Description Default
path string Local path, GitHub URL, or documentation URL (required)
branch string Branch to use if it's a repository null
target_dir string Specific subdirectory to analyze null
use_markitdown boolean Use Markitdown for conversion false
url_mode string URL processing mode ('clean', 'full') "clean"
max_file_size integer Maximum file size in bytes 5242880 (5MB)
exclude_dirs array Directories to exclude []
exclude_ext array Extensions to exclude (e.g., ['.png']) []
include_ext array Extensions to include (e.g., ['.md']) []

Response

{
  "content": [
    {"type": "text", "text": "Summary:\n..."},
    {"type": "text", "text": "Tree:\n..."},
    {"type": "text", "text": "Content:\n..."}
  ],
  "isError": false
}

🧪 Testing

Unit tests

poetry run pytest

Direct Readium test

python test.py

🧩 Example usage with Python

import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async def test_readium_mcp():
    server_params = StdioServerParameters(
        command="readium-mcp"
    )

    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()

            # List tools
            tools = await session.list_tools()
            print(f"Available tools: {tools}")

            # Analyze a repository
            result = await session.call_tool(
                "analyze_docs",
                {"path": "https://github.com/modelcontextprotocol/servers.git"}
            )

            print(f"Analysis result: {result}")

# Run
asyncio.run(test_readium_mcp())

📋 Advantages

  • Fast: Efficient analysis even for large repositories
  • Flexible: Works with local directories, Git repositories, and URLs
  • Configurable: Customize extensions, sizes, and directories to analyze
  • Compatible: Works with any MCP client (Claude, VSCode, CLI)
  • Simple: No complex dependencies, stdio transport for maximum compatibility

🤝 Contributing

Contributions are welcome. Please feel free to:

  1. Fork the repository
  2. Create a branch for your feature (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👏 Acknowledgments


Developed with ❤️ by Pablo Toledo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

readium_mcp-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

readium_mcp-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file readium_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: readium_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.17 Linux/6.11.0-1013-azure

File hashes

Hashes for readium_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6bf737135860179fc2952167917581591e1d247f28d355fd47575b47eb34e26
MD5 074e6faba28f281cb994fac1ff01e9c9
BLAKE2b-256 5e0db7a520cfaca4be29d2cb4177d5d809ef712bda9b814c5f12e3b3a20bff71

See more details on using hashes here.

File details

Details for the file readium_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: readium_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.17 Linux/6.11.0-1013-azure

File hashes

Hashes for readium_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d87c8798418845020b28f48b3ac6df5c69ae02ce11469d1f7d50acd5cbd75940
MD5 405edd4a359e955f172543fcda119b89
BLAKE2b-256 5023ce1cad2e5755756ab918e8a2e12d1fe3ffe32c7c1e987c66c21ccd5a2ffd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page