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.
The idea
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
Authorize
Client sends Authorization: Bearer <MCP_AUTH_TOKEN>. The server validates it timing-safe and rejects without touching JSON-RPC.
Initialize
Client calls { "method": "initialize" }. Server returns protocol version and capabilities.
List & call
tools/list returns all 8 tools; tools/call runs one — e.g. create_file({ path, content }).
Land it
The write lands in the shared workspace store and shows up live in the Workspace Console.
The toolbox
| tool | what it does |
|---|---|
| create_file | Write a new file. Errors if the path exists. |
| update_file | Create or overwrite a file with full contents. |
| read_file | Return a file's contents from the workspace. |
| remove_file | Remove a file from the workspace. |
| list_files | List paths, optionally scoped to a directory. |
| generate_component | Scaffold a TSX component into src/components/. |
| generate_page | Scaffold a route + page into src/routes/. |
| build_status | Report file count and recent activity. |
Get connected
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.
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.{
"mcpServers": {
"ai-studio": {
"url": "https://<your-preview-url>/api/mcp",
"headers": { "Authorization": "Bearer <MCP_AUTH_TOKEN>" }
}
}
}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"}'{ "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
src/ tree still needs a platform AI Studio APIOpen the live workspace console, copy your config, and point any MCP client at it.
Open Workspace Console