Skip to content

Commit a31d23b

Browse files
committed
fix indentation (of course)
1 parent 35fa537 commit a31d23b

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Build MCP servers with the Agents SDK
33
description: The Agents SDK now includes built-in support for building remote MCP servers directly as part of your Agent.
4-
- agents
4+
- agents
55
- workers
66
date: 2025-04-07T13:00:00Z
77
---
88

9-
import { Render, PackageManagers, TypeScriptExample } from "~/components"
9+
import { Render, PackageManagers, TypeScriptExample } from "~/components";
1010

1111
The Agents SDK now includes built-in support for building remote MCP (Model Context Protocol) servers directly as part of your Agent. This allows you to easily create and manage MCP servers, without the need for additional infrastructure or configuration.
1212

@@ -16,25 +16,25 @@ The SDK includes a new `MCPAgent` class that extends the `Agent` class and allow
1616

1717
```ts
1818
export class MyMCP extends McpAgent<Env> {
19-
server = new McpServer({
20-
name: "Demo",
21-
version: "1.0.0",
22-
});
23-
24-
async init() {
25-
this.server.resource(`counter`, `mcp://resource/counter`, (uri) => {
26-
// ...
27-
});
28-
29-
this.server.tool(
30-
"add",
31-
"Add two numbers together",
32-
{ a: z.number(), b: z.number() },
33-
async ({ a, b }) => {
34-
// ...
35-
}
36-
);
37-
}
19+
server = new McpServer({
20+
name: "Demo",
21+
version: "1.0.0",
22+
});
23+
24+
async init() {
25+
this.server.resource(`counter`, `mcp://resource/counter`, (uri) => {
26+
// ...
27+
});
28+
29+
this.server.tool(
30+
"add",
31+
"Add two numbers together",
32+
{ a: z.number(), b: z.number() },
33+
async ({ a, b }) => {
34+
// ...
35+
},
36+
);
37+
}
3838
}
3939
```
4040

@@ -48,15 +48,15 @@ To learn more, review the [announcement blog](https://blog.cloudflare.com/buildi
4848

4949
We've made a number of improvements to the [Agents SDK](/agents/), including:
5050

51-
* Support for building MCP servers with the new `MCPAgent` class.
52-
* The ability to export the current agent, request and WebSocket connection context using `import { context } from "agents"`, allowing you to minimize or avoid direct dependency injection when calling tools.
53-
* Fixed a bug that prevented query parameters from being sent to the Agent server from the `useAgent` React hook.
54-
* Automatically converting the `agent` name in `useAgent` or `useAgentChat` to kebab-case to ensure it matches the naming convention expected by [`routeAgentRequest`](/agents/api-reference/calling-agents/#calling-your-agent).
51+
- Support for building MCP servers with the new `MCPAgent` class.
52+
- The ability to export the current agent, request and WebSocket connection context using `import { context } from "agents"`, allowing you to minimize or avoid direct dependency injection when calling tools.
53+
- Fixed a bug that prevented query parameters from being sent to the Agent server from the `useAgent` React hook.
54+
- Automatically converting the `agent` name in `useAgent` or `useAgentChat` to kebab-case to ensure it matches the naming convention expected by [`routeAgentRequest`](/agents/api-reference/calling-agents/#calling-your-agent).
5555

5656
To install or update the Agents SDK, run `npm i agents@latest` in an existing project, or explore the `agents-starter` project:
5757

5858
```sh
5959
npm create cloudflare@latest -- --template cloudflare/agents-starter
6060
```
6161

62-
See the full release notes and changelog [on the Agents SDK repository](https://github.com/cloudflare/agents/blob/main/packages/agents/CHANGELOG.md) and
62+
See the full release notes and changelog [on the Agents SDK repository](https://github.com/cloudflare/agents/blob/main/packages/agents/CHANGELOG.md) and

0 commit comments

Comments
 (0)