Skip to main content
Most people use the server through an assistant that already handles everything on this page. Read it when you write the client yourself: an assistant, a script that calls the server with an API key, a test. It covers what a client sees around a tool call. The tools reference covers the tools, and Connect your assistant the setup.

The protocol in short

  • One endpoint. POST https://mcp.widgetic.com/, JSON-RPC 2.0. Every request carries its own credential, Content-Type: application/json and an Accept that lists both application/json and text/event-stream.
  • One JSON document per answer. The server is stateless: there is no session to open, no stream to hold and nothing to listen on. A GET that asks for text/event-stream gets 405 with Allow: POST, OPTIONS. A call that takes time answers at once, and you follow it with later calls: see While a build runs.
  • Revisions. The server speaks revision 2025-11-25 of MCP and the ones before it. A request that names revision 2026-07-28, in the MCP-Protocol-Version header or in _meta["io.modelcontextprotocol/protocolVersion"], is answered the way that revision says: no initialize, a resultType on every result, a server/discover call that lists what the server accepts, and a tools/list that says how long to keep the list (ttlMs, one minute, cacheScope: "private"). A request that names anything else is answered as it always was.

Check the tools without a key

The version of the tool contract and the names of the tools are published at an address that needs no credential:
Use it before a release, or in a test, to check that the tools your client was written for are the ones the server serves: compare contractVersion and tools with what the client expects, and read tools/list again when they differ. The document has no descriptions, no input schemas and nothing that depends on who asks, so it is the same for everyone. It answers GET and HEAD, and it sends no CORS headers: read it from a server or a script, not from a web page.

Questions before a build

When a request to create_widget is very open (“a widget for my bakery”), the server does not start a build and spend a credit on a guess. It asks a few short questions first, and builds once they are answered. revise_widget does the same for a change request that does not say what should change. A question starts nothing and costs no credit. What it asks
  • For a new widget: what kind of widget it should be (a quiz or poll, a countdown, an image gallery or carousel, an FAQ or list, a timeline, a chart or calculator, or the person’s own words), what it should look like (clean and light, dark and bold, playful and colorful, matching their brand colors, or their own words) and, optionally, anything it must say or show. A question the call already answers is left out.
  • For a change: what should change (colors and style, layout, texts and content, behavior and animation, sizes and spacing; several can be chosen) and, optionally, a description of the change.
  • Nothing else, and never a secret. What the person types is cut to the room its field has.
When it asks Only for a request that is very open. A request with files or media library items attached builds at once, and so does one with a longer description. When the server is not sure that a request is too open, or cannot decide, it builds as asked: a question can prevent a wasted build and never blocks a real one. A retry of a build that already started is never asked again. suggest_widgets asks questions of its own, up to three and once, when a goal is too open to suggest widgets from: its status is needs_details, the questions come in the answer, and you call the tool again with the answers in details. create_widget_batch and replicate_widget never ask. How the questions reach your client
The call comes back as a tool error that says nothing was started and no credits were used, and lists the questions. Put them to the person, then call the same tool again with the whole request and the answers added to it. The server keeps nothing between the two calls, so the second call carries everything.
An answer becomes an argument of the call before anything checks it, so the content checks and the length limits read it exactly as they read the description.

While a build runs

create_widget and revise_widget start the work and answer at once. They, get_widget, show_widget and cancel_widget_creation all return the same state object, so one reader serves all five. This is what get_widget returns a minute into a build:
Poll get_widget every 5 to 10 seconds until phase is ready, failed or cancelled. It uses no credits, and a build usually takes a few minutes. There is no push, and no progress inside a single call: the figure moves in coarse steps and there is no time estimate. Polling faster does not make the build quicker, and each call counts against the tool’s budget for the minute. What the server keeps true
  • The state is read from stored records, not from the memory of one server, so any server can answer and a restart loses nothing.
  • A build that stops reporting for 5 minutes is reported as failed with a note, not as generating for ever. A widget with no draft and no build record is queued for its first 2 minutes and failed after that.
  • A failed or cancelled revision never erases the draft the person already has: the widget stays ready, with a note.
  • Credits come back when a build fails.
What a build in progress blocks While a widget is queued or generating, revise_widget, publish_widget and delete_widget are refused for it, each with a sentence that says nothing was started, published or deleted. cancel_widget_creation marks the build as cancelled, but it cannot stop work the generator has already begun, so a draft can still appear afterwards. For 2 minutes after a stop, delete_widget is refused as well, because the stopped build may still be writing to the widget; the refusal says to try again in a few seconds. Batches, translations and the rest create_widget_batch answers at once with one entry for each widget and returns no state object: follow each widget with get_widget, as above. create_translation and add_translation_languages are the one place where a single call waits for work. They wait for under a minute, then answer with what they have (finished is false while some languages are still being made), and you follow them with get_translation until its state is ready. A translation that has not finished is not a failure and the work goes on without you.

Saving files

save_to_media_library runs inside the call and returns a result for every file, so there is no live percentage to follow.
  • What it takes. Up to 10 HTTPS links in file_urls, and up to 10 attached files, filed in the folder you name (Assets when you name none). A link has to answer directly: redirects are not followed. A file can be up to 250 MB, an SVG up to 2 MB, a JSON or Excel file up to 10 MB.
  • What it returns. saved lists each file with its media_id, name, kind, folder and thumbnail_url. failed lists the position of each file that could not be saved and the reason, in words: the type is not supported, the file is too big, the link did not answer, or the storage allowance is full. One bad file does not stop the others.
  • Room. Saved files count against the storage allowance. get_account_usage reports storage_used_mb and storage_limit_mb before you save many.
create_widget and revise_widget take up to 5 files of their own and up to 5 media_ids of images already in the media library. The files argument holds what ChatGPT hands over for an attachment (a temporary download_url and a file_id), and the server fetches those only from the file hosts of OpenAI and ChatGPT. Any other client saves the image with save_to_media_library first and passes the media_id it gets back. A file that cannot be used refuses the whole call before any credit moves, and the answer names it and says why.

Errors

A failure is one of two things, and a client should treat them differently. An HTTP error says the request did not reach a tool at all. A tool error says the tool ran and refused. The event methods of MCP events refuse a third way, with HTTP 200 and a JSON-RPC error that has its own codes.

At the door

The server checks the request in this order: the credential and the plan that goes with it, then Accept, Content-Type, the size of the body and the JSON in it. An answer about the credential, the plan or the rate has a body of the form { "error": "...", "error_description": "..." }. An answer about the request itself (400, 406, 413, 415) is a JSON-RPC error: { "jsonrpc": "2.0", "id": null, "error": { "code": ..., "message": "..." } }. Any other address on the host answers 404 with { "error": "not_found" }. A browser that opens the bare host is sent to the overview of these docs.

Inside a tool

A tool error comes back with HTTP status 200. The result has isError set to true and one text item, a sentence written for the person to read as it is. It has no structuredContent.
Show the sentence to the person. Decide what to do from isError and from the tool you called, and do not match on the words: they are written for people and can be improved from one release to the next. Every refusal says whether anything was changed. A refusal that starts nothing says that no credits were used.

Several agents on one account

Any number of clients can be connected to the same workspace at once: ChatGPT, two Cursor windows, Claude Code in a terminal, a script with an API key. Each connection is separate and has its own grant, which the person can revoke without touching the others. They all work as the same account in the same workspace, so they see the same widgets, the same media library, the same Brand Kit, the same workflows, A/B tests and translations, and they spend the same credits. There is no push between agents. One is not told when another changes something: it sees the change the next time it reads. The one notice that exists is MCP events, and it tells a subscribed app that a visitor sent an entry into a widget, not that another agent changed it. Reading entries (list_widget_data, get_widget_data) changes nothing, so several agents can do it at once.

What is protected

A tool that changes a widget takes the revision the widget had when the agent read it, as expected_revision: revise_widget, publish_widget, unpublish_widget, rename_widget, delete_widget, update_widget_customization, save_embed_settings, apply_embed_code and add_content_from_files. save_workflow and publish_workflow do the same with a workflow’s revision. When the token is no longer the current one, the tool does nothing, uses no credits and says the widget has changed, so the agent reads it again instead of writing over somebody else’s change. Pass it whenever you read first. The details are in Changing a widget that may have changed. A revision is a short opaque token, 16 hexadecimal characters. It moves when the widget is renamed, built, published, unpublished or set live, and not for a thumbnail or any change nobody would call a change of the widget. Copy it as it is.

What is not protected

Two agents that ask for the same thing both get it, and both are charged. Look at list_widgets before you try again after a call that may or may not have gone through.
  • Starting a build. create_widget has a repeat guard, but a narrow one: the same title (capital letters ignored) from the same account within two minutes returns the widget already started, and charges nothing. Another title, or the same one two minutes later, starts another widget. The same holds for each entry of create_widget_batch, and it refuses a second batch within the same minute.
  • Copies and new things. duplicate_composition adds a copy at every call, up to 10 for a widget. save_workflow and save_ab_test without an id make another one at every call, and so does a retry after a timeout: check list_workflows or list_ab_tests first.
  • The Brand Kit. update_brand_kit has no revision. The later write wins, and colors replaces the whole palette, so an agent that read the palette before another one changed it, and sends it back, undoes the other’s colors. Read it again with get_brand_kit before you write. The answer carries what each changed part was before, so nothing is lost for good.
  • The media library. manage_media_library renames and moves files without a lock, so the later of two renames of a file wins. delete_media_file is final for everyone.
  • Final for everyone. delete_widget, a stop with set_ab_test_state and cancel_widget_batch cannot be undone, and an agent that is still waiting for what they ended finds it deleted, stopped or cancelled. The exact title or name the person confirmed protects against the wrong target, not against another agent that is still working on the right one. Pass expected_revision to delete_widget to refuse the delete when the widget has changed since you read it.
  • Offline for everyone. unpublish_widget takes a widget offline for every agent, until any agent publishes it again, or a revision that was not asked to stay a draft does.

Checklist for a client

  • Send Content-Type: application/json and an Accept that lists both application/json and text/event-stream.
  • Treat an HTTP error and a tool error (isError) differently, and show the sentence of a tool error as it is.
  • Handle the questions before a build: as words in every client, as a form in a client on revision 2026-07-28 that declares one.
  • Poll get_widget every 5 to 10 seconds, and stop at ready, failed or cancelled. Show status_text and note as written.
  • Pass expected_revision whenever you read before you write.
  • After a call that starts something has failed without a clear answer, call list_widgets before you call it again.