Skip to content

Commit 7c497c9

Browse files
Fix missing imports in MCP documentation examples (openai#1718)
Co-authored-by: Kazuhiro Sera <[email protected]>
1 parent cf11d33 commit 7c497c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/mcp.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ If the MCP server implements the HTTP with SSE transport, instantiate
185185
[`MCPServerSse`][agents.mcp.server.MCPServerSse]. Apart from the transport, the API is identical to the Streamable HTTP server.
186186

187187
```python
188+
189+
from agents import Agent, Runner
190+
from agents.model_settings import ModelSettings
191+
from mcp import MCPServerSse
192+
188193
workspace_id = "demo-workspace"
189194

190195
async with MCPServerSse(
@@ -212,6 +217,8 @@ proofs of concept or when the server only exposes a command line entry point.
212217

213218
```python
214219
from pathlib import Path
220+
from agents import Agent, Runner
221+
from agents.mcp import MCPServerStdio
215222

216223
current_dir = Path(__file__).parent
217224
samples_dir = current_dir / "sample_files"
@@ -298,6 +305,8 @@ methods:
298305
- `get_prompt(name, arguments)` fetches a concrete prompt, optionally with parameters.
299306

300307
```python
308+
from agents import Agent
309+
301310
prompt_result = await server.get_prompt(
302311
"generate_code_review_instructions",
303312
{"focus": "security vulnerabilities", "language": "python"},

0 commit comments

Comments
 (0)