pujandan

Laravel AI - MCP Server

Community pujandan
Updated

MCP Laravel

Laravel AI - MCP Server

MCP (Model Context Protocol) server for providing Laravel AI documentation to Claude Code and other AI assistants.

๐Ÿš€ Quick Start

1. Install Dependencies

# Clone or navigate to the project directory
cd laravel-ai
npm install

2. Start MCP Server

npm start

Documentation is expected to be in: ./docs (relative to project root)

โš™๏ธ Claude Code Configuration

Add to your Claude Code settings (~/.config/claude-code/config.json):

{
  "mcpServers": {
    "laravel-ai": {
      "command": "node",
      "args": ["path/to/laravel-ai/index.js"]
    }
  }
}

Alternative: With Custom Docs Path

If your documentation is in a different location:

{
  "mcpServers": {
    "laravel-ai": {
      "command": "node",
      "args": ["path/to/laravel-ai/index.js"],
      "env": {
        "DOCS_PATH": "/path/to/your/docs"
      }
    }
  }
}

๐Ÿ› ๏ธ Available Tools

Tool Description
get_doc_structure Get all documentation files structure
read_doc Read a specific documentation file
search_docs Search across all documentation
get_quick_reference Get all coding rules (quick-reference.md)
get_templates Get CRUD templates (specific or all)
get_checklist Get validation checklist (specific layer or all)
get_domain_examples Get domain-specific examples
get_design_system Get design system documentation

๐Ÿ“ Documentation Structure

laravel-ai/
โ”œโ”€โ”€ docs/                          # Documentation folder
โ”‚   โ”œโ”€โ”€ ai/
โ”‚   โ”‚   โ”œโ”€โ”€ quick-reference.md    # All coding rules
โ”‚   โ”‚   โ”œโ”€โ”€ templates.md           # Implementation templates
โ”‚   โ”‚   โ””โ”€โ”€ checklist.md           # Validation checklist
โ”‚   โ”œโ”€โ”€ domains/
โ”‚   โ”‚   โ”œโ”€โ”€ ecommerce/             # E-commerce examples
โ”‚   โ”‚   โ”œโ”€โ”€ hr/                    # HR examples
โ”‚   โ”‚   โ””โ”€โ”€ tourism/               # Tourism examples
โ”‚   โ”œโ”€โ”€ patterns/                  # Pattern documentation
โ”‚   โ””โ”€โ”€ design-system.md          # Design system (configurable)
โ”œโ”€โ”€ index.js                       # MCP server
โ”œโ”€โ”€ package.json                   # Dependencies
โ””โ”€โ”€ README.md                      # This file

๐Ÿ’ก Usage Examples

For AI Assistant

When user says "pelajari docs", AI should:

// 1. Get quick reference
mcp.call_tool('get_quick_reference')

// 2. Get templates
mcp.call_tool('get_templates', { template_type: 'all' })

// 3. Get checklist
mcp.call_tool('get_checklist', { layer: 'all' })

// 4. Confirm ready

Search Documentation

// Search for "transaction"
mcp.call_tool('search_docs', { query: 'transaction' })

Get Domain Examples

// Get e-commerce examples
mcp.call_tool('get_domain_examples', { domain: 'ecommerce' })

// Get all domains overview
mcp.call_tool('get_domain_examples', { domain: 'all' })

๐Ÿ”ง Development

Watch Mode

npm run dev

Testing

Test the MCP server manually:

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node index.js

๐Ÿ“ Notes

  • This server uses stdio transport for communication
  • All documentation is read from the file system
  • No caching - always reads latest documentation
  • Supports incremental updates to documentation

๐Ÿ”„ Updates

When documentation is updated, just restart the MCP server:

# Stop current server (Ctrl+C)
npm start

Version: 1.0.0Last Updated: 2026-02-23

MCP Server ยท Populars

MCP Server ยท New