Skip to main content
The Model Context Protocol (MCP) is an open standard that lets AI assistants — Claude Desktop, Cursor, Claude Code, and others — securely discover and call tools in external applications. Geni implements MCP natively: because it already has a complete, typed representation of every route in your Laravel application from its static analysis pass, it can expose that representation as a live MCP tool server with no extra configuration. Every documented endpoint becomes an AI tool with typed parameter schemas derived from your Form Requests and migrations, and the AI agent can execute real HTTP requests against your running application.

Running the Live MCP Server

Start Geni’s built-in stdio MCP server with a single Artisan command:
This launches a JSON-RPC server that reads from standard input and writes to standard output, making it compatible with any MCP host that supports the stdio transport. The server responds to two core protocol messages:
  • tools/list — Returns all available endpoints formatted as MCP tool definitions, including their parameter names, types, and descriptions.
  • tools/call — Dispatches an HTTP request to your application using the arguments supplied by the AI agent and returns the structured response.

Connecting to Claude Desktop

Add the following entry to your claude_desktop_config.json file, replacing /path/to/your/laravel/artisan with the absolute path to your application’s artisan file:
claude_desktop_config.json
Restart Claude Desktop after saving the file. Your AI assistant can now search, inspect, and call your Laravel API endpoints directly from the conversation interface.

Generating Static Manifests

If you need a portable snapshot of your MCP tool definitions — for example, to check into source control or hand off to a third-party integration — use geni:mcp to export a static manifest:
Static manifests reflect the state of your codebase at the time of export. Re-run the command after making route changes to keep the manifest current.

HTTP MCP Endpoint

In addition to the stdio server, Geni registers an HTTP MCP endpoint as part of the docs portal:
  • GET /docs/api/mcp — Returns tool definitions as a JSON document, suitable for polling by HTTP-based MCP clients.
  • POST /docs/api/mcp — Accepts a JSON-RPC tool call payload and executes it, returning the structured HTTP response from your application.
The /docs/api/mcp HTTP endpoint inherits whatever authentication you have configured for your documentation portal. If form or basic authentication is enabled, clients must supply valid credentials before the endpoint responds.
When using multi-version APIs, each version gets its own scoped MCP endpoint (e.g. /docs/api/v2/mcp) that only exposes tools for that version’s routes.

Security & Authentication

Configure how Geni injects credentials into outbound tool-execution requests in config/geni.php:
config/geni.php
Set GENI_MCP_BEARER_TOKEN or GENI_MCP_API_KEY in your .env file. Geni automatically appends the appropriate Authorization header to every HTTP request it dispatches on behalf of an AI agent.
Authentication credentials configured in execution.auth are injected at request time and are never included in tool schemas, static manifests, or tools/list responses. AI agents cannot read your tokens — they only receive the API response data.