Skip to content

Commit c58405c

Browse files
committed
Add wrangler configuration section to MCP server docs
1 parent af2e177 commit c58405c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/content/docs/agents/examples/build-mcp-server.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ npx create-cloudflare@latest my-mcp-worker
4949
cd my-mcp-worker
5050
```
5151

52+
### Configure your wrangler file
53+
54+
When you run the setup command, it will build your Worker using the configuration in your wrangler.toml or wrangler.jsonc file. By default, no additional configuration is needed, but if you have multiple Cloudflare accounts, you'll need to specify your account ID as shown below.
55+
56+
<WranglerConfig>
57+
```toml
58+
name = "my-mcp-worker"
59+
main = "src/index.ts"
60+
compatibility_date = "2025-03-03"
61+
account_id = "your-account-id"
62+
```
63+
</WranglerConfig>
64+
5265
### Install the MCP tooling
5366
Inside your project directory, install the [workers-mcp](https://github.com/cloudflare/workers-mcp) package:
5467

@@ -71,7 +84,7 @@ This guided installation process takes a brand new or existing Workers project a
7184
- Installs a local proxy so you can access it from your MCP desktop clients (like Claude Desktop)
7285

7386
### Set up the MCP Server
74-
Replace the contents of your src/index.ts with the following boilerplate code:
87+
The setup command will automatically update your src/index.ts with the following code:
7588

7689
```ts
7790
import { WorkerEntrypoint } from 'cloudflare:workers';

0 commit comments

Comments
 (0)