Model Context Protocol · Streamable HTTP

Your AI Studio,
scriptable by any agent.

Spin up an MCP server from AI Studio and let Cursor, Claude Code, ChatGPT, and Ask AI generate code straight into your workspace — then watch it land live in the console.

Cursor
Claude Code
ChatGPT
Ask AI

The idea

An MCP server, inside AI Studio

The Model Context Protocol is an open JSON-RPC 2.0 standard for letting AI agents call tools. This project ships an MCP server as an HTTP endpoint at /api/mcp, authenticated with a bearer token. Any compatible client connects once and gets a toolbox that creates, edits, and reads files in your AI Studio workspace.

JSON-RPC 2.0

initialize → tools/list → tools/call

Bearer auth

timing-safe token check on every call

8 tools

files, generators, and status

How it works

Four steps from prompt to code

  1. 1

    Authorize

    Client sends Authorization: Bearer <MCP_AUTH_TOKEN>. The server validates it timing-safe and rejects without touching JSON-RPC.

  2. 2

    Initialize

    Client calls { "method": "initialize" }. Server returns protocol version and capabilities.

  3. 3

    List & call

    tools/list returns all 8 tools; tools/call runs one — e.g. create_file({ path, content }).

  4. 4

    Land it

    The write lands in the shared workspace store and shows up live in the Workspace Console.

The toolbox

8 tools your agents can call

toolwhat it does
create_fileWrite a new file. Errors if the path exists.
update_fileCreate or overwrite a file with full contents.
read_fileReturn a file's contents from the workspace.
remove_fileRemove a file from the workspace.
list_filesList paths, optionally scoped to a directory.
generate_componentScaffold a TSX component into src/components/.
generate_pageScaffold a route + page into src/routes/.
build_statusReport file count and recent activity.

Get connected

Point your client at AI Studio

Every MCP client takes a server config. For the HTTP transport, that's a url and a headers block carrying the bearer token. Your exact URL and token live on the Workspace Console — copy them from the Connect tab.

Custom MCP Modaljson
Name: AI Studio MCP
MCP server URL: https://<your-preview-url>/api/mcp

Note: Do NOT fill in the "Advanced" fields (Client ID / Client Secret).
Leaving Advanced blank connects directly with your MCP server without requiring an OAuth provider.
Cursor / Claude Code — .cursor/mcp.jsonjson
{
  "mcpServers": {
    "ai-studio": {
      "url": "https://<your-preview-url>/api/mcp",
      "headers": { "Authorization": "Bearer <MCP_AUTH_TOKEN>" }
    }
  }
}
Quick test — bash (list tools)bash
curl -X POST https://<your-preview-url>/api/mcp \
  -H "Authorization: Bearer <MCP_AUTH_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Sample call — generate a componentjson
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call",
  "params": {
    "name": "generate_component",
    "arguments": {
      "name": "PricingCard",
      "description": "A pricing card with tier name, price, and 3 features"
    }
  }
}

The honest limits

What's real, and what needs the platform

Works today
  • • Real JSON-RPC MCP server with 8 working tools
  • • Bearer-token auth on every request
  • • Live workspace UI that reflects writes in seconds
  • • Cursor / Claude Code config that connects for real
Persistent now
  • • Workspace writes are stored in the Cloud database — they survive cold starts and deploys
  • • Every tool call is logged to a persistent events table
  • • Freeform LLM generation (writing the scaffolds' bodies) needs an OpenAI/Anthropic key
  • • Writing into the builder's real src/ tree still needs a platform AI Studio API

Ready to wire it up?

Open the live workspace console, copy your config, and point any MCP client at it.

Open Workspace Console