> ## 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サーバー

> MCPクライアントをReplitに接続して、プログラムでアプリを作成・更新・管理します。

<Note>
  Replit MCPサーバーは**ベータ版**です。ツールと動作は変更される可能性があります。
</Note>

ReplitのMCPサーバーは、外部クライアントが[Model Context Protocol](https://modelcontextprotocol.io)を使用してReplit上でフルスタックアプリケーションを作成・更新・管理できるようにします。Replit Agentを活用し、自然言語プロンプトを実際に動作するデプロイ済みアプリに変換します。

このページは独自のMCPクライアントを接続するための開発者リファレンスです。すでに使用しているツールからReplitを使いたいですか？[ClaudeでのReplit](/references/platforms/claude)、[SlackでのReplit](/references/platforms/slack)、または[ChatGPTでのReplit](/references/platforms/chatgpt)をご覧ください。

## サーバーの詳細

| プロパティ       | 値                                   |
| ----------- | ----------------------------------- |
| **URL**     | `https://replit-mcp.com/server/mcp` |
| **トランスポート** | Streamable HTTP                     |
| **認証**      | OAuth 2.0（MCPクライアントとSDKが自動処理）       |

### 要件

**開発者向け：**

* Streamable HTTPトランスポートをサポートするMCPクライアントまたはSDK

**ビルダー（エンドユーザー）向け：**

* Replitアカウント（Free、Core、Pro、またはEnterprise）

### 認証

サーバーはPKCEを使用したOAuth 2.1を採用しています。Claude CodeなどのMCPクライアントは、フロー全体を自動的に処理します。MCPクライアントSDKで開発する場合、SDKがディスカバリー、動的クライアント登録、PKCE、トークン交換を処理します。UX（ブラウザリダイレクト、コールバックハンドラー、トークンストレージ）は開発者が提供します。詳細は[MCP認証仕様](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization)を参照してください。

### 接続方法

MCPクライアントにサーバーURLを設定します。ビルダーは初回接続時にOAuthの同意フローを完了します。

**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 } // OAuthClientProviderインターフェースを実装してください
);

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

詳細は[MCP TypeScript SDKドキュメント](https://modelcontextprotocol.io/sdk/js)を参照してください。SDKは内部のOAuthフローを自動的に処理します。

**Claude Code：**

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

***

## ツール

サーバーは3つの公開ツールを提供します。

### `create_app_from_prompt`

自然言語の説明から新しいReplitアプリを作成します。Replit Agentはすぐにアプリのビルドを開始します。

| パラメーター                 | 型              | 必須  | 説明                                                                                                                                                                              |
| ---------------------- | -------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `appDescription`       | string         | はい  | ビルドするアプリの自然言語による説明。                                                                                                                                                             |
| `app_stack`            | string (enum)  | はい  | 以下のいずれか：`"react_website"`、`"mobile_app"`、`"design"`、`"slides"`、`"animation"`、`"data_visualization"`、`"3d_game"`、`"document"`、`"spreadsheet"`。ほとんどのWebアプリには`"react_website"`を使用。 |
| `userSpecifiedAppName` | string \| null | いいえ | ユーザーが指定したアプリ名。                                                                                                                                                                  |
| `userQuotes`           | string \| null | いいえ | `appDescription`に完全に含まれていないユーザーの正確な引用。                                                                                                                                          |
| `attachmentSummary`    | string \| null | いいえ | 添付ファイルの重要な詳細情報の要約。                                                                                                                                                              |

**レスポンス：**

```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はアプリを非同期にビルドします。進捗状況を確認するには、ビルダーを`replUrl`に誘導してください。後続のツール呼び出しでは`replId`と`replUrl`を使用します。

### `update_app_using_prompt`

既存のReplitアプリに変更を加えます。アプリが作成された後、機能の追加、バグの修正、反復的な改善に使用します。

| パラメーター              | 型              | 必須  | 説明                                     |
| ------------------- | -------------- | --- | -------------------------------------- |
| `replId`            | string (UUID)  | はい  | `create_app_from_prompt`からの`replId`。   |
| `changeDescription` | string         | はい  | 行う変更の説明。                               |
| `replUrl`           | string         | いいえ | `create_app_from_prompt`からの`replUrl`。  |
| `userQuotes`        | string \| null | いいえ | `changeDescription`に含まれていないユーザーの正確な引用。 |
| `attachmentSummary` | string \| null | いいえ | 添付ファイルの詳細情報の要約。                        |

### `ask_question`

現在のアプリについてReplit Agentに質問します。ディスカッションモードで実行され、アプリを変更しません。ビルドステータスの確認、技術スタックについての質問、ビルダーの質問の中継に使用します。

| パラメーター     | 型             | 必須 | 説明                                   |
| ---------- | ------------- | -- | ------------------------------------ |
| `replId`   | string (UUID) | はい | `create_app_from_prompt`からの`replId`。 |
| `question` | string        | はい | Replit Agentに送信する質問。                 |

***

## トラブルシューティング

| エラー                                               | 原因                                        | 対処法                                                                                                                  |
| ------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `MCP error -32001: Request timed out`             | ツール呼び出しがMCPのタイムアウト時間を超えた。操作はバックグラウンドで実行中。 | ユーザーを`replUrl`に誘導する。再試行しないこと。                                                                                        |
| `"Replit was not able to build your Replit App."` | アクセストークンがMCPサーバーリソースにスコープされていない。          | 認証プロバイダーが正しく設定されているか確認する。カスタムOAuthフローを構築している場合は、`resource`パラメーターが`https://replit-mcp.com/server/mcp`に設定されていることを確認する。 |
| `"Not authenticated"`                             | 有効なセッションまたはトークンがない。                       | OAuthフローで再認証する。                                                                                                      |
