laravel-mcp-support maintained by datomatic
Laravel MCP Support
Shared building blocks for Datomatic's Laravel MCP servers
(laravel-database-mcp,
laravel-log-mcp). You normally don't require it
directly: it is installed as a dependency.
McpEndpoint— registers an MCP server over HTTP behind middleware and acan:gate, and defines the gate with a local-only fallback when the application didn't.AuditLog— logs every tool call (user, arguments, outcome, duration) when{config-key}.audit_log.enabledis true.- OAuth client deduplication — MCP clients re-register a Passport client on every login; the existing client with the same name is reused instead.
- MCP token lifetimes — override Passport access/refresh token lifetimes only for tokens
carrying the
mcp:usescope.
Because these OAuth bindings are app-wide, they live here once instead of in every server package.
Configuration
php artisan vendor:publish --tag=mcp-support-config
| Key | Env | Default |
|---|---|---|
dedupe_oauth_clients |
MCP_DEDUPE_OAUTH_CLIENTS |
true |
oauth_token_ttl (minutes) |
MCP_OAUTH_TOKEN_TTL |
null (Passport default) |
oauth_refresh_token_ttl (minutes) |
MCP_OAUTH_REFRESH_TOKEN_TTL |
null (Passport default) |
The OAuth features require laravel/passport and are ignored without it.
License
MIT.