File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
docs/platforms/python/integrations/mcp Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,23 @@ uv add "sentry-sdk[mcp]"
3838
3939## Configure
4040
41- If you have the ` mcp ` package in your dependencies, the MCP integration will be enabled automatically when you initialize the Sentry SDK .
41+ Simply update your ` sentry_sdk.init() ` call to include the ` MCPIntegration() ` .
4242
43- <PlatformContent includePath = " getting-started-config" />
43+ ``` python
44+ import sentry_sdk
45+ from sentry_sdk.integrations.mcp import MCPIntegration
46+
47+ sentry_sdk.init(
48+ dsn = " ___PUBLIC_DSN___" ,
49+ traces_sample_rate = 1.0 ,
50+ # Add data like tool inputs/outputs;
51+ # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
52+ send_default_pii = True ,
53+ integrations = [
54+ MCPIntegration(),
55+ ],
56+ )
57+ ```
4458
4559## Verify
4660
@@ -63,6 +77,9 @@ sentry_sdk.init(
6377 # Add data like tool inputs/outputs;
6478 # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
6579 send_default_pii = True ,
80+ integrations = [
81+ MCPIntegration(),
82+ ],
6683)
6784
6885# Create the MCP server
@@ -115,6 +132,9 @@ sentry_sdk.init(
115132 dsn = " ___PUBLIC_DSN___" ,
116133 traces_sample_rate = 1.0 ,
117134 send_default_pii = True ,
135+ integrations = [
136+ MCPIntegration(),
137+ ],
118138)
119139
120140# Create the low-level MCP server
You can’t perform that action at this time.
0 commit comments