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
⚠️ 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
Install from PyPI
pip install laravel-docs-mcp
Docker
# Pull and run the latest version
docker run -p 8000:8000 ghcr.io/brianirish/laravel-docs-mcp:latest
# Or run a specific version
docker run -p 8000:8000 ghcr.io/brianirish/laravel-docs-mcp:v0.1.4
Manual Installation from Source
Prerequisites
- Python 3.12+
uvpackage manager (recommended)
Steps
-
Clone the repository:
git clone https://github.com/brianirish/laravel-docs-mcp.git cd laravel-docs-mcp
-
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 filessearch_docs(query: str)- Search documentation for specific termsupdate_docs(version: Optional[str], force: bool)- Update documentationdocs_info()- Get documentation version information
Package Recommendation Tools
get_package_recommendations(use_case: str)- Get package recommendations for a use caseget_package_info(package_name: str)- Get details about a specific packageget_package_categories(category: str)- List packages in a specific categoryget_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.mdlaravel://authentication.md
Automated Workflows
This project includes several automated GitHub Actions workflows:
Daily Documentation Updates
- Trigger: Every day at midnight UTC (can also be triggered manually)
- Process: Checks for Laravel documentation updates → Creates PR → Auto-merges → Creates patch version tag
- Result: Automatic patch releases when Laravel docs are updated
Release Publishing
- Trigger: When version tags are pushed (e.g.,
v0.1.4) - Process: Builds packages → Publishes to PyPI → Builds and pushes Docker images to GHCR
- Result: Synchronized releases across PyPI and Docker Hub
Dynamic Versioning
- Version Source: Automatically derived from git tags using
hatch-vcs - Development Builds: Get unique identifiers (e.g.,
0.1.3.dev1+g75aec71) - Release Builds: Clean version numbers matching tags (e.g.,
0.1.4)
Features and Roadmap
Current Features:
- ✅ Daily Documentation Updates: Automatically syncs with Laravel's GitHub repository every day
- ✅ Dynamic Versioning: Automatic version management based on git tags
- ✅ Automated Releases: Patch releases triggered by documentation updates
- ✅ Multiple Deployment Options: PyPI package, Docker images, and Smithery marketplace
- ✅ Package Recommendations: Intelligent suggestions based on specific use cases
- ✅ Implementation Guidance: Detailed information for common Laravel packages
- ✅ Flexible Configuration: Support for multiple Laravel versions and transport methods
- ✅ Graceful Shutdown: Proper cleanup and signal handling
Planned Features:
- 🔄 Multi-version support (access documentation for multiple Laravel versions simultaneously)
- 🔍 User project analysis for tailored recommendations
- 🚀 Enhanced search capabilities with semantic matching
- 📊 Usage analytics and insights
- 🔗 Additional Laravel ecosystem integrations
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file laravel_docs_mcp-0.1.6.tar.gz.
File metadata
- Download URL: laravel_docs_mcp-0.1.6.tar.gz
- Upload date:
- Size: 729.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
953fb1c1dea29fbbaace481ba2b2ac055cd6dc615e5eef85652302c179fb908b
|
|
| MD5 |
e2a297c1d889041319577716c441cc95
|
|
| BLAKE2b-256 |
aca1a52d13b06f2baec43dc4eb53b3971351f0f9cd872e798078feb237c23abd
|
Provenance
The following attestation bundles were made for laravel_docs_mcp-0.1.6.tar.gz:
Publisher:
release.yaml on brianirish/laravel-docs-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laravel_docs_mcp-0.1.6.tar.gz -
Subject digest:
953fb1c1dea29fbbaace481ba2b2ac055cd6dc615e5eef85652302c179fb908b - Sigstore transparency entry: 221402989
- Sigstore integration time:
-
Permalink:
brianirish/laravel-docs-mcp@d219384d3035a62a58cc8b9ab34b12e311d46ddd -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/brianirish
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@d219384d3035a62a58cc8b9ab34b12e311d46ddd -
Trigger Event:
release
-
Statement type:
File details
Details for the file laravel_docs_mcp-0.1.6-py3-none-any.whl.
File metadata
- Download URL: laravel_docs_mcp-0.1.6-py3-none-any.whl
- Upload date:
- Size: 814.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6fe59421965686f83ab2a2535941a51ec3a51f5631df5d3e15e2870ba1ec24a
|
|
| MD5 |
5dcc4b3b1e63f966456c6d3e1fd7e9f9
|
|
| BLAKE2b-256 |
137567387eca9fe4c0398dd6d093831ff4553450ae9fd16f1bc0b7a1789e2067
|
Provenance
The following attestation bundles were made for laravel_docs_mcp-0.1.6-py3-none-any.whl:
Publisher:
release.yaml on brianirish/laravel-docs-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laravel_docs_mcp-0.1.6-py3-none-any.whl -
Subject digest:
e6fe59421965686f83ab2a2535941a51ec3a51f5631df5d3e15e2870ba1ec24a - Sigstore transparency entry: 221402993
- Sigstore integration time:
-
Permalink:
brianirish/laravel-docs-mcp@d219384d3035a62a58cc8b9ab34b12e311d46ddd -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/brianirish
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@d219384d3035a62a58cc8b9ab34b12e311d46ddd -
Trigger Event:
release
-
Statement type: