Locking the Doors: How ByteChef Secures Its MCP Servers

On this page
TL;DR: The secret in a ByteChef MCP server's URL only routes the request. It isn't the credential. On top of it, every server can require authentication (on by default): an API key sent as a Bearer token, or an OAuth2 JWT from an issuer the installation trusts, checked for the right scope and bound to that exact endpoint (RFC 8707), with standard discovery (RFC 9728). ByteChef also ships its own authorization server with dynamic client registration, so Claude and other MCP clients can connect with a single Sign in. The Management MCP server uses the same model with stricter defaults, and v0.38 lets each member connect a coding agent to it with their own key, limited to one workspace and one environment.
The MCP server post made a slightly alarming idea sound easy: a URL that lets an AI run your workflows. Those workflows send email, update CRMs and move customer data around. A door like that is only as good as its lock, so this post is all about the lock.
Let's start by clearing up a common misunderstanding. Looking at an address like /api/automation/{secretKey}/mcp, it's tempting to think the long random string is the security. It isn't, and seeing why is the best way to understand the rest.
The URL Secret Routes, It Doesn't Authenticate
The secret in the path has one job: it tells ByteChef which MCP server the request is for and, on multi-tenant installations, which tenant that server belongs to. It doesn't prove who is calling.
That matters because URLs are the leakiest kind of secret. They end up in browser history, proxy logs, screenshots and config files shared in chat. So every MCP server has a Require authentication switch, described in the UI as "Require an API key or OAuth token in addition to the server URL." It's on by default. With it on, a request without a valid Authorization: Bearer header gets a 401, however correct the URL is. A leaked URL on its own gets an attacker nothing.
It's still worth cleaning up after a leak, so the server page marks its connection snippets Sensitive and lets you regenerate the URL. But a leak becomes an inconvenience rather than a breach.
What goes in that Bearer header depends on how far up the ladder you need to go.
Step One: API Keys
The simplest credential is an API key sent as the Bearer token. You create one in the Automation workspace under Settings → API Keys and give it to your client. For clients that let you set request headers, that's a single line:

If your client has no place for request headers, Claude Desktop's config file for example, the Connect tab gives you a snippet that runs mcp-remote and passes the same header on the command line.
On the server side, the flow is deliberately boring. ByteChef reads the tenant from the URL secret, then checks that the key is valid and belongs to that same tenant, environment and workspace. A key from one workspace won't open a server in another. Only then does the request run, inside that tenant, so everything downstream is scoped by construction. No valid key means no tools, not even a tool list.
For a team connecting its own Claude to its own ByteChef, this is a perfectly sound place to stop: two secrets you can rotate separately, and a clean 401 for everyone else.
Step Two: Tokens From Your Own Identity Provider
Larger organizations ask harder questions. Can our identity provider issue the credentials? Can tokens expire and carry scopes? ByteChef's OAuth2 resource server answers part of that: an automation MCP server can accept JWTs from an identity provider your installation trusts.
That trust lives in configuration, set by whoever runs ByteChef. Each trusted issuer is an entry under bytechef.oauth2.resource-server.issuers. The shipped configuration already lists one, ByteChef's own authorization server (more on that below). You add your identity provider as another entry and keep that one, because setting the list replaces it. Identity providers added under Settings → Identity Providers aren't part of this: they're for signing in to ByteChef, and MCP servers don't accept their tokens. Five details matter:
- It sits alongside API keys instead of replacing them. ByteChef only treats a Bearer token as OAuth2 when it's on an MCP path and actually looks like a JWT. Clients with API keys keep working, clients with JWTs get the richer model, and the rest of the API isn't affected.
- You can trust more than one issuer. Tokens are checked against every configured issuer, so your corporate identity provider and a second one can both be trusted at the same time. Federation isn't a special mode, just another entry in the list.
- Scope and audience are checked per endpoint. Once the signature checks out, ByteChef confirms the token carries the scope for the endpoint it's calling (
mcp:automationfor automation servers) and that its audience is bound to that exact endpoint, as RFC 8707 describes. That second check is the quiet hero: a perfectly valid token issued for one server is rejected by every other one. A stolen token doesn't travel. - In v0.37 it's for automation MCP servers. The Management MCP server's address,
/api/management/mcp, accepts only tokens ByteChef issued itself, so your identity provider's tokens don't reach the builder's tools. v0.38 adds a way in, covered below. - The issuer entry decides the permissions. ByteChef doesn't look the token's subject up as a ByteChef user. The subject names the caller, and the permissions come from the issuer entry: a fixed
authoritieslist, or anauthorities-claimnaming the token claim that holds them. If you set atenant-claim, it has to match the server's tenant.
Discovery: Telling Clients How to Get In, and Nothing More
Modern MCP clients don't want you to configure authentication by hand. They expect to discover it. ByteChef follows RFC 9728: when OAuth2 is on and an unauthenticated request arrives, the 401 carries a WWW-Authenticate: Bearer header with a resource_metadata link. That link leads to a document describing the endpoint and naming one authorization server: the first trusted issuer, which in the shipped configuration is ByteChef's own. One round trip, and the client knows where to get a token.
With no trusted issuer configured, ByteChef answers with a plain 401: no hint, no metadata, nothing for an attacker to learn. The server doesn't advertise machinery it doesn't have.
Step Three: ByteChef's Own Authorization Server
Bringing your own identity provider is great if you have one. Many teams don't, or don't want to register a new app for every assistant they try. So ByteChef can also issue tokens, not only check them.
It ships a full authorization server built on Spring Authorization Server. It's on by default (bytechef.oauth2.authorization-server.enabled: true) and needs bytechef.public-url, which becomes the token issuer. The shipped configuration trusts its own tokens through a self issuer entry, so they pass the same resource server checks as tokens from your identity provider. It's designed for MCP in a few ways:
- Clients can register themselves. Dynamic client registration is on for MCP, which is how the MCP specification expects onboarding to work. A compliant client like Claude registers itself and runs the OAuth flow, with no administrator creating client IDs and nobody sending secrets over Slack. Administrators can still review and manage registered clients from the settings.
- Tokens know where they're going. The client names the MCP endpoint it wants (the RFC 8707
resourceparameter), and the token is bound to that endpoint from the moment it's issued. Asking to switch it to a different endpoint later fails withinvalid_target. - Signing in is one click. This is what powers the One click path in the Connect tab of every MCP server. In Claude, you add ByteChef as a custom connector, paste the URL, click Sign in and approve access on ByteChef's consent page. There's no key to copy anywhere.
API keys stay available next to all of this, for clients and scripts that prefer them.
The Management MCP Server Gets Stricter Defaults
The automation MCP server lets an AI run your workflows. The Management MCP server, at /api/management/mcp, goes a level higher and gives an AI the builder's tools: searching components, creating projects, writing workflows, publishing them. That's a lot more power, so it gets stricter defaults.
Its URL contains no secret at all, so the credential alone decides which account a request belongs to. Authentication is always required, with no switch to turn it off, and OAuth2 tokens need their own mcp:management scope. Thanks to audience binding, a token issued for an automation server is useless against it.
In v0.37 it accepts two credentials: signing in with ByteChef, or an admin API key (an Enterprise Edition feature).
Coming in v0.38: A Key Per Member, Workspace and Environment
An admin key is the wrong thing to paste into a coding agent. The agent keeps it in a config file and runs it next to untrusted input, and if it leaks, the whole account leaks with it. v0.38 adds a narrower option and makes the admin key's role clearer.
- Members can use their own workspace API key. The same kind of key you create under Settings → API Keys now works on the Management MCP server too, and every member can copy its address,
/api/management/mcp, from Settings → MCP Server. The key is bound to the key's workspace and environment: tools default to them, and naming another workspace, another environment or an object from another workspace is refused.listWorkspacesreturns only that workspace, and anX-ENVIRONMENTheader has to match the key's environment or the request gets a 401. - It carries your permissions, never more. The tools act with the member's own role in that workspace, and an admin's own workspace key doesn't carry tenant administration rights either. The key stops working when its owner leaves the workspace. Embedded API keys are rejected with a 401.
- Your identity provider reaches the Management MCP server too. Its tokens don't say which ByteChef account they belong to, so the shared
/api/management/mcpaddress still refuses them. When your installation trusts an issuer other than ByteChef's own, Settings → MCP Server now shows admins a second address for them,/api/management/<secret>/mcp, whose secret names your account. The token still needs themcp:managementscope and an audience bound to that address, and Regenerate replaces the address if it leaks. - Admin keys span every environment. An admin key already worked in every environment, but it was still created under one. In v0.38 it has no environment of its own, and the Admin API Keys page lists every key whichever environment you're in. A script picks the environment per request with the
X-ENVIRONMENTheader, and the Enterprise Edition audit log records the environment each call used. Admin keys are meant for administration scripts, not agents.
So for a coding agent the advice is simple: sign in with ByteChef, or give it your own Development workspace key. If that key leaks, the damage stays inside one workspace in one environment.
The Ladder at a Glance
| API key | OAuth2, your identity provider | OAuth2, built-in server | |
|---|---|---|---|
| Credential | Workspace API key as Bearer | JWT from an issuer in the installation config | JWT issued by ByteChef |
| URL secret | Routes only | Routes only | Routes only |
| Tenant | From the URL, key must match | From the URL, optional tenant claim must match | From the URL and token claims |
| Scope | The key's workspace | mcp:automation | mcp:automation, mcp:management |
| Stolen credential | Revoke the key | Audience binding (RFC 8707) | Audience bound at issue time |
| Client setup | Paste URL and key | Client gets the token from your identity provider | Dynamic registration and one-click Sign in |
| Unauthenticated request | Plain 401 | 401 with discovery link | 401 with discovery link |
Look at the table as a whole and the pattern is well-known standards, carefully stacked: Bearer tokens, resource indicators, protected resource metadata, dynamic registration. No home-made cryptography, no clever proprietary handshakes, just the RFCs the MCP ecosystem is settling on, with the tenant awareness a multi-tenant platform needs.
A Checklist for Your Own MCP Servers
Exposing your automations to AI is only a good idea if the door has a real lock. You climb the ladder as far as your requirements go: a URL that only routes, a credential on every server by default, and scoped, endpoint-bound OAuth2 when the enterprise questions arrive, issued by your identity provider or by ByteChef itself.
Setting up an MCP server? Keep Require authentication on, connect Claude with Sign in or give your client a workspace API key, and regenerate the URL if it ever leaks. If your organization runs an identity provider and wants its tokens on automation MCP servers, add it under bytechef.oauth2.resource-server.issuers. The MCP Servers docs cover each option.
Subscribe to the ByteChef Newsletter
Get the latest guides on complex automation, AI agents, and visual workflow best practices delivered to your inbox.


