Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mcp Oauth Bundle Laravel Package

omouren/mcp-oauth-bundle

A PHP bundle that adds OAuth support to Model Context Protocol (MCP) servers, providing configurable authorization endpoints and token handling to help secure MCP clients without building OAuth plumbing from scratch.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package's stated purpose — OAuth 2.0 authorization-server behavior for MCP servers, covering discovery, Client ID Metadata Documents (CIMD), and resource-bound tokens — maps to a real, near-term gap. The MCP authorization spec requires protected-resource metadata (RFC 9728), authorization-server metadata (RFC 8414), resource indicators (RFC 8707) on token requests, and PKCE. Most teams standing up an MCP server will need exactly this layer, and doing it by hand on top of league/oauth2-server-bundle is non-trivial. The value proposition is legitimate.

The fit caveat is decisive, though: this is a Symfony bundle built on symfony/mcp-bundle and league/oauth2-server-bundle. The supplied description.md claims it "adds OAuth 2.0 protection to MCP servers in Laravel" and references Artisan commands and Laravel guards. That is inconsistent with the repository name, the repository description, and the dependency chain. The documentation package supplied here is not trustworthy as-is and must be re-validated against composer.json and source before any estimate is committed. For a Laravel shop, the answer is likely "reimplement the same spec surface on Laravel Passport or a hosted IdP" rather than adopt.

Integration feasibility. Low-to-moderate, gated on three things:

  1. Confirm the target service is Symfony and already using (or willing to adopt) mcp-bundle + league/oauth2-server-bundle. If either is absent, the bundle's assumptions about kernel bootstrapping, security firewall wiring, and entity/model bindings will not transfer.
  2. Confirm the MCP spec revision the package targets. CIMD is recent and still moving; a bundle pinned to an older draft can silently emit discovery metadata clients reject.
  3. Confirm the 1.2 release note is accurate. The changelog entry ("Add login redirect query parameter in config") does not describe OAuth authorization-server work and resembles a copy-paste from an unrelated package. Either the release process is unreliable or the changelog is auto-generated — both are diligence findings.

Technical risk. Ranked:

  • Spec churn (high). MCP authorization has changed materially across revisions; resource indicators and CIMD are young. Any implementation is a moving target, and a 2-star package has no capacity to track it quickly.
  • Bus factor 1 (high). Two stars, single maintainer, no visible downstream users. No community CVE triage, no security backport path. In an auth stack this is a board-level risk.
  • Security-critical surface (high). The package owns redirect_uri validation, token audience binding, PKCE enforcement, and login redirect handling. The one documented feature we can verify — a configurable redirect query parameter on login (v1.2) — is the classic open-redirect vector. Even if implemented safely, it signals the threat model is being extended casually.
  • Documentation drift (medium). Laravel-vs-Symfony contradiction means onboarding cost is unknowable until source review. Budget a spike, not an estimate.
  • License (low, positive). MIT means fork-and-maintain is legally viable; that is the main mitigant and should be treated as the fallback plan, not a footnote.

Key questions to resolve before commitment.

  • Which Symfony and PHP versions, and is league/oauth2-server-bundle v3 (new major) supported?
  • Which MCP spec revision does discovery output claim, and is there a conformance test suite in CI?
  • Does it enforce resource audience binding on both access and refresh tokens, and reject tokens minted for a different MCP server?
  • Is CIMD implemented, stubbed, or roadmap? What happens when the metadata document host is unreachable?
  • Who is the maintainer, what is their response SLA, and is there a security contact / disclosure policy?
  • Is the login redirect parameter validated against an allowlist, and are relative/protocol-relative URLs (//evil.example) rejected?
  • Are there any consumers beyond the author? Any public production references?

Integration Approach

Stack fit. Treat this as a Symfony-only option. If the MCP servers are Symfony, fit is good: the bundle slots into the existing security firewall and DI container and composes with mcp-bundle's route/controller conventions. If the estate is Laravel-first, do not port it — the abstractions (bundles, compiler passes, firewalls, entity providers) do not translate, and a Laravel reimplementation against the same RFCs is the honest path. If the estate is polyglot, prefer a central IdP (Keycloak, Auth0, WorkOS, Stytch) issuing resource-bound tokens and keep only thin resource-server validation in each MCP server.

Migration path. Do not rip out existing auth. Stand the bundle up as a second authorization surface in front of a single, low-traffic MCP server:

  1. Isolated POC service, no production data, real MCP client (Claude Desktop / MCP Inspector) completing the full flow end-to-end.
  2. Golden-path capture: discovery document, authorization request with resource, PKCE challenge, token exchange, and a rejected cross-resource token.
  3. Contract tests checked into our repo, not the package's — these become the acceptance criteria for any fork or replacement.
  4. Only then promote behind a feature flag, with the legacy path intact for rollback.

Compatibility. Pin exactly — composer.lock plus a documented constraint on Symfony minor and league/oauth2-server-bundle major. Auth libraries have broken semver before. Verify PHP version floor against our runtime matrix and confirm the bundle's discovery metadata is served over the same host/origin as the MCP endpoint (clients are strict about this).

Sequencing.

  • Week 1 — diligence: source read of the discovery controller, token endpoint customization, and redirect handling; confirm spec revision; talk to maintainer. Decision gate: proceed / fork / replace.
  • Week 2 — POC + conformance tests on a non-production MCP server.
  • Week 3 — security review (external if the MCP server exposes anything sensitive): redirect allowlist, audience binding, token lifetime, refresh rotation, revocation.
  • Week 4+ — flag-gated rollout, one server, then template the pattern before replicating.
  • Parallel track from day 1: evaluate the hosted-IdP alternative. Having a priced, tested fallback changes the negotiation position and de-risks the whole bet.

Operational Impact

Maintenance. Assume we own this, not the upstream. With 2 stars and one maintainer, plan for a vendored fork within 12 months, budgeted at roughly 10–15% of one backend engineer's time per quarter to track spec revisions and security patches. Keep the fork as a patch set on upstream rather than a hard divergence so we can rebase. Add a standing quarterly review: MCP spec diff, dependency CVEs, league/oauth2-server-bundle major bumps.

Support. No commercial support, no SLA, no visible issue triage. Internal ownership must be named explicitly — a single engineer accountable for the auth path, with a documented runbook. Escalation goes to the platform/security team, not upstream. Document the decision rationale (why a 2-star dependency was accepted, and what triggers removal) so it survives staff turnover.

Scaling. OAuth token endpoints are cheap but bursty; the real scaling concerns are:

  • Discovery/JWKS caching — clients and MCP servers will hammer metadata endpoints. Cache aggressively with correct Cache-Control and ETags.
  • Token introspection/validation hot path — if validation calls back to the AS on every MCP request, that becomes the bottleneck. Prefer local JWT verification against cached JWKS with short TTL.
  • Key rotation — publish overlapping keys in JWKS during rollover; validate against a clock-skew tolerance. A botched rotation takes every MCP integration down at once.
  • Storage — token and client tables grow monotonically; schedule pruning of expired tokens and orphaned clients from day one.

Failure modes and mitigations.

  • Upstream abandonment → fork + internal ownership (primary mitigation).
  • Spec drift → clients reject discovery metadata; contract tests catch this in CI, not production.
  • Open redirect via the login redirect parameter → allowlist hosts, reject protocol-relative URLs, prefer relative paths, log resolved vs. raw values at debug.
  • Token audience confusion → a token for MCP-A accepted by MCP-B. Enforce resource binding server-side and add a negative test.
  • Key/secret leakage in config → secrets via env/secret manager only; the published config file must never carry signing keys.
  • Metadata host unreachable (CIMD) → define fallback behavior; fail closed with a clear error rather than accepting an unverified client.
  • Clock skew / short token TTL → causes intermittent 401s that look like client bugs; set TTLs with headroom and instrument.

Ramp-up. Realistic estimate for an engineer new to the package: 2–3 days to a working POC (if the Symfony stack matches and the docs are wrong in ways that cost a day), 1–2 weeks to production confidence including conformance and security testing. The documentation mismatch raises the floor — do not let anyone plan against the Laravel quickstart in description.md, because following it will produce a non-functional integration. Front-load the source read, and treat the maintainer conversation as a hard prerequisite rather than a nice-to-have.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib