Connect to external tools with MCP changedagent-sdk/mcp
Nearest release: v2.1.238, published an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+31added
Lines−52removed
From line
300
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits20to this page, all time
The whole hunk
from line 300, old and new numbered
/
from line 300
300300
301301### HTTP/SSE servers
302302
303Use HTTP or SSE for cloud-hosted MCP servers and remote APIs:
303Use HTTP or SSE for cloud-hosted MCP servers and remote APIs. For the `.mcp.json` form, use the same fields as the example at [HTTP headers for remote servers](#http-headers-for-remote-servers), with `"type": "sse"` for an SSE server. In code, pass the server's URL:
304304
305<Tabs>
306 <Tab title="In code">
307 <CodeGroup>
308 ```typescript TypeScript hidelines={1,-1} theme={null}
309 const _ = {
310 options: {
311 mcpServers: {
312 "remote-api": {
313 type: "sse",
314 url: "https://api.example.com/mcp/sse",
315 headers: {
316 Authorization: `Bearer ${process.env.API_TOKEN}`
317 }
318 }
319 },
320 allowedTools: ["mcp__remote-api__*"]
321 }
322 };
323 ```
324
325 ```python Python theme={null}
326 options = ClaudeAgentOptions(
327 mcp_servers={
328 "remote-api": {
329 "type": "sse",
330 "url": "https://api.example.com/mcp/sse",
331 "headers": {"Authorization": f"Bearer {os.environ['API_TOKEN']}"},
332 }
333 },
334 allowed_tools=["mcp__remote-api__*"],
335 )
336 ```
337 </CodeGroup>
338 </Tab>
339
340 <Tab title=".mcp.json">
341 ```json theme={null}
342 {
343 "mcpServers": {
305<CodeGroup>
306 ```typescript TypeScript hidelines={1,-1} theme={null}
307 const _ = {
308 options: {
309 mcpServers: {
344310 "remote-api": {
345 "type": "sse",
346 "url": "https://api.example.com/mcp/sse",
347 "headers": {
348 "Authorization": "Bearer ${API_TOKEN}"
311 type: "sse",
312 url: "https://api.example.com/mcp/sse",
313 headers: {
314 Authorization: `Bearer ${process.env.API_TOKEN}`
349315 }
350316 }
351 }
317 },
318 allowedTools: ["mcp__remote-api__*"]
352319 }
353 ```
354 </Tab>
355</Tabs>
320 };
321 ```
356322
323 ```python Python theme={null}
324 options = ClaudeAgentOptions(
325 mcp_servers={
326 "remote-api": {
327 "type": "sse",
328 "url": "https://api.example.com/mcp/sse",
329 "headers": {"Authorization": f"Bearer {os.environ['API_TOKEN']}"},
330 }
331 },
332 allowed_tools=["mcp__remote-api__*"],
333 )
334 ```
335</CodeGroup>
336
357337For the streamable HTTP transport, use `"type": "http"` instead. In `.mcp.json` and other JSON config files, `"streamable-http"` is accepted as an alias for `"http"`. The programmatic `mcpServers` option accepts only `"http"`.
358338
359339### SDK MCP servers
from line 850
870850
871851### Tool output exceeds maximum allowed tokens
872852
873The SDK applies the same MCP output limit as Claude Code. When a tool result is larger than 25,000 tokens, the full output is saved to a file and the tool result is replaced with an error message that names the file path, so the agent can read the output back in portions. Raise the limit with the [`MAX_MCP_OUTPUT_TOKENS`](/docs/en/env-vars) environment variable. See [MCP output limits and warnings](/docs/en/mcp#mcp-output-limits-and-warnings) for the full behavior, including how a server can declare a higher per-tool limit.
853The SDK applies the same MCP output limit as Claude Code. When a tool result is larger than 25,000 tokens, the full output is saved to a file and the tool result is replaced with an error message that names the file path, so the agent can read the output back in portions. Raise the limit with the [`MAX_MCP_OUTPUT_TOKENS`](/docs/en/env-vars) environment variable. See [MCP output limits and warnings](/docs/en/mcp#mcp-output-limits-and-warnings) for the full behavior, including how a server can declare a higher per-tool limit with the `anthropic/maxResultSizeChars` annotation.
874854
875855## Related resources
876856
877857* **[Custom tools guide](/docs/en/agent-sdk/custom-tools)**: Build your own MCP server that runs in-process with your SDK application
878858* **[Permissions](/docs/en/agent-sdk/permissions)**: Control which MCP tools your agent can use with `allowedTools` and `disallowedTools`
879* **[MCP output limits and warnings](/docs/en/mcp#mcp-output-limits-and-warnings)**: How the SDK handles tool results that exceed `MAX_MCP_OUTPUT_TOKENS`, including the persist-to-disk fallback and the `anthropic/maxResultSizeChars` per-tool annotation
880859* **[TypeScript SDK reference](/docs/en/agent-sdk/typescript)**: Full API reference including MCP configuration options
881860* **[Python SDK reference](/docs/en/agent-sdk/python)**: Full API reference including MCP configuration options
882861* **[MCP server directory](https://github.com/modelcontextprotocol/servers)**: Browse available MCP servers for databases, APIs, and more
No line in this hunk matches that.