The Model Context Protocol, or MCP, provides a standard way for AI assistants to connect to applications, discover available tools, and work with live data.
We created an early MCP prototype to explore how this technology could work inside a generated PHPRunner application.
Watch the PHPRunner MCP demonstration on YouTube
Download the PHPRunner MCP sample project
MCP tools in PHPRunner
The prototype can expose standard operations for enabled application tables, including:
– Listing and searching records
– Retrieving individual records
– Adding and updating records
– Deleting records
The available tools depend on the application configuration and permissions associated with the supplied API key.
An AI assistant can process requests such as “Show me the last five orders” or “Find all products in the Pastry category,” select the appropriate tool, and return the results in a readable format.
Authentication and permissions
This initial prototype uses API-key authentication. OAuth and a separate authorization server are not required.
The MCP layer works with the PHPRunner application layer responsible for permissions, validation, events, and data access. This is especially important for operations that change data. An API key can allow an assistant to view records without granting permission to add, update, or delete them.
Custom MCP actions
Applications often include workflows that require more than a single database operation. Custom MCP actions can represent these higher-level business processes.
Multiple actions can be defined in an mcp_actions.php file. Each action describes its parameters, required permissions, behavior, and PHP handler.
The sample application includes actions for:
– Producing an inventory summary
– Receiving inventory
– Discontinuing or reactivating products
– Marking orders as shipped
– Creating a customer and complete order
– Increasing prices within a category
For example, creating a customer and order requires coordinated changes to several tables. A custom action can complete the entire workflow from one request.
MCP opens some interesting possibilities for conversational queries, application automation, reporting, and multi-step business workflows. Let us know which PHPRunner workflows you would like to access through an AI assistant.
