> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Replit MCP Server

> Connect your MCP client to Replit to create, update, and manage apps programmatically.

<Note>
  The Replit MCP Server is in **beta**. Tools and behavior may change.
</Note>

Replit's MCP server lets external clients create, update, and manage full-stack applications on Replit using the [Model Context Protocol](https://modelcontextprotocol.io). Powered by Replit Agent, it transforms natural language prompts into live, published apps.

## Server details

| Property           | Value                                                     |
| ------------------ | --------------------------------------------------------- |
| **URL**            | `https://replit-mcp.com/server/mcp`                       |
| **Transport**      | Streamable HTTP                                           |
| **Authentication** | OAuth 2.0 (handled automatically by MCP clients and SDKs) |

### Requirements

**For developers:**

* An MCP client or SDK that supports Streamable HTTP transport

**For builders (end users):**

* A Replit account (Free, Core, Pro, or Enterprise)

### Authentication

The server uses OAuth 2.1 with PKCE. MCP clients like Claude Code handle the entire flow automatically. If you're building with an MCP client SDK, it handles discovery, dynamic client registration, PKCE, and token exchange — you provide the UX (browser redirect, callback handler, token storage). See the [MCP authorization spec](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization) for details.

### Connecting

Configure the server URL in your MCP client. Builders will complete the OAuth consent flow when they first connect.

**MCP SDK (TypeScript):**

```typescript TypeScript (MCP SDK) theme={null}
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("https://replit-mcp.com/server/mcp"),
  { authProvider: yourOAuthProvider } // Implement the OAuthClientProvider interface
);

const client = new Client({ name: "my-client", version: "1.0.0" });
await client.connect(transport);
```

See the [MCP TypeScript SDK documentation](https://modelcontextprotocol.io/sdk/js) for details. The SDK handles the internal OAuth flow automatically.

**Claude Code:**

```bash Claude Code theme={null}
claude mcp add --transport http replit https://replit-mcp.com/server/mcp
```

***

## Use Replit from Claude

Replit is available as a connector inside Claude. Connect it once, and you can build on Replit without leaving your conversation with Claude.

### Connect the Replit connector

In Claude, open the connectors directory, find **Replit**, and connect it. Claude walks you through signing in to your Replit account. After you connect, you can ask Claude to create a new app, change an existing one, or answer questions about an app you're building. Claude relays your request to Replit Agent, which does the work and gives you a link to the live app.

<Tip>
  Ask Claude things like "Create a Replit app that tracks my weekly habits" or "Add a login page to my Replit app." Claude hands the request to Replit Agent and returns a link where you can watch it build.
</Tip>

### Send a design from Claude Design to Replit

When you create something in Claude Design, you can send it straight to Replit. Choose **Replit** as the destination, and your design opens in Replit as a runnable app. Agent then plans how to turn the static design into a working product, so you can keep building, add a database, and publish.

<Note>
  You don't need to download or re-upload anything. The handoff happens in one step, and the imported app starts running on its own.
</Note>

***

## Tools

The server exposes three public tools.

### `create_app_from_prompt`

Create a new Replit App from a natural language description. Replit Agent immediately starts building the app.

| Parameter              | Type           | Required | Description                                                                                                                                                                                    |
| ---------------------- | -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `appDescription`       | string         | Yes      | Natural language description of the app to build.                                                                                                                                              |
| `app_stack`            | string (enum)  | Yes      | One of: `"react_website"`, `"mobile_app"`, `"design"`, `"slides"`, `"animation"`, `"data_visualization"`, `"3d_game"`, `"document"`, `"spreadsheet"`. Use `"react_website"` for most web apps. |
| `userSpecifiedAppName` | string \| null | No       | App name if provided by the user.                                                                                                                                                              |
| `userQuotes`           | string \| null | No       | Exact user quotes not fully captured in `appDescription`.                                                                                                                                      |
| `attachmentSummary`    | string \| null | No       | Summary of essential details from attachments.                                                                                                                                                 |

**Response:**

```json theme={null}
{
  "phase": "creating",
  "replId": "d44d994b-96e1-4a1c-8085-88401b870a9a",
  "turnId": "turn-id",
  "replUrl": "https://replit.com/@username/App-Name",
  "user": { "id": 12345, "username": "username" }
}
```

Agent builds the app asynchronously — direct the builder to the `replUrl` to track progress. Use `replId` and `replUrl` in subsequent tool calls.

### `update_app_using_prompt`

Make changes to an existing Replit App. Use this to add features, fix bugs, or iterate on the app after it has been created.

| Parameter           | Type           | Required | Description                                            |
| ------------------- | -------------- | -------- | ------------------------------------------------------ |
| `replId`            | string (UUID)  | Yes      | The `replId` from `create_app_from_prompt`.            |
| `changeDescription` | string         | Yes      | Description of the change to make.                     |
| `replUrl`           | string         | No       | The `replUrl` from `create_app_from_prompt`.           |
| `userQuotes`        | string \| null | No       | Exact user quotes not captured in `changeDescription`. |
| `attachmentSummary` | string \| null | No       | Summary of attachment details.                         |

### `ask_question`

Ask Replit Agent about the current app. Runs in discussion mode — it won't modify the app. Use this to check build status, ask about the tech stack, or relay builders' questions.

| Parameter  | Type          | Required | Description                                 |
| ---------- | ------------- | -------- | ------------------------------------------- |
| `replId`   | string (UUID) | Yes      | The `replId` from `create_app_from_prompt`. |
| `question` | string        | Yes      | The question to send to Replit Agent.       |

***

## Troubleshooting

| Error                                             | Cause                                                                                                | Fix                                                                                                                                                                |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `MCP error -32001: Request timed out`             | Tool call took longer than the MCP timeout window. The operation is still running in the background. | Direct the user to the `replUrl`. Do not retry.                                                                                                                    |
| `"Replit was not able to build your Replit App."` | Access token is not scoped to the MCP server resource.                                               | Verify your auth provider is configured correctly. If building a custom OAuth flow, ensure the `resource` parameter is set to `https://replit-mcp.com/server/mcp`. |
| `"Not authenticated"`                             | No valid session or token.                                                                           | Re-authenticate through the OAuth flow.                                                                                                                            |
