Prisma PHP Agent Tools
Supercharge your AI coding assistant. The mcp-prisma-php CLI gives LLMs direct access to your project structure, allowing them to scaffold routes, install UI components, and manage database schemas contextually.
1. Installation & Initialization
You can install the CLI tool globally or run it on-demand using `npx` within your project root.
A Global Installation (Recommended)
npm install -g mcp-prisma-php
B Per Project (npx)
npx mcp-prisma-php <command>
Project Initialization
Once the tool is available, you must initialize your project. This command generates the necessary configuration files and local MCP entry points.
# Standard initialization
mcp-prisma-php init
# Or, if you need to overwrite existing config
mcp-prisma-php init --force
What `init` does:
- Detects your Prisma PHP project structure.
- Generates the local MCP server entry point.
- Creates/Updates `mcp-config.json` (if applicable).
2. Agent Configuration
After initialization, configure your AI client (Claude Desktop, Cursor, etc.) to use the server.
{
"mcpServers": {
"prisma-php": {
"command": "mcp-prisma-php",
"args": []
}
}
}
Using npx?
If you didn't install globally, set "command": "npx" and "args": ["-y", "mcp-prisma-php"] in the config above.
Capabilities
The server exposes specific tools to the AI that abstract away complex file operations.
Scaffolding
-
create-routeGenerates controller, view, and route definition in one step. -
add-phpxui-componentDownloads and installs UI components (e.g., Button, Card) into your project. -
add-ppicon-componentAdds specific Lucide icons to your library.
Data & Config
-
prisma-generateRuns the generation command to sync schema changes to the client. -
list-routesReturns a map of all URL paths to their controllers for context. -
get-configReads the project'sconfig.phpsettings.
Troubleshooting
Project Detection Failed
The tool detect-project runs on startup. It checks for composer.json and specific framework folders.
Force Re-initialization
If your configuration seems corrupted or you upgraded the package, run: