Skip to main content

Model Context Protocol (MCP) server for accessing and searching Laravel 12 documentation. Enables AI assistants and tools to query Laravel docs through a standardized interface.

Project description

Laravel Docs MCP Server

GitHub release (latest by date) PyPI Python Version GitHub Workflow Status License Docker Image smithery badge GitHub Stars GitHub Forks

⚠️ Alpha Software - This project is in early development. Features may not work as expected and breaking changes may occur without notice.

An AI assistant for Laravel developers that provides access to the latest Laravel documentation and intelligent package recommendations through the Model Context Protocol (MCP). This enables AI tools to help you build Laravel applications with up-to-date information and best practices.

Overview

This server enables AI assistants to access Laravel documentation and package recommendations using the Model Context Protocol (MCP). It allows AI tools to:

  • Access and search Laravel documentation
  • Receive package recommendations based on specific use cases
  • Get implementation guidance for popular Laravel packages
  • Automatically update documentation from Laravel's GitHub repository

Installation

Quick Install via Smithery

npx -y @smithery/cli install @brianirish/laravel-docs-mcp --client claude

Manual Installation

Prerequisites

  • Python 3.12+
  • uv package manager (recommended)

Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/laravel-docs-mcp.git
    cd laravel-docs-mcp
    
  2. Set up environment and install dependencies:

    # Create and activate virtual environment
    uv venv
    source .venv/bin/activate  # Linux/macOS
    # or
    .venv\Scripts\activate     # Windows
    
    # Install dependencies
    uv pip install .
    

Usage

Starting the Server

python laravel_docs_server.py

The server automatically fetches Laravel documentation on first run and can be stopped with Ctrl+C.

Command Line Options

Option Description
--docs-path PATH Documentation directory path (default: ./docs)
--server-name NAME Server name (default: LaravelDocs)
--log-level LEVEL Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)
--transport TYPE Transport method: stdio, websocket, sse (default: stdio)
--host HOST Host to bind to (network transport)
--port PORT Port to listen on (network transport)
--version VERSION Laravel version branch (default: 12.x)
--update-docs Update documentation before starting
--force-update Force documentation update

Example with custom options:

python laravel_docs_server.py --docs-path /path/to/docs --version 11.x --update-docs --transport websocket --host localhost --port 8000

Documentation Updater

You can update the documentation separately:

# Update documentation
python docs_updater.py --target-dir ./docs --version 12.x

# Check if update is needed
python docs_updater.py --check-only

# Force update
python docs_updater.py --force

API Reference

Client Example

import asyncio
from fastmcp import Client

async def main():
    client = Client("path/to/laravel_docs_server.py")
    
    async with client:
        # List documentation
        result = await client.call_tool("list_docs", {})
        print(result)
        
        # Search documentation
        result = await client.call_tool("search_docs", {"query": "routing"})
        print(result)
        
        # Get package recommendations
        result = await client.call_tool("get_package_recommendations", 
                                       {"use_case": "implementing subscription billing"})
        print(result)
        
        # Read documentation
        resource = await client.read_resource("laravel://routing.md")
        print(resource)

if __name__ == "__main__":
    asyncio.run(main())

Available Tools

Documentation Tools

  • list_docs() - List all documentation files
  • search_docs(query: str) - Search documentation for specific terms
  • update_docs(version: Optional[str], force: bool) - Update documentation
  • docs_info() - Get documentation version information

Package Recommendation Tools

  • get_package_recommendations(use_case: str) - Get package recommendations for a use case
  • get_package_info(package_name: str) - Get details about a specific package
  • get_package_categories(category: str) - List packages in a specific category
  • get_features_for_package(package: str) - Get available features for a package

Resource Access

Documentation files can be accessed as resources using:

laravel://{path}

Examples:

  • laravel://routing.md
  • laravel://authentication.md

Features and Roadmap

Current Features:

  • ✅ Dynamic documentation updates from Laravel's GitHub repository
  • ✅ Graceful shutdown handling
  • ✅ Version flexibility through command-line options
  • ✅ Package recommendations based on use cases
  • ✅ Implementation guidance for common Laravel packages
  • ✅ Docker deployment support

Planned Features:

  • Multi-version support (access documentation for multiple Laravel versions simultaneously)
  • User project analysis for tailored recommendations

License

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

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Acknowledgements

  • Laravel for their excellent documentation
  • Laravel package authors for their contributions to the ecosystem

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

laravel_docs_mcp-0.1.4.tar.gz (728.9 kB view details)

Uploaded Source

Built Distribution

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

laravel_docs_mcp-0.1.4-py3-none-any.whl (811.8 kB view details)

Uploaded Python 3

File details

Details for the file laravel_docs_mcp-0.1.4.tar.gz.

File metadata

  • Download URL: laravel_docs_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 728.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for laravel_docs_mcp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3b38b236c88cbb6b8cf48d51198f5d11d1581e437167048afac0530d4873f8fd
MD5 05b5dda86250dd05047425f0e4b502d9
BLAKE2b-256 a5f7b37fafef3ecdb349822452e09746f7325122bb8bac7762ba918a03815ed7

See more details on using hashes here.

Provenance

The following attestation bundles were made for laravel_docs_mcp-0.1.4.tar.gz:

Publisher: release.yaml on brianirish/laravel-docs-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file laravel_docs_mcp-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for laravel_docs_mcp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6498c558f7a3332b162da6fffce7b3e88a85d978f4181f19c79070d3b1bee91a
MD5 bb510bc4fd26209a682f9988f41aa40a
BLAKE2b-256 74f3e4fe550809d11c37be2281c655386a4c6d84425d3d3b30f427b4473be2e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for laravel_docs_mcp-0.1.4-py3-none-any.whl:

Publisher: release.yaml on brianirish/laravel-docs-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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