Skip to main content
Glama
Libraries.io MCP Server

Libraries.io MCP Server

Libraries.io MCP Server

License: MIT Python Version FastMCP

A comprehensive Model Context Protocol (MCP) server that provides AI assistants with seamless access to Libraries.io's vast database of 9.96M+ open source packages across 33+ package managers including NPM, PyPI, Maven, Go, NuGet, and more.

πŸš€ Overview

The Libraries.io MCP Server transforms how AI assistants interact with open source ecosystems by providing:

  • Package Discovery: Search, filter, and discover packages across multiple platforms

  • Deep Analysis: Comprehensive dependency analysis, security checks, and license compatibility

  • Ecosystem Insights: Platform statistics, trending packages, and alternative recommendations

  • Project Management: Dependency auditing, update tracking, and comprehensive reporting

  • Real-time Data: Access to current package information, versions, and dependencies

Related MCP server: package-intel-mcp

✨ Features

  • Search packages by keywords, languages, licenses, and platforms

  • Discover trending and popular packages

  • Filter results by specific criteria

  • Compare multiple packages side-by-side

πŸ“Š Package Analysis

  • Detailed package information and metadata

  • Complete version history and release tracking

  • Dependency tree analysis with configurable depth

  • Security vulnerability assessments

  • License compatibility checking

🌍 Ecosystem Analysis

  • Platform-specific statistics and insights

  • Alternative package recommendations

  • Dependency impact analysis

  • Package ecosystem health scoring

πŸ› οΈ Project Management

  • Comprehensive dependency auditing

  • Update monitoring and tracking

  • Security-focused dependency reports

  • Project health scoring and recommendations

πŸ“‹ Installation

Prerequisites

  • Python 3.8 or higher

  • A Libraries.io API key (Get your API key here)

  • An MCP-compatible client (Claude Desktop, etc.)

Quick Installation

# Clone the repository
git clone https://github.com/librariesio/libraries-io-mcp-server.git
cd libraries-io-mcp-server

# Install dependencies
pip install -r requirements.txt

# Or using uv (recommended)
uv sync

Development Installation

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src/
isort src/

# Lint code
flake8 src/

βš™οΈ Configuration

Environment Setup

  1. Copy the example environment file:

cp .env.example .env
  1. Edit the .env file with your configuration:

# Required: Your Libraries.io API key
LIBRARIES_IO_API_KEY=your_api_key_here

# Optional: Base URL for the Libraries.io API (default: https://libraries.io/api)
LIBRARIES_IO_BASE_URL=https://libraries.io/api

# Optional: Rate limiting configuration
RATE_LIMIT_REQUESTS=60
RATE_LIMIT_WINDOW=60

# Optional: Logging level
LOG_LEVEL=INFO

API Key Setup

  1. Visit Libraries.io API

  2. Sign up for an account if you don't have one

  3. Generate an API key

  4. Add it to your environment variables or .env file

πŸš€ Usage

With Claude Desktop

  1. Configure Claude Desktop with the provided configuration files:

  2. Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "libraries-io": {
      "command": "uv",
      "args": [
        "run",
        "fastmcp",
        "run",
        "src/libraries_io_mcp/server.py"
      ],
      "env": {
        "LIBRARIES_IO_API_KEY": "your_api_key_here"
      }
    }
  }
}

With Docker

# Build and run with Docker Compose
docker-compose up --build

# Or run directly with Docker
docker run -d \
  --name libraries-io-mcp-server \
  -p 8000:8000 \
  -e LIBRARIES_IO_API_KEY=your_api_key_here \
  libraries-io-mcp-server

Direct Server Usage

# Start the server
python -m src.libraries_io_mcp.server

# Or using uv
uv run fastmcp run src/libraries_io_mcp/server.py

πŸ› οΈ Available Tools

Package Discovery

Package Analysis

Ecosystem Analysis

Project Management

πŸ“š Documentation

Core Documentation

Integration Guides

Additional Resources

πŸ”§ Development

Project Structure

libraries-io-mcp-server/
β”œβ”€β”€ src/
β”‚   └── libraries_io_mcp/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ server.py           # Main FastMCP server
β”‚       β”œβ”€β”€ client.py           # Libraries.io API client
β”‚       β”œβ”€β”€ models.py           # Pydantic data models
β”‚       β”œβ”€β”€ tools.py            # MCP tools implementation
β”‚       β”œβ”€β”€ resources.py        # MCP resources implementation
β”‚       β”œβ”€β”€ prompts.py          # MCP prompts implementation
β”‚       └── utils.py            # Utility functions
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ unit/                   # Unit tests
β”‚   β”œβ”€β”€ integration/            # Integration tests
β”‚   └── fixtures/               # Test fixtures
β”œβ”€β”€ docs/                       # Documentation
β”œβ”€β”€ examples/                   # Usage examples
β”œβ”€β”€ .env.example               # Environment template
β”œβ”€β”€ pyproject.toml             # Project configuration
└── requirements.txt           # Dependencies

Setting Up Development Environment

# Clone the repository
git clone https://github.com/librariesio/libraries-io-mcp-server.git
cd libraries-io-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

# Set up environment variables
cp .env.example .env
# Edit .env with your API key

# Run tests
pytest

# Run with coverage
pytest --cov=src/libraries_io_mcp

# Format code
black src/
isort src/

# Lint code
flake8 src/
mypy src/

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=src/libraries_io_mcp --cov-report=html

# Run specific test categories
pytest tests/unit/
pytest tests/integration/

# Run tests in parallel
pytest -n auto

πŸ—οΈ Architecture

The Libraries.io MCP Server is built with a modular architecture:

  • FastMCP Server: Core MCP protocol implementation

  • Libraries.io Client: HTTP client with caching and rate limiting

  • Tools: MCP tools for package discovery and analysis

  • Resources: MCP resources for contextual data access

  • Prompts: AI interaction templates and workflows

  • Models: Pydantic data models for validation and serialization

πŸ“Š Performance & Scaling

Built-in Optimizations

  • Intelligent Caching: Reduces API calls and improves response times

  • Rate Limiting: Respects Libraries.io API limits and prevents abuse

  • Async Operations: Concurrent request processing for better performance

  • Request Deduplication: Eliminates duplicate API calls

Scaling Strategies

  • Horizontal Scaling: Multiple server instances behind a load balancer

  • Caching Layer: Redis integration for distributed caching

  • Load Balancing: Nginx or cloud load balancers

  • Container Orchestration: Kubernetes for automated scaling

πŸ”’ Security

Security Features

  • API Key Management: Secure storage and rotation

  • Input Validation: Comprehensive parameter validation

  • Rate Limiting: Prevents abuse and ensures fair usage

  • Error Handling: Graceful degradation and secure error messages

Security Best Practices

  • Never commit API keys to version control

  • Use environment variables for sensitive information

  • Implement proper access controls

  • Regular security audits and updates

See Security Guidelines for detailed security information.

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for:

  • Development setup and workflow

  • Code style and quality standards

  • Testing procedures

  • Pull request process

  • Issue reporting

Quick Contribution Steps

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/amazing-feature

  3. Make your changes and add tests

  4. Run the test suite: pytest

  5. Format your code: black src/ && isort src/

  6. Commit your changes: git commit -m 'Add amazing feature'

  7. Push to the branch: git push origin feature/amazing-feature

  8. Open a Pull Request

πŸ“ˆ Monitoring & Observability

Logging

  • Structured logging with correlation IDs

  • Configurable log levels (DEBUG, INFO, WARNING, ERROR)

  • Request/response logging for debugging

Metrics

  • API usage statistics

  • Response time monitoring

  • Cache hit rates

  • Error rate tracking

Health Checks

  • API connectivity monitoring

  • Cache health checks

  • Memory usage tracking

  • Service availability monitoring

πŸ› Troubleshooting

Common Issues

  1. API Key Issues

    • Verify your API key is valid and has sufficient permissions

    • Check that the environment variable is set correctly

    • Ensure you haven't exceeded rate limits

  2. Connection Problems

    • Check network connectivity to Libraries.io API

    • Verify firewall settings

    • Check proxy configurations if applicable

  3. Performance Issues

    • Monitor API usage and rate limits

    • Check cache hit rates

    • Review server logs for errors

Getting Help

πŸ“„ License

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

πŸ™ Acknowledgments

  • Libraries.io for providing the comprehensive open source package database

  • FastMCP for the excellent MCP framework

  • Pydantic for data validation and serialization

  • httpx for async HTTP client functionality

πŸ“ž Support

For support and questions:


Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to search and retrieve detailed package information from multiple package registries (NPM, crates.io, NuGet, PyPI, Go).
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Provides software supply-chain intelligence for AI agents, enabling them to query package metadata, versions, downloads, dependencies, and health signals for npm, PyPI, and crates.io packages without API keys.
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables safety-ranked discovery of open-source components across npm, PyPI, crates.io, RubyGems, GitHub, and Hugging Face, with license, security, and health checks.
      1,348 npm
      MIT