Choose How to Build an MCP Server
You can give an agent a new set of tools in four ways: use a managed MCP server that Redpanda built with a fixed tool set, generate tools from an OpenAPI description, write the tools in JavaScript, or register a self-managed server that you run yourself. Redpanda hosts the first three, and each option moves a different amount of work to you. Most governance features, such as data policies and access policies, work the same way with all four, so choose based on who should own the code and the hosting.
After reading this page, you will be able to:
-
Choose a way to build an MCP server that fits your integration, based on who owns the code and the hosting
-
Compare which Agentic Data Plane features work with each way to build an MCP server
-
Explain when to combine existing MCP servers into a Code MCP server
Your options at a glance
| Option | You provide | Who hosts and runs it | Who maintains the tools |
|---|---|---|---|
Credentials for the upstream system |
Redpanda, inside AI Gateway |
Redpanda. Each type has a fixed tool set. |
|
An OpenAPI 3.0 description of the API, plus credentials if the API needs them |
Redpanda, inside AI Gateway |
You, through the description. The server generates one tool for each operation in it. |
|
JavaScript (Preview) |
A JavaScript bundle that declares the tools, plus credentials if the API needs them |
Redpanda, in a sandbox inside AI Gateway |
You. Your code defines each tool, and you upload a new bundle to change it. |
A running MCP server and its URL |
You |
You. Redpanda proxies calls to your server. |
The managed catalog lists every managed MCP server type, including OpenAPI and JavaScript. Here, managed MCP server means one that Redpanda builds with a fixed tool set. OpenAPI and JavaScript servers are managed too, but you define their tools. The catalog’s OData and SOAP types also generate tools from an API description, like OpenAPI does.
Decide which option fits
Work down this list and stop at the first yes:
-
Does a managed MCP server already cover the system? Use the managed MCP server. You write nothing, and Redpanda keeps the tool set current.
-
Does the system publish an OpenAPI 3.0 description, and does forwarding its operations as tools give agents what they need? Use OpenAPI. You write no code.
-
Do you need logic a description can’t express, and does it fit the sandbox limits? Examples include several upstream calls behind one tool, a computed request signature, or a response you trim before a model reads it. Use JavaScript.
-
Otherwise, register a self-managed server. This fits when the logic outgrows the sandbox, needs Node.js built-ins, runtime module loading, or a filesystem, or the server already runs in your environment.
Use a managed MCP server
Choose a managed MCP server when one exists for the system you’re connecting, such as Jira, Slack, or a database. Redpanda builds, hosts, and upgrades the server, and you supply only credentials and options.
The trade-off is control: the type exposes the tools Redpanda built, and you can’t add one. Sign-in methods, other options, and maturity differ by type, so check the type’s own page. See Plug in an App, Database, or Tool for the full list.
Generate tools from an OpenAPI description
Choose OpenAPI when the API you need has no managed MCP server but does have an OpenAPI 3.0 description. The server reads the description and generates one tool for each operation, so you maintain the description instead of code.
Swagger 2.0 descriptions aren’t supported, and every tool forwards one operation as-is. If agents need several calls combined or results reshaped, JavaScript is a better fit. See OpenAPI Managed MCP Server.
Write tools in JavaScript
Choose JavaScript when you need custom logic but don’t want to run a server. You write the tools, and Redpanda runs your bundle in a sandbox inside AI Gateway, so there’s no infrastructure to operate.
The sandbox keeps your code small and contained:
-
The bundle is a single self-contained file of at most 1 MiB, and it can declare up to 64 tools.
-
Each tool call gets 64 MiB of memory and 10 seconds to run by default. You can raise the time limit to 60 seconds.
-
Your code can reach the network only through
fetch, only over HTTPS, and only to hostnames you allowlist. -
The clock is deterministic, so code can’t rely on the real time of day.
For the full limits and what the sandbox provides, see JavaScript Managed MCP Server.
Register a self-managed server
Choose a self-managed server when your tool logic doesn’t fit the sandbox, when it needs Node.js built-ins, runtime module loading, or system access that the sandbox doesn’t provide, or when the server already runs in your environment. You host, scale, and upgrade it, and Redpanda proxies calls to it and gives it a Redpanda-managed URL.
Keep these points in mind:
-
Use the Streamable HTTP transport when your server supports it. On the legacy Server-Sent Events (SSE) transport, data policies that shape responses can’t be enforced, so calls that match them are denied.
-
The server’s URL must be reachable from AI Gateway.
-
Only a self-managed server can pass the caller’s own token through to the server (token passthrough). See Token passthrough for the trade-offs.
Feature support by option
Platform features run in AI Gateway before a call reaches the server, so most of them don’t depend on which option you choose.
| Feature | Managed | OpenAPI | JavaScript | Self-managed |
|---|---|---|---|---|
Data policies (Preview) |
Yes |
Yes |
Yes |
Yes. On the legacy SSE transport, calls that match response rules are denied, and request rules still work. |
Yes |
Yes |
Yes |
Yes |
|
Yes |
Yes |
Yes |
Yes |
|
Output format (Preview) |
Yes |
Yes |
Yes |
Yes |
Depends on the type |
Yes |
Yes |
Yes |
|
Service-account OAuth |
Depends on the type |
Yes |
Yes |
Yes |
Token passthrough |
No |
No |
No |
Yes |
SQL exposure (query the server’s data as SQL tables; see an example) |
Many types. See each type’s page. |
Yes |
No |
No |
Member of a Code MCP server |
Yes |
Yes |
Yes |
Yes, unless it uses token passthrough |
Combine servers with Code MCP
A Code MCP server isn’t a fifth way to build tools. It sits in front of servers you already have, from 1 to 50 managed, OpenAPI, JavaScript, or self-managed servers, and gives agents two tools, search and execute, in place of every member’s full tool list. That can cut the tokens an agent spends on tool definitions when the members expose many tools.
Create one after you’ve built the servers it wraps. A Code MCP server has no data policies of its own. Each call it makes to a member server still goes through that member’s data policies. See Code Mode.
Request a new managed type
If no managed MCP server covers the system you need and OpenAPI or JavaScript won’t fit, ask Redpanda for a new managed type. Contact your Redpanda account team with the system and what agents need to do in it. If you don’t have an account team, open a ticket with Redpanda Support.
Next steps
-
Create an MCP Server: create a server of the type you chose.
-
Shape Tool Data with Data Policies: control which fields and rows agents see through any server.