Skip to main content

What is MCP?

The Model Context Protocol (MCP) is an open standard that allows AI assistants (such as Claude Desktop, Cursor, and Claude Code) to securely discover and invoke tools in external applications. Geni turns your Laravel application into a fully autonomous, AI-ready toolkit:
  • Zero-Effort Tool Discovery (tools/list): Every documented route becomes an AI tool with strictly typed parameter schemas derived directly from your Form Requests, Data DTOs, and migrations.
  • Autonomous Action Execution (tools/call): AI agents can execute real actions against your app. You can ask an agent: “Find user alex@example.com and update their role to admin”, and the agent will discover GET /api/users and dispatch PATCH /api/users/{id} on its own.
  • Isolated Authentication: Bearer tokens and API keys are injected at the HTTP layer and never exposed in the OpenAPI document or prompt context.

Live Stdio Server

Run php artisan geni:mcp:serve for local AI clients like Claude Desktop or Claude Code.

HTTP Remote Endpoint

Access GET / POST on /docs/api/mcp for cloud AI agents and webhooks.

Running the Live MCP Server

Geni includes a built-in stdio MCP server command:
This starts a JSON-RPC server listening on standard input and output, responding to MCP protocol messages:
  • tools/list: Returns all available endpoints formatted as tool definitions.
  • tools/call: Dispatches HTTP requests to your application and returns structured responses.

Connecting to Claude Desktop

Add Geni to your claude_desktop_config.json:
claude_desktop_config.json
Restart Claude Desktop, and your AI assistant can now search, inspect, and call your Laravel API endpoints directly!

Generating Static Manifests

You can also export an MCP tool manifest or client configuration to a file:

HTTP MCP Endpoint

Geni also serves an HTTP MCP discovery endpoint at /docs/api/mcp:
  • GET /docs/api/mcp: Returns tool definitions as JSON.
  • POST /docs/api/mcp: Executes tools calls via HTTP JSON-RPC.
This route inherits any authentication configured for your documentation portal.

Security & Authentication

Configure token injection in config/geni.php:
config/geni.php
Authentication credentials configured in execution.auth are injected into HTTP requests during tool execution and are never leaked in tool schemas or manifest exports.