datomatic / laravel-mcp-support
Shared building blocks for Datomatic's Laravel MCP servers: gated routes, audit log, OAuth client deduplication and MCP token lifetimes.
v1.0.0
2026-11-30 14:58 UTC
Requires
- php: ^8.3
- illuminate/contracts: ^12.41.1|^13.0
- illuminate/support: ^12.41.1|^13.0
- laravel/mcp: ^1.0
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- larastan/larastan: ^3.0
- laravel/passport: ^13.0
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- rector/rector: ^2.0
Suggests
- laravel/passport: Required for OAuth client deduplication and MCP token lifetimes.
Provides
None
Conflicts
None
Replaces
None
README
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.