Skip to content

Commit d0b7804

Browse files
committed
Use <TypeScriptCode> block
1 parent bad7b92 commit d0b7804

File tree

1 file changed

+3
-1
lines changed
  • src/content/docs/agents/model-context-protocol

1 file changed

+3
-1
lines changed

src/content/docs/agents/model-context-protocol/tools.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ sidebar:
55
order: 3
66
---
77

8-
import { Render } from "~/components";
8+
import { Render, TypeScriptExample } from "~/components";
99

1010
Model Context Protocol (MCP) tools are functions that a [MCP Server](/agents/model-context-protocol) provides and MCP clients can call.
1111

1212
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).
1313

1414
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:
1515

16+
<TypeScriptExample>
1617
```ts title="src/index.ts"
1718
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
1819
import { DurableMCP } from "@cloudflare/model-context-protocol";
@@ -30,3 +31,4 @@ export class MyMCP extends DurableMCP {
3031
}
3132
}
3233
```
34+
</TypeScriptExample>

0 commit comments

Comments
 (0)