desino / mcp-framework-boilerplate
Desino MCP boilerplate for Laravel: publish MCP server, tool manager UI, support tools, and audit logging into your application via Artisan.
Package info
github.com/desino/MCP-Framework-Boilerplate
pkg:composer/desino/mcp-framework-boilerplate
Requires
- php: ^8.3
- desino/boilerplate: *
- laravel/framework: ^13.0
- laravel/mcp: *
README
Laravel scaffolding package that publishes the Desino MCP reference application into your host app via a single Artisan command — similar to desino/boilerplate.
After installation, MCP code lives in your application (app/, routes/, resources/, etc.) and can be edited like first-party code.
What gets published
- MCP server at
/mcp(routes/ai.php) with bearer token authentication - Admin UI to manage MCP tools (
/mcp_tools) - Built-in library tools (GitHub, PM tool, project resolver)
- Custom MCP tool generator and stubs
- Models, migrations, services, views, and translations
Requirements
- PHP ^8.3
- Laravel ^13
- laravel/mcp
- desino/boilerplate
Installation
1. Require the package
composer require desino/mcp-framework-boilerplate
For local development from this repository:
{
"repositories": [
{
"type": "path",
"url": "../mcpFrameworkBoilerplate"
}
],
"require": {
"desino/mcp-framework-boilerplate": "@dev"
}
}
2. Publish Desino boilerplate (if not already done)
php artisan make:desino-boilerplate composer update
3. Publish MCP boilerplate
php artisan make:desino-mcp-framework-boilerplate
Use --force to overwrite files that already exist.
This copies MCP scaffolding into your application:
| Published to | Contents |
|---|---|
app/Http/Controllers/McpToolController.php |
Admin UI controller |
app/Http/Middleware/VerifyMcpToken.php |
MCP bearer token middleware |
app/Mcp/Servers/MyMcpServer.php |
Dynamic MCP server |
app/Mcp/Tools/ |
Library MCP tools |
app/Models/ |
McpTool, McpProject, McpAuditLog |
app/Contracts/CodingStandardRule.php |
Coding standard rule contract |
app/CodingStandardRules/ |
Coding standard rule definitions |
app/Services/ |
Tool registry, GitHub/PM services, generator, coding standard rules |
config/my_mcp.php |
MCP configuration |
routes/ai.php |
MCP HTTP endpoint registration |
resources/views/mcp_tools/ |
Admin Blade views |
database/migrations/ |
MCP database tables |
stubs/mcp/ |
Custom tool generation stubs |
The command also merges:
- MCP tool routes into
routes/web.php(inside thecheckIfAdminmiddleware group) - MCP translation keys into
lang/en/messages.php verifyMcpTokenmiddleware alias intobootstrap/app.php
4. Configure environment
MCP_API_TOKEN=your-secret-token MCP_GITHUB_API_URL=https://api.github.com MCP_GITHUB_TIMEOUT=20 MCP_MAX_SAFE_SELECT_LIMIT=100 MCP_PMTOOL_BASE_URL=https://pmtool.example.com MCP_PMTOOL_API_KEY=your-pm-tool-key MCP_PMTOOL_TIMEOUT=20 MCP_PMTOOL_VERIFY=true
5. Run migrations
php artisan migrate
Tables created:
mcp_projectsmcp_toolsmcp_audit_logs
MCP tool ordering:
- The
mcp_toolstable has anorderingcolumn. - The installer adds the ordering column (and backfills existing rows).
- New tools default to the last position (
ordering = max + 1).
6. Add navigation link (optional)
Add an MCP Tools menu item to your layout:
<a class="nav-link" href="{{ route('mcpTools.index') }}"> {{ __('messages.main_menu_mcp_tools_title') }} </a>
Usage
MCP endpoint
Active tools registered in the admin UI are exposed at:
MCP tool execution order:
When the MCP server handles a request, it returns active tools ordered by mcp_tools.ordering ascending (then by id to break ties).
POST /mcp
Authorization: Bearer {MCP_API_TOKEN}
Admin UI routes
| Route | Name |
|---|---|
/mcp_tools |
mcpTools.index |
/mcp_tools/create |
mcpTools.create |
/mcp_tools/{id}/edit |
mcpTools.edit |
Ordering in the tools list:
- The
/mcp_toolslist shows anOrdercolumn. - Use the move up / move down arrows to open a confirmation modal, then submit the reorder form with a loading screen.
- On successful update, the page reloads and the MCP server will follow the new order immediately.
Library tools
coding_standard— Review code against selected coding standard rulessupport.resolve_project— Resolve project details from a project codepmtool.search_tickets— Smart PM tool ticket searchgithub.search_code— GitHub code searchgithub.read_file— Read a file from GitHubgithub.recent_commits— List recent commitsdatabase.safe_select— Run safe read-only SQL SELECT queries
Coding standard rules
The coding_standard library tool builds its description from rules you select in the admin UI, so AI clients only ever see the instructions for the enabled rules.
Published rules in app/CodingStandardRules/:
DESINO_PSR_001— PSR-1, PSR-4 and PSR-12 coding styleLARAVEL_CONTROLLER_001— Controller structure and responsibilityLARAVEL_DATABASE_001— Migration structure and reversibilityLARAVEL_ELOQUENT_002— Model class and query standardsLARAVEL_ROUTE_001— Route definition and naming conventionsPHP_FUNCTIONS_001— PHP function usage standardsSECURITY_SQL_INJECTION_001— SQL injection prevention
To add a rule, drop a class into app/CodingStandardRules/ that implements App\Contracts\CodingStandardRule. The class name becomes the rule ID shown in the admin UI, and it is picked up automatically — no registration step.
Custom tools
Custom tools are generated into app/Mcp/Tools/ when created from the admin UI.
Configuration
Key options in config/my_mcp.php:
| Key | Description |
|---|---|
mcp_api_token |
Bearer token for MCP requests |
mcp_github_api_url |
GitHub API base URL |
mcp_github_timeout |
GitHub API timeout (seconds) |
mcp_max_safe_select_limit |
Maximum rows for safe select tool auto-limit |
mcp_pmtool_base_url |
PM tool API URL |
mcp_pmtool_api_key |
PM tool API key |
mcp_pmtool_timeout |
PM tool API timeout (seconds) |
mcp_pmtool_verify |
Verify PM tool TLS certificate |
Package vs application code
This package is a thin installer. It only ships:
MakeMcpBoilerplateCommand(php artisan make:desino-mcp-framework-boilerplate)- Application stubs under
src/stubs/
All runtime MCP logic runs from your host application's app/ directory after publishing.
License
MIT — see LICENSE.