Skip to content

Commit 7bc369a

Browse files
committed
Give more clarity to MCP docs and improve ja translation
1 parent 6e1d67d commit 7bc369a

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

docs/src/content/docs/guides/mcp.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The [**Model Context Protocol (MCP)**](https://modelcontextprotocol.io) is an op
1717
1818
There are three types of MCP servers this SDK supports:
1919

20-
1. **Hosted MCPserver tools** – remote MCP servers used as tools by the [OpenAI Responses API](https://platform.openai.com/docs/guides/tools-remote-mcp)
20+
1. **Hosted MCP server tools** – remote MCP servers used as tools by the [OpenAI Responses API](https://platform.openai.com/docs/guides/tools-remote-mcp)
2121
2. **Streamable HTTP MCP servers** – local or remote servers that implement the [Streamable HTTP transport](https://modelcontextprotocol.io/docs/concepts/transports#streamable-http)
2222
3. **Stdio MCP servers** – servers accessed via standard input/output (the simplest option)
2323

@@ -28,7 +28,7 @@ Choose a server type based on your use‑case:
2828
| Call publicly accessible remote servers with default OpenAI responses models | **1. Hosted MCP tools** |
2929
| Use publicly accessible remote servers but have the tool calls triggered locally | **2. Streamable HTTP** |
3030
| Use locally running Streamable HTTP servers | **2. Streamable HTTP** |
31-
| Use any Streamable HTTP servers with non-OpenAI Responses models | **2. Streamable HTTP** |
31+
| Use any Streamable HTTP servers with non-OpenAI-Responses models | **2. Streamable HTTP** |
3232
| Work with local MCP servers that only support the standard-I/O protocol | **3. Stdio** |
3333

3434
## 1. Hosted MCP server tools
@@ -67,7 +67,7 @@ If you can programatically determine whether a tool call is safe, you can use th
6767
title="Human in the loop with hosted MCP tools"
6868
/>
6969

70-
Fully working samples (streaming, approval, HITL) are [examples/mcp](https://github.com/openai/openai-agents-js/tree/main/examples/mcp) in our GitHub repository.
70+
Fully working samples (Hosted tools/Streamable HTTP/stdio + Streaming, HITL, onApproval) are [examples/mcp](https://github.com/openai/openai-agents-js/tree/main/examples/mcp) in our GitHub repository.
7171

7272
## 2. Streamable HTTP MCP servers
7373

docs/src/content/docs/ja/guides/mcp.mdx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,43 @@ import hostedHITLExample from '../../../../../../examples/docs/mcp/hostedHITL.ts
1111
import streamableHttpExample from '../../../../../../examples/docs/mcp/streamableHttp.ts?raw';
1212
import stdioExample from '../../../../../../examples/docs/mcp/stdio.ts?raw';
1313

14-
[**Model Context Protocol (MCP)**](https://modelcontextprotocol.io) は、アプリケーションが LLM にツールとコンテキストを提供する方法を標準化するオープンプロトコルです。MCP ドキュメントより引用します
14+
[** Model Context Protocol ( MCP ) **](https://modelcontextprotocol.io) は、アプリケーションが LLM にツールとコンテキストを提供する方法を標準化するオープンプロトコルです。MCP ドキュメントでは次のように説明されています
1515

16-
> MCP は、アプリケーションが LLM にコンテキストを提供する方法を標準化するオープンプロトコルです。MCP AI アプリケーション向けの USB-C ポートのようなものと考えてください。USB-C がデバイスをさまざまな周辺機器やアクセサリーに接続するための標準化された方法を提供するのと同様に、MCP は AI モデルをさまざまなデータソースやツールに接続するための標準化された方法を提供します
16+
> MCP は、アプリケーションが LLM にコンテキストを提供する方法を標準化するオープンプロトコルです。MCP AI アプリケーション向けの USB-C ポートと考えてください。USB-C がデバイスをさまざまな周辺機器に接続するための標準化された方法を提供するのと同様に、MCP は AI モデルを複数のデータソースやツールに接続するための標準化された方法を提供します
1717
18-
この SDK がサポートする MCP サーバーには次の 3 種類があります
18+
この SDK がサポートする MCP サーバーは次の 3 種類です
1919

20-
1. **Hosted MCP-server tools**[OpenAI Responses API](https://platform.openai.com/docs/guides/tools-remote-mcp) によりツールとして呼び出されるリモート MCP サーバー
21-
2. **Streamable HTTP MCP サーバー**[Streamable HTTP transport](https://modelcontextprotocol.io/docs/concepts/transports#streamable-http) を実装したローカルまたはリモートサーバー
22-
3. **Stdio MCP サーバー** – 標準入力/出力経由でアクセスするサーバー(もっともシンプル
20+
1. **リモート MCP サーバーツール(Hosted)**[OpenAI Responses API](https://platform.openai.com/docs/guides/tools-remote-mcp) がツールとして利用するリモート MCP サーバー
21+
2. **Streamable HTTP MCP サーバー**[Streamable HTTP トランスポート](https://modelcontextprotocol.io/docs/concepts/transports#streamable-http) を実装したローカルまたはリモートサーバー
22+
3. **Stdio MCP サーバー** – 標準入力 / 出力経由でアクセスするサーバー(最もシンプルなオプション
2323

2424
ユースケースに応じてサーバータイプを選択してください。
2525

26-
| 必要なこと | 推奨オプション |
27-
| ---------------------------------------------------------------------------------------- | ----------------------- |
28-
| 公開アクセス可能なリモートサーバーを、デフォルトの OpenAI Responses モデルで呼び出したい | **1. Hosted MCP tools** |
29-
| 公開アクセス可能なリモートサーバーを使用しつつ、ツール呼び出しをローカルでトリガーしたい | **2. Streamable HTTP** |
30-
| ローカルで動作する Streamable HTTP サーバーを使用したい | **2. Streamable HTTP** |
31-
| OpenAI 以外の Responses モデルと組み合わせて任意の Streamable HTTP サーバーを使いたい | **2. Streamable HTTP** |
32-
| 標準 I/O プロトコルのみをサポートするローカル MCP サーバーと連携したい | **3. Stdio** |
26+
| 必要なもの | 推奨オプション |
27+
| -------------------------------------------------------------------------------------------- | -------------------------------------------- |
28+
| 公開アクセス可能なリモートサーバーを既定の OpenAI Responses モデルで呼び出したい | **1. リモート MCP サーバーツール(Hosted)** |
29+
| 公開アクセス可能なリモートサーバーを利用するが、ツール呼び出し自体はローカルでトリガーしたい | **2. Streamable HTTP** |
30+
| ローカルで動作する Streamable HTTP サーバーを利用したい | **2. Streamable HTTP** |
31+
| OpenAI Responses 以外のモデルで任意の Streamable HTTP サーバーを利用したい | **2. Streamable HTTP** |
32+
| 標準 I/O プロトコルのみをサポートするローカル MCP サーバーを利用したい | **3. Stdio** |
3333

34-
## 1. Hosted MCP サーバーツール
34+
## 1. リモート MCP サーバーツール(Hosted)
3535

36-
Hosted tool では、往復すべてがモデル内部で完結します。あなたのコードが MCP サーバーを呼び出す代わりに、OpenAI Responses API がリモートツールのエンドポイントを呼び出し、その結果をストリームでモデルに返します
36+
Hosted ツールでは、往復処理をすべてモデル内部で完結させます。コードから MCP サーバーを呼び出す代わりに、OpenAI Responses API がリモートツールのエンドポイントを呼び出し、その結果をストリーミングでモデルに返します
3737

38-
Hosted MCP サーバーツールを使うもっともシンプルな例を示します`hostedMcpTool` ユーティリティ関数にリモート MCP サーバーのラベルと URL を渡すだけで作成できます
38+
Hosted MCP ツールを利用する最も簡単な例を以下に示します`hostedMcpTool` ユーティリティ関数にリモート MCP サーバーのラベルと URL を渡して、Hosted MCP サーバーツールを作成します
3939

4040
<Code lang="typescript" code={hostedAgentExample} title="hostedAgent.ts" />
4141

42-
続いて`run` 関数(またはカスタマイズした `Runner` インスタンスの `run` メソッド)でエージェントを実行します。
42+
次に`run` 関数(またはカスタマイズした `Runner` インスタンスの `run` メソッド)でエージェントを実行します。
4343

4444
<Code
4545
lang="typescript"
4646
code={hostedExample}
4747
title="Run with hosted MCP tools"
4848
/>
4949

50-
MCP の増分結果をストリーミングする場合は`Agent` を実行するときに `stream: true` を渡してください
50+
増分的な MCP 実行結果をストリームで受け取りたい場合は`Agent` を実行するときに `stream: true` を渡します
5151

5252
<Code
5353
lang="typescript"
@@ -57,47 +57,47 @@ MCP の増分結果をストリーミングする場合は、`Agent` を実行
5757

5858
#### オプションの承認フロー
5959

60-
機微な操作の場合、個々のツール呼び出しに人間の承認を必須にできます`requireApproval: 'always'` を渡すか、ツール名ごとに `'never'` / `'always'` を指定するオブジェクトを渡してください
60+
機微な操作に対しては、個々のツール呼び出しに人間の承認を要求できます`requireApproval: 'always'` を渡すか、ツール名ごとに `'never'` / `'always'` を指定する詳細オブジェクトを渡してください
6161

62-
ツール呼び出しが安全かどうかをプログラム的に判断できる場合は[`onApproval` コールバック](https://github.com/openai/openai-agents-js/blob/main/examples/mcp/hosted-mcp-on-approval.ts) を使って承認または拒否できます。人間の承認が必要な場合は、ローカルの関数ツールと同様に `interruptions` を使用した [人間の介入(HITL)](/openai-agents-js/ja/guides/human-in-the-loop/) のアプローチが利用できます
62+
ツール呼び出しが安全かどうかをプログラムで判断できる場合は[`onApproval` コールバック](https://github.com/openai/openai-agents-js/blob/main/examples/mcp/hosted-mcp-on-approval.ts) を使って承認または拒否できます。人間の承認が必要な場合は、ローカル関数ツールと同じく `interruptions` を使った [人間の介入(HITL)](/openai-agents-js/ja/guides/human-in-the-loop/) の手法を利用できます
6363

6464
<Code
6565
lang="typescript"
6666
code={hostedHITLExample}
6767
title="Human in the loop with hosted MCP tools"
6868
/>
6969

70-
ストリーミング、承認、HITL を含む完全な動作例は GitHub リポジトリの [examples/mcp](https://github.com/openai/openai-agents-js/tree/main/examples/mcp) にあります。
70+
完全な動作例(Hosted ツール / Streamable HTTP / stdio + Streaming, HITL, onApproval)は GitHub リポジトリの [examples/mcp](https://github.com/openai/openai-agents-js/tree/main/examples/mcp) にあります。
7171

7272
## 2. Streamable HTTP MCP サーバー
7373

74-
エージェントがローカルまたはリモートの Streamable HTTP MCP サーバーと直接通信する場合は、サーバーの `url``name`、オプション設定を指定して `MCPServerStreamableHttp` を生成します
74+
エージェントがローカルまたはリモートの Streamable HTTP MCP サーバーに直接接続する場合は、サーバーの `url``name` と任意の設定を渡して `MCPServerStreamableHttp` をインスタンス化します
7575

7676
<Code
7777
lang="typescript"
7878
code={streamableHttpExample}
7979
title="Run with Streamable HTTP MCP servers"
8080
/>
8181

82-
コンストラクターでは `authProvider`, `requestInit`, `reconnectionOptions`, `sessionId` など、MCP TypeScript SDK の追加オプションも指定できます。詳細は [MCP TypeScript SDK リポジトリ](https://github.com/modelcontextprotocol/typescript-sdk) とそのドキュメントをご覧ください
82+
コンストラクタは `authProvider``requestInit``reconnectionOptions``sessionId` などの MCP TypeScript-SDK 追加オプションも受け取ります。詳細は [MCP TypeScript SDK リポジトリ](https://github.com/modelcontextprotocol/typescript-sdk) のドキュメントを参照してください
8383

8484
## 3. Stdio MCP サーバー
8585

86-
標準 I/O のみを公開するサーバーには`fullCommand` を指定して `MCPServerStdio` を生成します
86+
標準 I/O だけを公開しているサーバーには`fullCommand` を渡して `MCPServerStdio` をインスタンス化します
8787

8888
<Code
8989
lang="typescript"
9090
code={stdioExample}
9191
title="Run with Stdio MCP servers"
9292
/>
9393

94-
## 知っておくべきその他のポイント
94+
## その他のポイント
9595

96-
**Streamable HTTP** および **Stdio** サーバーの場合、`Agent` は実行のたびに利用可能なツールを確認するため `list_tools()` を呼び出すことがあります。この往復は、特にリモートサーバーではレイテンシーを増やす可能性があります。ツールリストが変わらないと確信できる場合は`MCPServerStdio` または `MCPServerStreamableHttp``cacheToolsList: true` を渡して結果をメモリにキャッシュできます
96+
**Streamable HTTP** および **Stdio** サーバーの場合、`Agent` が実行されるたびに使用可能なツールを確認するために `list_tools()` を呼び出すことがあります。この往復処理は、特にリモートサーバーではレイテンシーを増加させるため`MCPServerStdio` または `MCPServerStreamableHttp``cacheToolsList: true` を渡すことで結果をメモリにキャッシュできます
9797

98-
後からキャッシュを無効化したい場合は、サーバーインスタンスの `invalidateToolsCache()` を呼び出してください
98+
ツール一覧が変更されないと確信できる場合にのみ有効化してください。後でキャッシュを無効化するには、サーバーインスタンスの `invalidateToolsCache()` を呼び出します
9999

100-
## 参考文献
100+
## さらに学ぶ
101101

102102
- [Model Context Protocol](https://modelcontextprotocol.io/) – 公式仕様
103103
- [examples/mcp](https://github.com/openai/openai-agents-js/tree/main/examples/mcp) – 上記で参照した実行可能デモ

docs/src/scripts/translate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ const engToNonEngMapping: Record<string, Record<string, string>> = {
168168
'TypeScript-first': 'TypeScript ファースト',
169169
'Human in the loop': 'Human in the loop (人間の介入)',
170170
'Hosted tool': '組み込みツール(Hosted)',
171+
'Hosted MCP server tools': 'リモート MCP サーバーツール(Hosted)',
171172
raw: '元',
172173
},
173174
};

0 commit comments

Comments
 (0)