diff --git a/docs/platforms/python/integrations/mcp/index.mdx b/docs/platforms/python/integrations/mcp/index.mdx index 1469dcfd18c6d..784dcae3df534 100644 --- a/docs/platforms/python/integrations/mcp/index.mdx +++ b/docs/platforms/python/integrations/mcp/index.mdx @@ -38,9 +38,23 @@ uv add "sentry-sdk[mcp]" ## Configure -If you have the `mcp` package in your dependencies, the MCP integration will be enabled automatically when you initialize the Sentry SDK. +Simply update your `sentry_sdk.init()` call to include the `MCPIntegration()`. - +```python +import sentry_sdk +from sentry_sdk.integrations.mcp import MCPIntegration + +sentry_sdk.init( + dsn="___PUBLIC_DSN___", + traces_sample_rate=1.0, + # Add data like tool inputs/outputs; + # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info + send_default_pii=True, + integrations=[ + MCPIntegration(), + ], +) +``` ## Verify @@ -63,6 +77,9 @@ sentry_sdk.init( # Add data like tool inputs/outputs; # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info send_default_pii=True, + integrations=[ + MCPIntegration(), + ], ) # Create the MCP server @@ -115,6 +132,9 @@ sentry_sdk.init( dsn="___PUBLIC_DSN___", traces_sample_rate=1.0, send_default_pii=True, + integrations=[ + MCPIntegration(), + ], ) # Create the low-level MCP server