Kaipa MCP Server

Kaipa MCP Server

Enables Laravel API integration with Cursor, providing tools for routes, models, Artisan commands, configuration, and Redis cache management through Docker.

Category
Visit Server

README

MCP Laravel API - Kaipa

MCP (Model Context Protocol) service for Laravel API integration with Cursor.

Features

  • šŸš€ Retrieve all Laravel routes
  • šŸ—‚ļø List Eloquent models
  • āš™ļø Execute Artisan commands
  • šŸ“‹ Access Laravel configuration
  • šŸ”— Direct Docker container integration
  • šŸ’¾ Redis cache management & operations
  • šŸ”„ Full Redis CRUD operations

Setup

1. Install dependencies

npm install

2. Build TypeScript

npm run build

3. Configure Cursor

Add to your Cursor settings (.cursor/rules.mcp.json or settings):

{
  "mcpServers": {
    "laravel-api": {
      "command": "node",
      "args": ["/var/www/ai-tools/mcp-laravel-api-kaitori/dist/server.js"],
      "env": {
        "APP_NAME": "kaipa",
        "DB_HOST": "db",
        "DB_PORT": "3306",
        "APP_PORT": "8181",
        "REDIS_HOST": "redis",
        "REDIS_PORT": "6379"
      }
    }
  }
}

4. Start the service

Development mode:

npm run mcp-dev

Production mode:

npm start

Available Tools

Laravel Tools

get_routes

Get all Laravel API routes with optional filtering.

get_routes({ method: "GET", path: "api" })

artisan_command

Execute any Artisan command in the Laravel container.

artisan_command({ command: "migrate", args: ["--fresh"] })

get_models

List all Eloquent models in the application.

get_config

Access Laravel configuration settings.

Redis Tools

redis_get

Retrieve a value from Redis cache.

redis_get({ key: "user:123" })

redis_set

Store a value in Redis cache with optional TTL.

redis_set({ key: "user:123", value: "John Doe", ttl: 3600 })

redis_delete

Delete one or more keys from Redis.

redis_delete({ key: "user:123" })

redis_keys

Find keys matching a pattern.

redis_keys({ pattern: "cache:*" })

redis_exists

Check if a key exists in Redis.

redis_exists({ key: "user:123" })

redis_flush_db

Clear all data in the current Redis database (use with caution).

redis_flush_db({})

Environment Variables

Required

  • APP_NAME - Application name (default: kaipa)
  • DB_HOST - Database host (default: db)
  • DB_PORT - Database port (default: 3306)
  • APP_PORT - Application port (default: 8181)

Optional (Redis)

  • REDIS_HOST - Redis server host (default: redis)
  • REDIS_PORT - Redis server port (default: 6379)
  • REDIS_PASSWORD - Redis authentication password (optional)
  • REDIS_DB - Redis database number (default: 0)

Docker Integration

This MCP service communicates with your Laravel API and Redis running in Docker:

  • Laravel Container Pattern: {APP_NAME}_{APP_ENV}_php
    • Default: kaipa_local_php
  • Redis Container: redis service
    • Default connection: redis:6379

Make sure your Docker containers are running:

docker-compose up -d

Usage in Cursor

Once configured, you can:

  1. View API routes: @laravel://routes
  2. List models: @laravel://models
  3. Run migrations: Execute artisan_command with migrate
  4. Access configuration: @laravel://config
  5. Manage Redis cache: Use Redis tools for cache operations
  6. Monitor cache keys: Use redis_keys with patterns

Example Redis Operations

Cache user data:

redis_set({ key: "user:123:data", value: "{\"id\":123,\"name\":\"John\"}", ttl: 86400 })

Retrieve cached data:

redis_get({ key: "user:123:data" })

Find all session keys:

redis_keys({ pattern: "session:*" })

Clear cache on deploy:

redis_flush_db({})

Troubleshooting

  • Docker connection error: Ensure Docker daemon is running and containers are active
  • Redis not available: Check if Redis container is running. MCP continues to work without Redis
  • Command timeout: Verify Laravel container is responding
  • Route list empty: Verify Laravel application is properly initialized

Project Structure

/var/www/ai-tools/mcp-laravel-api-kaitori/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ server.ts              # MCP server with Laravel & Redis
│   ā”œā”€ā”€ services/
│   │   └── redis.service.ts   # Redis client wrapper
│   └── index.ts               # Exports
ā”œā”€ā”€ dist/                      # Compiled JavaScript
ā”œā”€ā”€ .cursor/
│   └── rules.mcp.json         # Cursor MCP config
ā”œā”€ā”€ docs/
│   └── laravel_setup/         # Laravel Docker config
ā”œā”€ā”€ package.json               # Dependencies
ā”œā”€ā”€ tsconfig.json              # TypeScript config
└── README.md                  # This file

Development

Build changes

npm run build

Test server startup

timeout 3 npm start || echo "Server working"

Install new packages

npm install <package-name>
npm run build

Contributing

When adding new features:

  1. Add tool definitions to ListToolsRequestSchema
  2. Implement tool logic in CallToolRequestSchema
  3. Run npm run build to verify TypeScript
  4. Test with npm start

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured