What I learned shipping a remote MCP server that Claude and ChatGPT actually use
I'm a high school senior in Texas, and I built Stopover. You give it a home city, 2 to 7 cities you want to visit and a date window. It prices every order of those cities (7 cities is 5,040 orders) on dates that fit toge
I'm a high school senior in Texas, and I built Stopover. You give it a home city, 2 to 7 cities you want to visit and a date window. It prices every order of those cities (7 cities is 5,040 orders) on dates that fit together and tells you which order costs least, with a flight or train for each leg.
That question is a good fit for an AI assistant, so I put the planner behind a remote MCP server. It's now in Anthropic's Claude connector directory and the official MCP Registry as com.flystopover/stopover, and a ChatGPT app version is in OpenAI's review. This post covers what I learned shipping it. Most of it came from things breaking.
1. Your tool is slower than the client's patience
A Stopover plan on the free fare sources takes about 10 to 90 seconds, and a big one can take three minutes. MCP clients don't wait forever, and every client waits a different amount.
Claude. Anthropic's connector docs give a tool call 240 seconds on claude.ai and Desktop. So plan_trip holds the request open for up to 200 seconds, which leaves room for the answer to get back. The planner gets its own wall-clock budget of 185 seconds. Near the end it skips the remaining search phases and returns what it has, so almost every plan finishes in one call.
ChatGPT. OpenAI doesn't document a limit. Community posts said about 60 seconds, so I set my first answer at 45. In my first live test, ChatGPT gave up on a 46 second call. Now plan_trip answers at 25 seconds no matter what. If the plan is still running, it returns status: "running" and a plan id, and get_plan waits up to 20 seconds per call for the plan to finish.
The core of it is a race:
const first = await Promise.race([
run.then(() => "done" as const),
sleep(deps.softDeadlineMs ?? CONNECTOR_SOFT_DEADLINE_MS),
]);
if (first === "timeout") {
return { summary: summarizeJob({ ...job, status: "running" }, tag), started: true };
}
return { summary: summarizeJob(job, tag), started: true };
There's one more trap, and it's a hosting one. The planner runs on Cloud Run, which only gives a container CPU while a request is open. If you start a job and answer right away, the job crawls. So nothing here is fire and forget. plan_trip keeps the request open while it works, and each get_plan call keeps it open too, so polling keeps the CPU on. The MCP endpoint doesn't run on Vercel at all (it 404s there), because Vercel kills a function at 300 seconds.
Two smaller things:
-
Go stateless. Claude still opens a fresh session for every tool call, so I build a new
McpServerper request. The plan id is the only state that has to survive between calls, and it lives in the database. - Throttle progress notifications. Claude Code shows them; claude.ai shows a spinner either way. I send at most one every five seconds.
2. ChatGPT cards need the ui/initialize handshake
The ChatGPT app shows a plan card under the result. It's a ui:// resource served as text/html;profile=mcp-app, and it's fully self-contained: inline CSS and script, nothing fetched, so its content security policy can stay empty.
My first version just read window.openai.toolOutput and rendered it. ChatGPT said the card "couldn't open" and timed out. The fix was the MCP Apps bridge, which is JSON-RPC over postMessage with the host. The host waits for the card to call ui/initialize before it shows anything:
rpc("ui/initialize", {
protocolVersion: "2026-01-26",
appInfo: { name: "stopover-plan-card", version: "1.0.0" },
appCapabilities: {},
}).then(function (r) {
notify("ui/notifications/initialized", {});
render(current());
});
After that, the card listens for ui/notifications/tool-result. While a plan is still running, it calls get_plan with the plan id until the status is done, so the 25 second rule from section 1 never looks broken. People just watch the card fill in.
OpenAI's card guidelines are strict: no logo of your own (ChatGPT adds it), at most two calls to action, and no scrolling inside the card. Mine has one button, which opens the full plan on flystopover.com.
3. OAuth 2.1 for personal tools
The public server needs no sign-in to plan a trip. But people with an account wanted Claude and ChatGPT to see their saved trips, change them, and turn on price-drop emails.
ChatGPT doesn't let users add custom headers or API keys, so personal tools there need OAuth 2.1. I turned on Supabase's OAuth 2.1 server with dynamic client registration and PKCE, so ChatGPT registered itself as a client. My job was three pieces:
-
Protected resource metadata (RFC 9728) at
/.well-known/oauth-protected-resource/mcp/chatgpt. It names Supabase's auth server, so ChatGPT knows where to send people. -
Mixed auth per tool.
plan_tripandget_plandeclaresecuritySchemesof bothnoauthandoauth2. The account tools (list_my_trips,change_trip,watch_price) requireoauth2and are always listed. Called signed out, they return an error with anmcp/www_authenticatevalue in_meta, which makes ChatGPT show a sign-in button. - A consent page on my site. Dynamic registration means any app can call itself anything, so the page shows the site an approval will be sent back to. A name can be borrowed. A redirect can't.
One lesson from auditing it: be strict about where an OAuth token counts. A token issued to a connector should only work on the connector endpoint, never as a normal login to the rest of your site.
On Claude, people with a pass use a personal key in an Authorization header instead. One small lesson: a wrong key gets a 403 with a plain sentence, never a 401. A 401 tells Claude to go looking for an OAuth server that doesn't exist.
4. Keep the free tier cheap
Anyone can call a public MCP server, including scanners. Three rules keep it cheap:
- Free sources only, enforced in code. Connector plans run with a live budget of zero, and the paid sources are also taken out of the source list by name. "Free only" is a property of the code, not of one number staying at zero.
- Reuse finished work. An identical request within six hours gets the finished plan back, with a note saying how old the fares are, and it doesn't count against the caps.
- No credits for crawlers. My public route pages price every order of a real set of cities from cached fares, one request per city pair, no live search. If the cached data can't answer the question, the page returns 404 instead of rendering a thin page.
I also refuse JSON-RPC batches now. The SDK still accepts the older protocol's batches, and one POST full of get_plan calls counted as a single request against my flood guard while doing hundreds of database reads. On Supabase's free plan, that egress adds up fast. Neither Claude nor ChatGPT sends batches anyway.
5. Rate limit per surface, not per IP
Every Claude user reaches my server from Anthropic's published address ranges. A per-IP limit would treat all of them as one person and lock everyone out after a few plans. Cloud Run even logged Claude's requests with a remote address of 0.0.0.0.
So the caps are global and kept separately for each surface (the Claude connector, the ChatGPT app, and anything else), under separate keys, so one can't use up the other's. Each has an hourly cap, a daily cap and a limit on plans running at once.
The "anything else" bucket covers addresses outside the ranges Anthropic and OpenAI publish: scripts, scanners, someone with curl. Those caps apply on top of the global ones, so one script can't burn the hour for every Claude user. Every refusal ends by saying the same trip can be planned for free on the website.
6. Write tool descriptions for each client
The two directories want different words.
Anthropic's review criteria: say what the tool does and nothing else. No instructions to call other tools, nothing promotional, a title and the right read-only or destructive hint on every tool, and errors that say what to change.
OpenAI's discovery guidance: ChatGPT picks tools by their metadata, so start with "Use this when..." and say when not to use it. My ChatGPT plan_trip description starts like this:
Use this when someone wants a trip to one or more cities: the cheapest dates and flights for a round trip to a city within a date window, which order to visit several cities in, or the cheapest way to see them. ... Do not use it for hotels, car rentals or to book.
Same tools, same schemas, two sets of words chosen by which endpoint was called.
7. Publish to the official MCP Registry
The registry entry is a small server.json:
{
"name": "com.flystopover/stopover",
"title": "Stopover",
"version": "1.0.1",
"remotes": [
{ "type": "streamable-http", "url": "https://mcp.flystopover.com/mcp" }
]
}
To claim the com.flystopover/* namespace, I proved I own the domain over HTTP. I generated an Ed25519 key pair, served the public key at https://flystopover.com/.well-known/mcp-registry-auth (v=MCPv1; k=ed25519; p=...), and kept the private key in a gitignored file. Then:
mcp-publisher login http --domain flystopover.com --private-key "<private key>"
mcp-publisher publish server.json
Every publish needs a new version, so bump it each time. And make your server's domain match your site's. mcp.flystopover.com is a domain mapping to the Cloud Run service, because Anthropic's directory asks that the server's domain match the service's.
Try it
The endpoint is https://mcp.flystopover.com/mcp (streamable HTTP, no auth needed to plan).
Claude Code:
claude mcp add --transport http stopover https://mcp.flystopover.com/mcp
Cursor (mcp.json):
{
"mcpServers": {
"stopover": { "url": "https://mcp.flystopover.com/mcp" }
}
}
In claude.ai, add it from the connector directory. Then try something like: "Plan Dallas to Lisbon, Madrid and Paris in March, 2 to 4 nights each, 2 travelers, cheapest order."
Public docs are at github.com/abc000cool/stopover-mcp. If something breaks or a description confuses your client, open an issue there.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.