You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a3adea3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/configuration/options.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,7 @@ For more on what data Sentry collects and how to control it, see <PlatformLink t
140
140
|`urlQueryParams`|`CollectBehavior`|`true`| Collect URL query parameters. Parameter names are always included. The SDK replaces the values of sensitive parameters with `[Filtered]`. |
141
141
|`graphQL`|`{ document?, variables? }`| both `true`|`document`: Collect the GraphQL document (the query or mutation source text). <br /><br /> `variables`: Collect the variables that are passed to GraphQL operations. <br /><br /> The operation name and type are always collected. |
142
142
|`genAI`|`{ inputs?, outputs? }`| both `true`|`inputs`: Collect the content of generative AI inputs: system instructions, prompt messages, tool definitions, and tool call arguments. <br /><br /> `outputs`: Collect the content of generative AI outputs, such as completion text and tool call results. <br /><br /> Metadata, such as the model name and token counts, is always collected. Options set on an AI integration take precedence over these values. |
143
+
|`mcp`|`{ inputs?, outputs? }`| both `true`| Available in SDK version `11.9.0` and above. <br /><br /> `inputs`: Collect the content of incoming MCP requests, such as tool call arguments, prompt arguments, and the payload of MCP logging notifications. <br /><br /> `outputs`: Collect the content of MCP responses, such as tool results and prompt result messages. <br /><br /> Metadata, such as the method name, the tool or prompt name, and error status, is always collected. A field you don't set falls back to the matching `genAI` field. The `recordInputs` and `recordOutputs` options of `wrapMcpServerWithSentry` take precedence over these values. |
143
144
|`databaseQueryData`|`boolean`|`true`| Collect the data associated with database queries: bound query parameters, data payloads for write operations, and returned result data. <br /><br /> The sanitized or parameterized query text (`db.query.text`) is **not** controlled by this option. Structural metadata, such as the database system, query summary, operation name, and table, is also **always** collected. |
144
145
|`queues`|`boolean`|`true`| Collect the arguments passed to tasks within queues. For Kafka, this is the message key. Structural metadata, such as the messaging system, the destination name, and the operation, is always collected. |
145
146
|`stackFrameVariables`|`CollectBehavior`|`true`| Capture local variable values in stack frames. Allow/deny lists match variable names. |
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/data-management/data-collected/index.mdx
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -272,8 +272,6 @@ Sentry.init({
272
272
273
273
The content of generative AI inputs (system instructions, prompt messages, tool definitions, and tool call arguments) and outputs (such as completion text and tool call results) might carry personal data. By default, the SDK records both inputs and outputs. Metadata like model ID and token counts is always collected.
274
274
275
-
The same setting applies to instrumented MCP servers. By default, the SDK records the inputs and outputs of tool calls, prompt retrievals, and resource reads. Use the `recordInputs` and `recordOutputs` options of `wrapMcpServerWithSentry` to control recording per server.
276
-
277
275
Use the `dataCollection.genAI` option to control this. For example, opt out of recording AI message content while keeping the metadata:
278
276
279
277
```JavaScript
@@ -287,6 +285,32 @@ Sentry.init({
287
285
},
288
286
});
289
287
```
288
+
289
+
<PlatformCategorySectionsupported={["server"]}>
290
+
## MCP Server Inputs and Outputs
291
+
292
+
When you instrument an MCP server, metadata like the method name, the tool or prompt name, the session and protocol version, content counts, and error status is always sent to Sentry.
293
+
294
+
The content of MCP requests and responses might carry personal data, such as tokens, file paths, or private user content. By default, the SDK records both inputs (such as tool call arguments, prompt arguments, and the payload of MCP logging notifications) and outputs (such as tool results and prompt result messages).
295
+
296
+
Use the `dataCollection.mcp` option, available in SDK version `11.9.0` and above, to control this. For example, opt out of recording MCP content while keeping the metadata:
297
+
298
+
```JavaScript
299
+
Sentry.init({
300
+
dsn:"___PUBLIC_DSN___",
301
+
dataCollection: {
302
+
mcp: {
303
+
inputs:false,
304
+
outputs:false,
305
+
},
306
+
},
307
+
});
308
+
```
309
+
310
+
If you don't set a field of `dataCollection.mcp`, the SDK uses the matching `dataCollection.genAI` field instead. In SDK versions before `11.9.0`, `dataCollection.genAI` is the only global setting for MCP content.
311
+
312
+
To control recording for a specific server, use the `recordInputs` and `recordOutputs` options of <PlatformLinkto="/mcp-monitoring/">`wrapMcpServerWithSentry`</PlatformLink>. They take precedence over the `dataCollection` settings.
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/mcp-monitoring/index.mdx
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,18 +24,20 @@ Support for `@modelcontextprotocol/server` 2.x requires Sentry JavaScript SDK ve
24
24
25
25
By default, the SDK sends the inputs and outputs of your MCP tool calls, prompt retrievals, and resource reads. This gives you rich debugging context. MCP payloads can carry sensitive data, such as tokens, file paths, or private user content. Review what your server handles before you deploy to production.
26
26
27
-
The <PlatformLinkto="/configuration/options/#dataCollection">`dataCollection.genAI`</PlatformLink> option controls this recording globally for both MCP and AI instrumentation:
27
+
The <PlatformLinkto="/configuration/options/#dataCollection">`dataCollection.mcp`</PlatformLink> option controls this recording globally for all MCP servers:
28
28
29
29
```javascript
30
30
Sentry.init({
31
31
dsn:"___PUBLIC_DSN___",
32
32
dataCollection: {
33
-
genAI: { inputs:false, outputs:false },
33
+
mcp: { inputs:false, outputs:false },
34
34
},
35
35
});
36
36
```
37
37
38
-
To control recording for a specific server, pass it to `wrapMcpServerWithSentry` with the `recordInputs` and `recordOutputs` options. These options override the `dataCollection.genAI` settings, and they also apply to a server the SDK has already instrumented automatically:
38
+
The `dataCollection.mcp` option requires Sentry JavaScript SDK version `11.9.0` or newer. If you don't set a field of `dataCollection.mcp`, or you use an older SDK version, the matching `dataCollection.genAI` field controls MCP recording instead.
39
+
40
+
To control recording for a specific server, pass it to `wrapMcpServerWithSentry` with the `recordInputs` and `recordOutputs` options. These options override the `dataCollection` settings, and they also apply to a server the SDK has already instrumented automatically:
0 commit comments