diff --git a/src/content/docs/agents/model-context-protocol/mcp-agent-api.mdx b/src/content/docs/agents/model-context-protocol/mcp-agent-api.mdx index b8c79ec6a4cbbc2..d8069b37414bb26 100644 --- a/src/content/docs/agents/model-context-protocol/mcp-agent-api.mdx +++ b/src/content/docs/agents/model-context-protocol/mcp-agent-api.mdx @@ -12,8 +12,8 @@ When you build MCP Servers on Cloudflare, you extend the [`McpAgent` class](http ```ts title="src/index.ts" +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { McpAgent } from "agents/mcp"; -import { DurableMCP } from "@cloudflare/model-context-protocol"; export class MyMCP extends McpAgent { server = new McpServer({ name: "Demo", version: "1.0.0" }); @@ -46,6 +46,7 @@ But if you want your MCP server to: You can use the APIs below in order to do so. #### Hibernation Support + `McpAgent` instances automatically support [WebSockets Hibernation](/durable-objects/best-practices/websockets/#websocket-hibernation-api), allowing stateful MCP servers to sleep during inactive periods while preserving their state. This means your agents only consume compute resources when actively processing requests, optimizing costs while maintaining the full context and conversation history. ### State synchronization APIs diff --git a/src/content/docs/agents/model-context-protocol/tools.mdx b/src/content/docs/agents/model-context-protocol/tools.mdx index 5abe732eb9b76bf..47acd37beac8d81 100644 --- a/src/content/docs/agents/model-context-protocol/tools.mdx +++ b/src/content/docs/agents/model-context-protocol/tools.mdx @@ -9,7 +9,7 @@ import { Render, TypeScriptExample } from "~/components"; Model Context Protocol (MCP) tools are functions that a [MCP Server](/agents/model-context-protocol) provides and MCP clients can call. -When you build MCP Servers with the `@cloudflare/model-context-protocol` package, you can define tools the [same way as shown in the `@modelcontextprotocol/typescript-sdk` package's examples](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#tools). +When you build MCP Servers with the `agents` package, you can define tools the [same way as shown in the `@modelcontextprotocol/typescript-sdk` package's examples](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#tools). For example, the following code from [this example MCP server](https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server) defines a simple MCP server that adds two numbers together: