Debugging changeddocs/draft/tools/debugging
Upstream edited this page at 11 Oct 2026 04:39 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 20 Oct 2026 20:07 UTC.
Upstream edited
Recorded here
Lines+57added
Lines−65removed
From line
33
where the diff opens
First seen
26 Aug 2026
this site's first read of the page
Recorded edits3to this page, all time
The whole hunk
from line 33, old and new numbered
/
from line 33
3333logged to stderr (standard error) will be captured by the host application
3434automatically.
3535
36<Warning>
37 Local MCP servers should not log messages to stdout (standard out), as this
38 will interfere with protocol operation.
39</Warning>
36> [!WARNING]
37>
38> Local MCP servers should not log messages to stdout (standard out), as this
39> will interfere with protocol operation.
4040
4141For servers using the
4242[Streamable HTTP transport](/specification/draft/basic/transports/streamable-http),
from line 45
4545tooling (curl, browser DevTools Network panel) to inspect requests and SSE
4646streams.
4747
48<Warning>
49 The `notifications/message` mechanism below is deprecated as of protocol
50 version `2026-07-28`. It remains available during the deprecation window.
51</Warning>
48> [!WARNING]
49>
50> The `notifications/message` mechanism below is deprecated as of protocol
51> version `2026-07-28`. It remains available during the deprecation window.
5252
5353For all [transports](/specification/latest/basic/transports), record what the
5454server is doing as it runs:
5555
56<CodeGroup>
57 ```python Python theme={null}
58 import logging
56```python Python theme={null}
57import logging
5958
60 from mcp.server import MCPServer
59from mcp.server import MCPServer
6160
62 logger = logging.getLogger(__name__)
61logger = logging.getLogger(__name__)
6362
64 mcp = MCPServer("reports")
63mcp = MCPServer("reports")
6564
6665
67 @mcp.tool()
68 async def fetch_report(report_id: str) -> str:
69 """Fetch a report by id."""
70 logger.info("Fetching report %s", report_id)
71 return f"Report {report_id} is ready."
72 ```
66@mcp.tool()
67async def fetch_report(report_id: str) -> str:
68 """Fetch a report by id."""
69 logger.info("Fetching report %s", report_id)
70 return f"Report {report_id} is ready."
71```
7372
74 ```typescript TypeScript theme={null}
75 await server.sendLoggingMessage({
76 level: "info",
77 data: "Server started successfully",
78 });
79 ```
80</CodeGroup>
73```typescript TypeScript theme={null}
74await server.sendLoggingMessage({
75 level: "info",
76 data: "Server started successfully",
77});
78```
8179
8280MCP defines eight
8381[RFC 5424 severity levels](/specification/latest/server/utilities/logging#log-levels)
from line 209
211209hover over the **Connectors** menu to see connected servers and available
212210tools.
213211
214<img src="https://mintcdn.com/mcp/zNouQwo2h8cbxlDS/images/available-mcp-tools.png?fit=max&auto=format&n=zNouQwo2h8cbxlDS&q=85&s=e2ace1ac88895a5fe30ebd8d01456bc3" alt="Available MCP tools" width="437" height="244" data-path="images/available-mcp-tools.png" />
212
215213
216214### Viewing logs
217215
from line 218
220218* macOS: `~/Library/Logs/Claude`
221219* Windows: `%APPDATA%\Claude\logs`
222220
223<CodeGroup>
224 ```bash macOS theme={null}
225 tail -n 20 -F ~/Library/Logs/Claude/mcp*.log
226 ```
221```bash macOS theme={null}
222tail -n 20 -F ~/Library/Logs/Claude/mcp*.log
223```
227224
228 ```powershell Windows theme={null}
229 type "$env:AppData\Claude\logs\mcp*.log"
230 ```
231</CodeGroup>
225```powershell Windows theme={null}
226type "$env:AppData\Claude\logs\mcp*.log"
227```
232228
233229The logs capture:
234230
from line 240
244240
2452411. Create a `developer_settings.json` file with `allowDevTools` set to true:
246242
247<CodeGroup>
248 ```bash macOS theme={null}
249 echo '{"allowDevTools": true}' > ~/Library/Application\ Support/Claude/developer_settings.json
250 ```
243```bash macOS theme={null}
244echo '{"allowDevTools": true}' > ~/Library/Application\ Support/Claude/developer_settings.json
245```
251246
252 ```powershell Windows theme={null}
253 '{"allowDevTools": true}' | Set-Content "$env:AppData\Claude\developer_settings.json"
254 ```
255</CodeGroup>
247```powershell Windows theme={null}
248'{"allowDevTools": true}' | Set-Content "$env:AppData\Claude\developer_settings.json"
249```
256250
2572512. Open DevTools: `Command-Option-I` (macOS) or `Ctrl+Alt+I` (Windows)
258252
from line 347
353347
354348## Next steps
355349
356<CardGroup cols={2}>
357 <Card title="MCP Inspector" icon="magnifying-glass" href="/docs/draft/tools/inspector">
358 Learn to use the MCP Inspector
359 </Card>
350> **[MCP Inspector](/docs/draft/tools/inspector)**
351>
352> Learn to use the MCP Inspector
360353
361 <Card title="Build an MCP server" icon="code" href="/docs/draft/develop/build-server">
362 Walk through building a server from scratch
363 </Card>
354> **[Build an MCP server](/docs/draft/develop/build-server)**
355>
356> Walk through building a server from scratch
364357
365 <Card title="Connect local servers" icon="plug" href="/docs/draft/develop/connect-local-servers">
366 Full claude\_desktop\_config.json reference and troubleshooting
367 </Card>
368</CardGroup>
358> **[Connect local servers](/docs/draft/develop/connect-local-servers)**
359>
360> Full claude\_desktop\_config.json reference and troubleshooting
369361
No line in this hunk matches that.