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.

NPM Package v1.0.0+

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)

terminal
npm install -g mcp-prisma-php

B Per Project (npx)

terminal
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.

terminal
# 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.

claude_desktop_config.json
{
  "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-route Generates controller, view, and route definition in one step.
  • add-phpxui-component Downloads and installs UI components (e.g., Button, Card) into your project.
  • add-ppicon-component Adds specific Lucide icons to your library.

Data & Config

  • prisma-generate Runs the generation command to sync schema changes to the client.
  • list-routes Returns a map of all URL paths to their controllers for context.
  • get-config Reads the project's config.php settings.

Troubleshooting

Project Detection Failed

The tool detect-project runs on startup. It checks for composer.json and specific framework folders.

Ensure your AI editor (Cursor/Claude) has the root folder of your project open, not a parent directory.

Force Re-initialization

If your configuration seems corrupted or you upgraded the package, run:

mcp-prisma-php init --force