Looking to hire Laravel developers? Try LaraJobs

laravel-mcp-support maintained by datomatic

Description
Shared building blocks for Datomatic's Laravel MCP servers: gated routes, audit log, OAuth client deduplication and MCP token lifetimes.
Last update
2026/11/30 15:58 (dev-main)
License
Links
Downloads
2
Tags

Comments
comments powered by Disqus

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 a can: 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.enabled is 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:use scope.

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.