Docs
LoginTry for free

Get started

Build

Platform

AI

Data & content

Automation

Developers

AI

MCP servers

Turn your own code into an MCP server that Claude, Cursor and other AI assistants can use. Turbofy gives it a public address, checks every caller, keeps provider keys out of reach, lists its tools and records every call, so you only write the tools themselves.

What Turbofy does for you

An MCP server offers tools that an AI assistant can call, such as looking up an order, creating a ticket or writing a product text. Hosting one yourself means a server, a domain, a certificate, authentication, key handling and logging. In Turbofy you write the tools as a Docker cloud function, and the platform runs everything around it:

request path
MCP client (Claude, Cursor, …)
   │  https://<slug>.tools.turbofy.com/mcp
   ▼
Turbofy gateway
   ├── checks the API key or workspace login
   ├── checks the workspace has credits
   ├── hands out a short-lived grant for the server's secrets
   └── records the call in Activity
   ▼
Your Docker cloud function  ← only your tools, no auth code
  • Address: every published server gets its own HTTPS address with a certificate, at https://<slug>.tools.turbofy.com/mcp.
  • Access: every call needs an API key or a workspace login. A server is never open to the public.
  • Secrets: provider keys such as an OpenAI key stay workspace secrets. Callers never send them and your code never sees them.
  • Tools: the console lists the tools your server offers, including whether each one reads or writes.
  • Activity: every tool call is recorded with its caller, outcome, duration and cost.

You find MCP servers in the workspace sidebar under AI → MCP Servers.

Creating a server

New MCP Server offers two ways to start:

  • Build with agent: describe the tools you want, and the Turbofy assistant writes the function, creates the server and publishes it.
  • Start empty: pick a Docker cloud function you already uploaded and fill in the details yourself.

Starting empty opens the same dialog as new apps and flows. Choose an icon and color for the card, then fill in:

  • Name and Description: shown on the card and in the server's settings.
  • Slug: the first part of the address. 3 to 40 lowercase letters, digits or hyphens, starting with a letter and not ending with a hyphen. A few names, such as api, app and www, are reserved. The dialog suggests one from the name and shows the resulting address.
  • Docker function: the cloud function that serves the tools. It has to be a Docker function (see below).

When the slug is taken

Slugs are unique across all of Turbofy. If another server already published under your slug, yours is published under the slug plus the first eight characters of the server id, for example order-lookup-3f9a1c2e. The Connect tab shows the address the server actually got and says why it differs.

Writing the server function

The server itself is a Docker cloud function that speaks MCP over streamable HTTP. Three requirements:

  • It is a Docker cloud function, so you can use any language and MCP SDK.
  • It is stateless and answers with JSON. Every request can reach a fresh instance, so don't keep sessions in memory.
  • It serves MCP at /mcp. Turbofy invokes the function with a Lambda Function URL event; Lambda Web Adapter turns that into an ordinary HTTP request, so the server is a normal web app.

A complete Python server with the official MCP SDK:

python · server.py
import json
import os

import uvicorn
from mcp.server.fastmcp import Context, FastMCP
from mcp.types import ToolAnnotations

mcp = FastMCP("order-lookup", stateless_http=True, json_response=True)

READ_ONLY = ToolAnnotations(readOnlyHint=True, openWorldHint=False)


@mcp.tool(title="Look up an order", annotations=READ_ONLY)
def lookup_order(order_number: str) -> str:
    """Return the status of an order by its number."""
    return json.dumps({"order": order_number, "status": "shipped"})


@mcp.tool(title="Who am I", annotations=READ_ONLY)
def whoami(ctx: Context) -> str:
    """Name the caller Turbofy verified for this request."""
    headers = ctx.request_context.request.headers
    return f"{headers.get('x-turbofy-mcp-caller-kind')}: {headers.get('x-turbofy-mcp-caller-name')}"


app = mcp.streamable_http_app()

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", "8080")))
dockerfile
FROM python:3.12-slim

# Lambda Web Adapter turns the event Turbofy sends into a normal HTTP request.
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.1 /lambda-adapter /opt/extensions/lambda-adapter

ENV PORT=8080 \
    AWS_LWA_READINESS_CHECK_PATH=/mcp \
    PYTHONUNBUFFERED=1

WORKDIR /var/task
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY server.py turbofy_secrets.py ./

CMD ["python", "server.py"]
requirements.txt
mcp>=1.12,<2
uvicorn>=0.30,<1
botocore>=1.34,<2

Run it locally with python server.py and call tools/list with curl before you upload it. Turbofy adds nothing your server has to know about, except the optional caller headers below.

Who is calling

Turbofy checks the caller before the function runs, and removes the Authorization header before passing the request on, so the function never sees a key or token. Instead it gets the verified caller in headers:

  • x-turbofy-mcp-caller-kind: key for an API key, user for a workspace login.
  • x-turbofy-mcp-caller-id: the key's id or the user's id.
  • x-turbofy-mcp-caller-name: the key's name, such as Acme Corp, or the user's email address.
  • x-turbofy-mcp-caller-groups: the user's groups, when they have any.

Callers cannot fake these headers. Turbofy replaces any x-turbofy-* header a client sends.

Describing your tools

Give every tool a title and annotations that say what it does to data. AI clients use them to decide which calls need the user's confirmation, and directories such as the Claude directory require them.

  • readOnlyHint: true: the tool only reads, for example a lookup.
  • readOnlyHint: false with destructiveHint: false: the tool adds or changes something without destroying data, for example creating a ticket.
  • readOnlyHint: false with destructiveHint: true, or no destructiveHint: the tool may delete or overwrite, for example cancelling a policy.
  • idempotentHint: true: calling it twice with the same input has no further effect.
  • openWorldHint: true: it reaches services outside your server, such as an AI provider or the web.

The Tools tab of a server lists what its function reports: each tool's title, description, inputs and a badge for its access (Read only, Writes, Destructive or Access not declared). Tools without a title or a read or write hint are flagged, with a summary of whether the whole server is ready for a directory listing.

The list loads by itself once the function is built. After you change the function, press Refresh to ask it again.

Publishing

Open the server and press Publish on the Connect tab. It becomes available once the function's build has finished.

  • The first publish takes a few minutes while the certificate and address are set up. The status shows Publishing until then, then Published.
  • Republish publishes the server again with the same function, for example after you turned workspace login on or off. The server stays online meanwhile.
  • Unpublish takes the server offline and releases its address. Clients get errors until you publish again.
  • While a server is published its function is fixed. To run a different function, unpublish it first.

If publishing fails, the server shows Failed with the reason. Fix the cause and press Publish again; it picks up where it stopped.

Who can call your server

Every request needs a valid API key or a workspace login. Requests without one get HTTP 401 and never reach your function, cost no credits and do not appear in Activity.

API keys

Create keys on the server's Access tab, typically one per client or company, for example Acme Corp. A key starts with tfy_mcp_ and is shown once, right after you create it; Turbofy only stores a hash. Keys can get an expiry date, show when they were last used, and can be revoked at any time. A revoked key is refused immediately.

request header
Authorization: Bearer tfy_mcp_…

A key belongs to one server. Treat it like a password: anyone who has it can call that server's tools until you revoke it.

Workspace login

Instead of handing out keys, you can let people sign in with their App Users account. Turn on Let App Users log in under Workspace login on the Access tab. MCP clients such as Claude Code, Claude Desktop and Cursor then open your workspace's login page in the browser the first time they connect, and no header is needed.

  • Workspace login needs the App Users add-on. Without it, the Access tab offers to enable it; until then, API keys are the only option.
  • Anyone who can sign in to the workspace's App Users can use the server. Manage who that is under App users.
  • A login works for every server in the workspace that allows workspace login.
  • Scripts and curl still use an API key; login is for interactive clients.

Connecting clients

The Connect tab shows ready-made snippets with the server's real address. With an API key:

claude code
claude mcp add --transport http order-lookup https://order-lookup.tools.turbofy.com/mcp --header "Authorization: Bearer <your API key>"
claude desktop or cursor
{
  "mcpServers": {
    "order-lookup": {
      "url": "https://order-lookup.tools.turbofy.com/mcp",
      "headers": {
        "Authorization": "Bearer <your API key>"
      }
    }
  }
}
bash
curl -X POST https://order-lookup.tools.turbofy.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer <your API key>" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

With workspace login on, leave out the header. The client opens the login on first use:

claude code
claude mcp add --transport http order-lookup https://order-lookup.tools.turbofy.com/mcp

Browser-based clients work too: the server answers cross-origin requests and exposes the headers MCP clients need.

Using provider keys

Many tools call another service, such as an AI model provider. Never ask callers for that key. Store it as a workspace secret and let the server use it through the Turbofy secret broker, which puts the value into the outgoing request so neither the caller nor your code ever sees it.

  1. 1Store the key under Workspace settings → Secrets and add the provider's host, such as api.openai.com, to its allowed hosts.
  2. 2On the server's Access tab, under Secrets, give the secret the name your code uses, for example openai.
  3. 3In your tools, send requests through the secret client and use secret("openai") where the key belongs.
python
from turbofy_secrets import SecretClient, secret

@mcp.tool(
    title="Write a product text",
    annotations=ToolAnnotations(readOnlyHint=True, openWorldHint=True),
)
def write_text(prompt: str, ctx: Context) -> str:
    client = SecretClient(ctx.request_context.request.headers)
    response = client.request(
        "POST",
        "https://api.openai.com/v1/responses",
        headers={
            "Authorization": f"Bearer {secret('openai')}",
            "Content-Type": "application/json",
        },
        body=json.dumps({"model": "gpt-5-mini", "input": prompt}).encode(),
    )
    return response.json()["output_text"]

turbofy_secrets.py comes with the Python example server. Node.js servers use @turbofy-ai/secrets the same way, with the incoming request:

javascript
import { createSecretFetch, secret } from "@turbofy-ai/secrets";

app.post("/mcp", async (req, res) => {
  const fetch = createSecretFetch(req);
  const response = await fetch("https://api.openai.com/v1/responses", {
    method: "POST",
    headers: { Authorization: `Bearer ${secret("openai")}` },
    body: JSON.stringify({ model: "gpt-5-mini", input: "Hello" }),
  });
  // ...answer the MCP request with the result
});
  • Each tool call gets a short-lived grant for exactly the secrets mapped on the server. It expires when the call ends; initialize and tools/list get none.
  • The broker only sends a secret to its allowed hosts, over HTTPS, and redacts it from the response.
  • A refused request raises SecretBrokerError, for example with the code HOST_NOT_ALLOWED when the host is missing from the secret.

See Secrets for allowed hosts and how secrets behave everywhere else in Turbofy.

Building with the assistant

The Turbofy assistant, and any AI tool connected through the Turbofy MCP, can build and publish MCP servers for you. Describe the tools in plain language; the assistant writes the Docker function, creates the server and checks it with a real call.

Behind the scenes, each server is a file the assistant edits, flows/mcp-servers/<slug>/server.ts, next to your flows and cloud functions:

typescript · server.ts
import { mcpServerBuilder } from "@turbofy-ai/app-runtime/dsl";

export const mcpServer = mcpServerBuilder.buildServer({
  name: "Order lookup",
  slug: "order-lookup",
  description: "Look up orders and their delivery status.",
  icon: "server",
  color: "blue",
  handler: {
    server: { function: "order-lookup" },
  },
  auth: { oauth: true },
  secrets: {
    "openai": "<workspace secret id>",
  },
});
  • mcp_server_init creates a draft server for a Docker function.
  • mcp_server_pull and mcp_server_push load and save server.ts; a push with publication: "publish" publishes it.
  • mcp_server_call sends initialize, tools/list or tools/call to the published server, exactly as a client would, with a short-lived API key it removes afterwards.
prompt
Build an MCP server called Product Writer with one tool that writes a product description from a few keywords, using our OpenAI workspace secret. Mark the tool as read only, publish it and show me the tools it offers.

Activity and credits

The Activity tab lists every tool call, newest first and ten per page: the tool, the caller (the key's name or the user's email), the outcome, the duration, the credits it used and the time.

  • Each tools/call costs one credit, plus one credit for every started ten seconds the function runs.
  • initialize and tools/list are free.
  • When the workspace runs out of credits, the server pauses and answers with an error until credits are available again.

Errors your clients may see

Turbofy answers in JSON-RPC, so MCP clients show these errors to the user or the model:

  • -32004 with HTTP 401: no key or login, or an invalid, revoked or expired one. The WWW-Authenticate header tells clients where to log in when workspace login is on.
  • -32001: the workspace has run out of credits.
  • -32002: the server is not available right now, for example while its function is rebuilding.
  • -32003: your function failed while handling the request. Check the function's logs.

Editing and deleting

The … menu on a server's card opens it, copies its address once it is published, opens Settings for its name, description, icon and color, and deletes it.

Deleting a server that is published or was being published unpublishes it first, so connected clients stop working. The Docker function itself is kept.

Related

On this page