A Model Context Protocol (MCP) server providing comprehensive Laravel documentation and package recommendations for AI assistants. This is a complete Go implementation using the official github.com/mark3labs/mcp-go
library.
list_laravel_docs
- List available documentation filesread_laravel_doc_content
- Read complete documentation contentsearch_laravel_docs
- Search across documentation with match countssearch_laravel_docs_with_context
- Advanced search with surrounding contextget_doc_structure
- Extract table of contents from documentationbrowse_docs_by_category
- Discover docs by category (frontend, database, etc.)
get_laravel_package_recommendations
- Get package recommendations by use caseget_laravel_package_info
- Detailed information about specific packagesget_laravel_package_categories
- List packages within a categoryget_features_for_laravel_package
- Get common features and patterns
update_laravel_docs
- Update documentation from GitHublaravel_docs_info
- Get metadata about documentation versions
update_external_laravel_docs
- Update external service documentationlist_laravel_services
- List available Laravel services (Forge, Vapor, etc.)search_external_laravel_docs
- Search external service documentationget_laravel_service_info
- Get detailed service information
- Go 1.24 or later
- Git (for documentation updates)
# Clone the repository
git clone https://github.com/izzamoe/laravel-mcp-companion-go.git
cd laravel-mcp-companion-go
# Install dependencies
go mod download
# Build the server
go build -o bin/server ./cmd/server
# Run the server
./bin/server --docs-path ./docs --version 12.x
--docs-path
- Path to documentation directory (default:./docs
)--packages-path
- Path to packages catalog (default:./configs/packages.json
)--version
- Default Laravel version (default:12.x
)--log-level
- Logging level: debug, info, warn, error (default:info
)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"laravel-companion": {
"command": "/path/to/laravel-mcp-companion-go/bin/server",
"args": [
"--docs-path", "/path/to/laravel-mcp-companion-go/docs",
"--version", "12.x",
"--log-level", "info"
]
}
}
}
Tool: list_laravel_docs
Parameters:
version: "12.x"
Tool: read_laravel_doc_content
Parameters:
filename: "routing.md"
version: "12.x"
Tool: search_laravel_docs
Parameters:
query: "middleware"
version: "12.x"
Tool: search_laravel_docs_with_context
Parameters:
query: "middleware"
context_length: 200
Tool: get_laravel_package_recommendations
Parameters:
use_case: "implementing payment system"
Tool: get_laravel_package_info
Parameters:
package_name: "laravel/cashier"
Tool: browse_docs_by_category
Parameters:
category: "frontend"
version: "12.x"
laravel-mcp-companion-go/
βββ cmd/server/ # Main entry point
β βββ main.go
βββ internal/
β βββ docs/ # Documentation management
β β βββ manager.go # Core doc operations
β β βββ cache.go # Documentation caching
β βββ packages/ # Package catalog
β β βββ catalog.go # Package search & recommendations
β β βββ format.go # Output formatting
β βββ server/ # MCP server & tools
β β βββ server.go # Server initialization
β β βββ doc_tools.go # Documentation tools (6)
β β βββ package_tools.go # Package tools (4)
β β βββ external_tools.go # External tools (6)
β βββ updater/ # GitHub documentation updater
β βββ external/ # External resource handling
β βββ logging/ # Logging utilities
β βββ models/ # Data models
βββ docs/ # Documentation files
β βββ 12.x/ # Laravel 12.x docs
βββ configs/ # Configuration files
β βββ packages.json # Package catalog
βββ bin/ # Built binaries
βββ server
This implementation uses the official MCP Go library:
- Library:
github.com/mark3labs/mcp-go
v0.41.1 - Transport: stdio (Standard Input/Output)
- Protocol Version: 2024-11-05
All tools are registered with:
- β Proper parameter schemas (required/optional)
- β Type validation (string, number, boolean, array)
- β Default values for optional parameters
- β Comprehensive descriptions with "When to use" guidance
- β Error handling and response formatting
Features:
- File-based documentation storage
- In-memory caching with TTL
- Path safety validation (prevents directory traversal)
- Version management (12.x, 11.x, etc.)
- Search with context extraction
- Structure parsing (TOC generation)
- Category-based browsing
Features:
- JSON-based package index
- Use case matching with relevance scoring
- Category organization
- Popularity scoring
- Maintenance status tracking
- Alternative package suggestions
# Build the server
go build -o bin/server ./cmd/server
# Run test script
./test_tools.sh
# Or manually test with Claude Desktop
The server should log on startup:
Registered documentation tools (6 tools)
Registered package tools (4 tools)
Registered update and info tools (2 tools)
Registered external service tools (4 tools)
Server ready with 16 total tools, starting event loop...
All development documentation is organized in the _docs/
folder:
- TOOLS_VERIFICATION.md - Complete tool specifications and compliance checklist
- MCP_GO_IMPLEMENTATION_COMPLETE.md - Detailed implementation guide
- FINAL_VERIFICATION_REPORT.md - Final verification report
- IMPLEMENTATION_SUMMARY.md - Implementation summary
- TODO_PROGRESS_DASHBOARD.md - Development progress tracking
Laravel documentation files are stored in the docs/
folder, organized by version (e.g., docs/12.x/
, docs/11.x/
).
go build -o bin/server ./cmd/server
./bin/server --docs-path ./docs --version 12.x --log-level debug
Logs are output to stderr (stdout is reserved for MCP protocol):
- Debug: Detailed operation logs
- Info: General operation logs (default)
- Warn: Warning messages
- Error: Error messages
Contributions are welcome! Please ensure:
- All 16 tools remain functional
- Parameter schemas match the specification
- Response formats are Markdown-compatible
- Tests pass
- Code follows Go conventions
MIT License
- Laravel Framework team for excellent documentation
- Anthropic for the MCP protocol specification
- mark3labs for the mcp-go library
For issues and questions:
- Create an issue on GitHub
- Check the Laravel documentation in
docs/
- Review the implementation guide in
_docs/MCP_GO_IMPLEMENTATION_COMPLETE.md
- See development documentation in
_docs/
Status: β
All 16 tools implemented and tested
Version: 1.0.0
Go Version: 1.24.0
Binary Size: 9.7MB
π MCP Server for Laravel documentation and package recommendations
- π Complete Laravel Documentation - Versions 6.x through 12.x
- π Smart Package Recommendations - AI-powered suggestions based on your use case
- π External Services - Forge, Vapor, Nova, Envoyer documentation
- β‘ High Performance - Built with Go for speed and efficiency
- πΎ Intelligent Caching - Fast responses with automatic cache management
- π― 16 MCP Tools - Comprehensive API for Laravel development
- π Resource URIs - Direct access via
laravel://
andlaravel-external://
- Go 1.24 or higher
- Claude Desktop app or VSCode with MCP support
- macOS, Linux, or Windows
Download the latest release from GitHub Releases for your platform:
- Linux (AMD64/ARM64):
laravel-mcp-companion-go-linux-{arch}
- macOS (AMD64/ARM64):
laravel-mcp-companion-go-darwin-{arch}
- Windows (AMD64):
laravel-mcp-companion-go-windows-amd64.exe
Make the binary executable and move to your preferred location:
# For Linux/macOS
chmod +x laravel-mcp-companion-go-*
sudo mv laravel-mcp-companion-go-* /usr/local/bin/laravel-mcp-companion-go
# For Windows, just move the .exe file to your desired location
# Clone the repository
git clone https://github.com/izzamoe/laravel-mcp-companion-go.git
cd laravel-mcp-companion-go
# Build
go build -o laravel-mcp-companion-go cmd/server/main.go
# Move to your preferred location
mv laravel-mcp-companion-go /usr/local/bin/
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"laravel-companion": {
"command": "/usr/local/bin/laravel-mcp-companion-go",
"args": []
}
}
}
-
Download or build the binary (see Installation section above).
-
Create MCP configuration:
- Create a
.vscode
folder in your workspace root (if it doesn't exist) - Create a file named
mcp.json
inside.vscode/
- Add the following content to
mcp.json
:
{ "servers": { "laravel_docs": { "type": "stdio", "command": "/absolute/path/to/laravel-mcp-companion-go", "args": [] } }, "inputs": [] }
Note: Replace
/absolute/path/to/laravel-mcp-companion-go
with the actual absolute path to your binary (e.g.,/usr/local/bin/laravel-mcp-companion-go
). - Create a
-
Restart VSCode or reload the window to apply the MCP configuration.
-
Verify setup: The MCP server should now be available in VSCode's MCP-enabled extensions.
Simply ask Claude about Laravel! Examples:
- Documentation: "Show me Laravel 11.x routing documentation"
- Packages: "Recommend packages for implementing payment processing"
- Features: "What features does Laravel Sanctum provide?"
- Search: "Search for middleware in Laravel 11.x"
Current Status: 16/16 tools fully implemented (100% complete) β
All features are now production-ready:
- β
Tool 13:
update_external_laravel_docs
- Fully implemented with web scraping - β
Tool 15:
search_external_laravel_docs
- Fully implemented with search functionality - β
Tool 3 & 4:
include_external
parameters - Fully functional
- β Implemented external service documentation manager
- β Added web scraping for Forge, Vapor, Envoyer, and Nova
- β Implemented caching mechanism for external docs (24h validity)
- β Integrated external search with main documentation search
- β All TODO comments removed from codebase
For historical context about previously unimplemented features:
- π Implementation History: See
_docs/TODO_PROGRESS_DASHBOARD.md
- π Completed Tasks: See
_docs/TODO_IMPLEMENTATION_CHECKLIST.md
Status: All core and external service features are production-ready and fully functional! π
# All tests
go test ./...
# With coverage
go test -cover ./...
# Verbose output
go test -v ./...
LOG_LEVEL=debug ./laravel-mcp-companion-go
This project is licensed under the MIT License - see LICENSE file for details.
- Laravel Framework - The PHP framework
- MCP Protocol - Model Context Protocol
- mark3labs/mcp-go - Go MCP library
Made with β€οΈ for the Laravel community