Guides / ChatGPT Actions
💬 ChatGPT Custom Actions

Connect Your API to ChatGPT

Paste your Spring Boot, Express.js, or FastAPI code — MCP Forge generates an OpenAPI spec and a proxy endpoint so ChatGPT can call your API directly. No JSON schemas to write.

?

How ChatGPT Custom Actions work

ChatGPT can call external APIs through Custom Actions. You import an OpenAPI 3.x spec, set up authentication, and ChatGPT gains the ability to call those endpoints during a conversation.

MCP Forge auto-generates that spec from your existing code and proxies the calls through our infrastructure — so your API doesn't need to be public and you don't write any OpenAPI YAML by hand.

Without MCP Forge

Manual OpenAPI authoring

Write YAML for every endpoint, maintain it as routes change, set up auth, expose your API publicly.

With MCP Forge

One paste

Paste your controller. Get an OpenAPI URL. Import into ChatGPT. Done — we proxy and keep the spec in sync.

✓

Prerequisites

  • A Spring Boot, Express.js, or FastAPI app with defined routes
  • A ChatGPT Plus or Team account (Custom Actions require a paid plan)
  • A free MCP Forge account — sign up here
1

Deploy your API to MCP Forge

Sign in to your dashboard, go to the Deploy tab, and paste your controller code. MCP Forge auto-detects the framework.

For example, a FastAPI app:

from fastapi import FastAPI
app = FastAPI()

@app.get("/orders/{order_id}")
def get_order(order_id: str): ...

@app.get("/orders")
def list_orders(status: str = None): ...

@app.post("/orders")
def create_order(item: str, qty: int): ...

@app.delete("/orders/{order_id}")
def cancel_order(order_id: str): ...

Click Generate + Deploy MCP Server →. Both your MCP endpoint (for Claude) and your OpenAPI spec (for ChatGPT) are generated from the same paste.

2

Get your OpenAPI spec URL

After deploying, go to the Overview tab and click 💬 ChatGPT Actions on the config card. Your spec URL looks like:

https://api.main-duck.com/api/tenants/YOUR_TENANT_ID/openapi

Click Copy URL. This URL is public — ChatGPT fetches the spec from it when you import.

What the spec describes — orders API
GET
get_order
/orders/{order_id}
GET
list_orders
/orders?status=
POST
create_order
/orders
DELETE
cancel_order
/orders/{order_id}
3

Import into ChatGPT

  1. Go to ChatGPT → Explore GPTs → Create
  2. Click Configure tab → Add actions
  3. Click Import from URL → paste your OpenAPI spec URL
  4. ChatGPT loads and displays all your endpoints as available actions
  5. Under Authentication → choose API Key → type Bearer → paste your MCP Forge API token (from the Overview tab)
  6. Click Save
Done. Try asking your GPT: "List all pending orders" or "Cancel order 42." ChatGPT will call your API through MCP Forge's proxy and return the result.
4

Works with Claude Desktop too

The same deployment powers both integrations simultaneously. Switch to the 🤖 Claude Desktop tab on the same config card to get the MCP endpoint for Claude Desktop, Cursor, or Windsurf — no extra steps.

One paste. One deployment. Every AI tool.

⚡

Optional: Auto-sync on push

When you add or rename routes, the spec updates automatically on every GitHub push — no re-paste, no re-import into ChatGPT.

  1. Dashboard → GitHub Sync
  2. Paste repo URL + Personal Access Token (read scope)
  3. Set branch to watch, copy the webhook URL to GitHub