Getting Started

Claude MCP OAuth: Connect Claude.ai to a Laravel CMS

By Lara Dashboard 2 views
Claude MCP OAuth: Connect Claude.ai to a Laravel CMS
You want Claude.ai to work inside your Laravel CMS. But most Claude.ai custom connectors cannot send your own bearer token header (Anthropic lists request headers as a limited beta), and pasting a secret into a chat is a bad habit anyway. OAuth fixes that. You give Claude a URL, sign in once on your own site, and click Allow.
Here is the quick answer. In Lara Dashboard v1.5.0 or later, turn on the MCP server under Settings → MCP, make sure /.well-known/ reaches Laravel, then add https://your-site.com/mcp as a custom connector in Claude.ai. Claude finds the OAuth endpoints on its own, registers itself, and sends you to a consent screen.
A quick disclosure. We build Lara Dashboard, an MIT Laravel CMS and admin, so it is the worked example here. Every Lara Dashboard detail below comes from docs/mcp.md and the code in the public repo. Claude.ai steps come from Anthropic's own help pages as of November 2026.
If you want the background first, read our plain-English guide to MCP servers for a CMS. For the release notes behind this feature, see Lara Dashboard v1.5.0: Claude.ai OAuth MCP and security fixes. This post is the hands-on part.

OAuth is the right path for Claude.ai, and tokens are still right elsewhere

Lara Dashboard gives you two ways to connect an AI client. Both end with the same kind of credential: an MCP agent token whose abilities follow the user's permissions.
Agent token. You generate a token under Settings → MCP → Agent tokens and put it in an Authorization: Bearer header. This suits Cursor, Claude Desktop, Claude Code and scripts, which all let you set headers in a config file.
OAuth. The client only knows the URL. It gets a 401, discovers the authorization server, registers itself, and asks you to approve it in the browser. This suits Claude.ai custom connectors and other remote clients.
So you are not picking a winner. Use OAuth where the client cannot hold a header, and keep agent tokens for local tools. Our post on connecting Cursor and Claude with agent tokens covers the other path.

Check four prerequisites before you open Claude.ai

Each of these can stop the connection before Claude ever reaches the consent screen. Check them first and the rest is easy.
1. You run v1.5.0 or later. OAuth for MCP shipped in v1.5.0 on 4 November 2026. Older versions only accept agent tokens.
2. Your site is reachable from the public internet over HTTPS. Anthropic's help article says Claude connects to custom connectors from Anthropic's cloud, not from your laptop. A site on localhost, a private VPN or behind an IP allowlist will not work unless you allow Anthropic's IP ranges. For local development, use Claude Code with an agent token instead.
3. Your web server passes /.well-known/ to Laravel. Some nginx configs deny every path that starts with a dot. OAuth discovery lives at /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-authorization-server, so a dot-path rule breaks it. The fix from our docs is in the next section.
4. The person approving has the right permissions. Approval follows the same rules as creating a token by hand. The user needs the settings.edit permission (the "manage settings" check) and at least post.view or post.create. Approval is also disabled in demo mode.

Step 1: turn on the MCP server and confirm discovery works

Sign in to your Lara Dashboard admin and open Settings → MCP. Turn on Enable MCP server and click Save Changes. Until you save, /mcp and every OAuth endpoint return 404. That is on purpose: a site that never uses MCP shows nothing.
The same page shows your MCP server URL. Copy it. It is your site URL plus /mcp.
Now check discovery from a terminal. Run curl -s https://your-site.com/.well-known/oauth-protected-resource/mcp. You should get JSON with resource set to your /mcp URL and authorization_servers set to your site URL.
Then run curl -s https://your-site.com/.well-known/oauth-authorization-server. You should see authorization_endpoint, token_endpoint and registration_endpoint, plus code_challenge_methods_supported set to S256.
If either call returns an nginx 403 or 404 page instead of JSON, add this block to your server config, reload nginx, and try again: location ^~ /.well-known/ { try_files $uri $uri/ /index.php?$query_string; }. Test it on staging first.

Step 2: create a dedicated user for the connector

This step is optional, but we recommend it. When you approve Claude.ai, the connection gets the abilities of the account that clicked Allow. If that is your superadmin, Claude can do anything the MCP tools allow, including activating modules.
Lara Dashboard maps permissions to MCP abilities in McpTokenService. For example, post.view gives mcp:posts.read, post.create gives mcp:posts.write, post.delete gives mcp:posts.delete, email_template.edit gives mcp:email.send, and module.activate gives mcp:modules.activate.
So a content-only role might hold settings.edit, post.view, post.create, post.edit, term.view, media.view and media.create, and leave out delete, email sending and module permissions. Create that role, create a user with it, and sign in as that user when you approve the connector. See role-based access with Spatie and Lara Dashboard for how roles fit together.
Be honest with yourself about one limit. Approval needs settings.edit, and that same permission also maps to the cache and log tools. You cannot build a connector user without it today.

Step 3: add the custom connector in Claude.ai

Anthropic's custom connector guide lists custom connectors on Free, Pro, Max, Team and Enterprise plans as of November 2026, with Free limited to one custom connector. The path depends on your plan.
Free, Pro or Max. Go to Customize → Connectors, click the add button, and choose Add custom connector.
Team or Enterprise. An Owner adds it under Organization settings → Connectors. Members then connect it with their own account from their Connectors page. On Enterprise, a custom role with the right access can also add connectors.
Fill in a name, such as "Lara Dashboard", and paste your /mcp URL. If the form shows authentication options, keep sign-in on.
If the form asks how to register the OAuth client, choose Register automatically. That option uses Dynamic Client Registration (RFC 7591), which is what Lara Dashboard supports through POST /mcp/oauth/register. As of v1.5.0 it does not read Client ID Metadata Documents, so the "published identity" option is not the one to pick for this server. Anthropic notes that auth settings cannot be edited after you add a connector, so if you pick the wrong one, remove the connector and add it again.

Step 4: approve on your own site, then test with a read-only prompt

When you connect, Claude.ai opens a page on your site. If you are not signed in, Lara Dashboard asks you to log in first. Sign in as the connector user from step 2.
The consent screen shows who you are signed in as, the host Claude will return to, and the list of MCP abilities the connection will get. Read that list. If it shows abilities you did not expect, click Deny and fix the role. Otherwise click Allow.
Back in Claude.ai, open a new chat, click the + button, open Connectors and switch Lara Dashboard on. Start with something harmless, such as "List my five most recent published posts." Then try "Create a draft post titled Test from Claude." Check the draft in your admin and delete it yourself.
In Lara Dashboard, go back to Settings → MCP. The connection now appears in the agent token list with an OAuth · prefix and the client's name. That row is where you revoke it later.

What happens under the hood, in one table

You do not need this to connect, but it tells you which step broke when something fails. PKCE with S256 is mandatory, and every refresh re-checks permissions.
StepEndpointWhat to expect
Claude calls the server without a tokenPOST /mcp401 with a WWW-Authenticate header pointing at the resource metadata
Claude reads the resource metadataGET /.well-known/oauth-protected-resource/mcpJSON naming your site as the authorization server (RFC 9728)
Claude reads the server metadataGET /.well-known/oauth-authorization-serverEndpoints, S256 PKCE, public clients only (RFC 8414)
Claude registers itselfPOST /mcp/oauth/registerA client ID; limited to 10 requests a minute
You approve in the browserGET/POST /mcp/oauth/authorizeConsent screen; a single-use code valid for 10 minutes
Claude swaps the code for tokensPOST /mcp/oauth/token60-minute access token, 30-day rotating refresh token; limited to 30 requests a minute

Troubleshooting: match the symptom to the cause

Claude says it cannot reach the server. Check that the site is public over HTTPS and that a firewall or WAF is not blocking Anthropic's IP ranges. Our guide to firewalls, WAFs and rate limiting for self-hosted Lara Dashboard covers where those blocks usually live.
Every endpoint returns 404. The MCP server is off, or you turned it on and did not click Save Changes.
/mcp works but discovery returns an nginx error page. Your config blocks dot-paths. Add the /.well-known/ location block from step 1.
The consent screen sends you back with access denied. The signed-in user lacks settings.edit, has neither post.view nor post.create, or the site runs in demo mode. Lara Dashboard returns error=access_denied with a reason to the client.
It worked yesterday and now asks you to approve again. Someone revoked the OAuth · row, the user lost a required permission, or the refresh token expired after 30 days without use. Approve again if that is expected.

Trade-offs: when not to use OAuth with Lara Dashboard

OAuth is a convenience, not a security upgrade over a well-scoped token. Skip it, or wait, in these cases.
  • You only use Claude Code, Cursor or scripts. An agent token is simpler and does the same job.
  • Your site is not public. Claude.ai connects from Anthropic's cloud and cannot reach a private network without allowlisting.
  • You cannot give the approving user the settings.edit permission. Approval requires it.
  • You need per-connection scopes narrower than the user's role. Today the connection gets every ability the user's permissions allow.
Also remember that MCP auth is still moving. Claude.ai now recommends Client ID Metadata Documents as its default way to identify itself. Lara Dashboard uses Dynamic Client Registration today, which Claude.ai still offers as Register automatically. Watch the changelog if you depend on this flow. For how this fits beside Laravel's own MCP tooling, see Laravel MCP vs Boost vs a CMS MCP server.

Self-check before you click Allow

  1. Is the site on Lara Dashboard v1.5.0 or later?
  2. Did you enable the MCP server and save the settings?
  3. Do both well-known URLs return JSON from curl?
  4. Is the site reachable over HTTPS from outside your network?
  5. Are you signed in as a dedicated user, not the superadmin?
  6. Does the consent screen list only the abilities you expect?
  7. Did you test with a read-only prompt before any write?
  8. Do you know which OAuth row to revoke in Settings → MCP?
  9. Does a human still review drafts before they are published?
If you can tick all nine, you are set. Keep publishing, email sending and deletion behind a person until you trust the flow. Our post on MCP with a small human in the loop describes a simple review habit.
Connecting Claude.ai to a Laravel CMS used to mean copying a token somewhere it did not belong. Now it is a URL, a sign-in and one click. The access token is still a normal Lara Dashboard agent token, so the same permissions, the same tool checks and the same revoke button apply.
The work that matters is not the connection. It is choosing the user who approves it. Give that user a narrow role and you get a useful assistant without handing over the keys. If you want a Laravel CMS that is ready for this on day one, try Lara Dashboard, turn on MCP, and connect Claude.ai with a content-only user.

FAQ

Do I need an API key to connect Claude.ai to Lara Dashboard?

No. With OAuth you only paste the MCP server URL into Claude.ai. You sign in on your own site and approve the connection, and Claude receives short-lived tokens without you copying anything.

Which Lara Dashboard version supports Claude.ai OAuth?

v1.5.0, released on 4 November 2026, and later. Earlier versions support agent tokens only, which most Claude.ai custom connectors cannot send.

Can I connect Claude.ai to a site running on localhost?

Not directly. Claude.ai connects from Anthropic's cloud, so the server must be reachable over the public internet. For local work, use Claude Code or Cursor with an agent token.

How do I disconnect Claude.ai from my CMS?

Open Settings → MCP and revoke the row whose name starts with "OAuth ·". That also revokes its refresh token, so Claude has to ask for approval again. You can also remove the connector on the Claude.ai side.

Can I limit what Claude.ai can do in my CMS?

Yes, through the role of the user who approves it. Abilities come from that user's permissions and are re-checked at every refresh. Leave out permissions such as post.delete, email_template.edit or module.activate and the matching tools stay off.
Laravel CMS Open source Admin Panel laravel access control

Try Lara Dashboard for Free

Explore every feature live — no sign-up required.

Launch Live Demo