Developers
Use Playcode from your code, your terminal and your coding agent. The app, the agent, the SDK, the CLI and MCP all call the same operations.
Quick start
#-
Install the CLI. It needs Node.js 22 or newer.
npm i -g @playcode/cli -
Sign in. The CLI shows a page address and a code: open the page, type the code and allow the CLI in one workspace.
playcode login -
List your projects. NAME is the name each project answers to.
playcode projects -
Publish a Cloud app, and wait until it is live.
playcode publish my-shop --wait
Every command and flag: The Playcode CLI.
Connect your coding agent
#playcode mcp runs an MCP server on your computer over your CLI sign-in, for Claude Code, Cursor and Claude Desktop. Register it as a command:
{
"mcpServers": {
"playcode": {
"command": "playcode",
"args": ["mcp"]
}
}
}
A client that connects to MCP servers by address uses Playcode's hosted server, https://playcode.io/api/mcp, and signs you in through Playcode.
Or give your agent this sentence:
Connect Playcode for me. Fetch https://playcode.io/docs/developers/agents.md and follow it.
Setup and limits: Connect Claude Code, Cursor or another MCP client.
Build AI into your app
#@playcode/sdk is the package your app's backend uses for AI models, agents and a chat for your users, email, video and the Playcode API:
npm install @playcode/sdk
Start with The Playcode SDK: a quick start, and a map of what you can build with each part.
Start here
- Docs for agentsFor a coding agent such as Claude Code, Cursor or Codex - connect to Playcode, sign the user in, call operations, and know when to ask the user.
- Access tokens and permissionsCreate an access token for a script, a CI job or a tool that acts as you. What each permission allows, where it reaches, and how to revoke it.
Tools
- The Playcode CLIThe playcode command - sign in through the browser, list projects, read files and run commands on a project's computer, publish, and call any operation.
- Connect Claude Code, Cursor or another MCP clientGive your coding agent Playcode's operations through MCP - run playcode mcp on your computer, or connect a client to Playcode's hosted server.
SDK
- The Playcode SDK@playcode/sdk for your app's backend: AI models, agents and a chat for your users, email, video and the Playcode API. Typed, no runtime dependencies.
- Call AI modelsplaycode.ai.generate() and stream(): text, typed data, images and PDFs, your functions as tools, and what a call costs, on the models Playcode offers your app.
- Build an agentplaycode.ai.agent(): a model that works in your app through your own functions - tools, how a run ends, its events, approvals and conversations.
- Agent controlsWhat an agent does by default and how to change it: hooks at every step, brakes, long conversations, fallback models, sub-agents and spending limits.
- Build a chat with the SDKA chat your users talk to: an agent with a store, the chat endpoint agent.handler(), and useAgentChat() for the page - each user with their own conversations.
- Durable runsAgent runs that survive a restart: start(), get(), cancel() and recover(), your own queue and event bus, the store over your database, and threads.
- Testing with the SDK@playcode/sdk/testing: test your app's AI with no network and no credits - a scripted model, recorded runs played back, and checks for your own store.
- SDK examplesWhat apps build with @playcode/sdk, with the code: read invoices, sort tickets, answer from your own data, hand refunds to a person, run weekly reports.
- Email, video, the API and webhooksplaycode.email.send(), playcode.media.video(), playcode.api for the Playcode API, and verifyWebhook() for the deliveries Playcode sends your app.
- SDK reference@playcode/sdk at a glance: its entry points, the client's options, every option of a call, an agent and a run, the events, the errors and the defaults.
Reference
- The APIOne GraphQL endpoint for every Playcode operation - how to call it, how operations are named and found, errors, consent and idempotency.
- WebhooksGet a signed POST on your server when something changes in your workspace. Add an endpoint, verify each delivery, and handle retries.
- ActivityEvery write in your workspace - who did it, when, through which door and to what. Read it on the Developers page or follow it through the API.
