Connect to external tools with MCP changedagent-sdk/mcp
Nearest release: v2.1.296, published 3 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 9 Oct 2026 20:45 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 9 Oct 2026 21:07 UTC.
Upstream edited
Recorded here
Lines+7added
Lines−3removed
From line
70
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits20to this page, all time
### Add a server in code ### Add a server from a config file ### In code ### From a config file
The whole hunk
from line 70, old and new numbered
/
from line 70
7070
7171You can configure MCP servers in code when calling `query()`, or in a `.mcp.json` file loaded via [`settingSources`](#from-a-config-file).
7272
73### In code
73<span id="in-code" />
7474
75### Add a server in code
76
7577Pass MCP servers directly in the `mcpServers` option. This example starts a local filesystem MCP server for `/Users/me/projects`. Replace that path with a directory on your machine:
7678
7779<CodeGroup>
from line 127
125127 ```
126128</CodeGroup>
127129
128### From a config file
130<span id="from-a-config-file" />
129131
132### Add a server from a config file
133
130134Create a `.mcp.json` file at your project root. The file is picked up when the `project` setting source is enabled, which it is for default `query()` options. If you set `settingSources` explicitly, include `"project"` for this file to load. Replace `/Users/me/projects` with a directory on your machine:
131135
132136```json theme={null}
from line 279
275279
276280### stdio servers
277281
278Local processes that communicate via stdin/stdout. Use this for MCP servers you run on the same machine. For the `.mcp.json` form, use the same fields shown at [From a config file](#from-a-config-file). In code, pass the command and its arguments. Replace `/Users/me/projects` with a directory on your machine:
282Local processes that communicate via stdin/stdout. Use this for MCP servers you run on the same machine. For the `.mcp.json` form, use the same fields shown at [Add a server from a config file](#from-a-config-file). In code, pass the command and its arguments. Replace `/Users/me/projects` with a directory on your machine:
279283
280284<CodeGroup>
281285 ```typescript TypeScript hidelines={1,-1} theme={null}
No line in this hunk matches that.