Skip to content

@sentry/core is bundling some MCP/AI code #5628

@kien-ngo

Description

@kien-ngo

What React Native libraries do you use?

Expo Router

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

~7.11.0

How does your development environment look like?

System:
  OS: macOS 15.7.3
  CPU: (11) arm64 Apple M3 Pro
  Memory: 533.33 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 25.6.0
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 11.8.0
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK:
    API Levels:
      - "35"
      - "36"
    Build Tools:
      - 35.0.0
      - 36.0.0
      - 36.1.0
    System Images:
      - android-35 | Google Play Tablet ARM 64 v8a
      - android-36.1 | Google Play ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.28238.7.2523.14688667
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.8
    path: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.1
    wanted: ^20.1.1
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.1
    wanted: 0.83.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Sentry.init()

init({
  dsn: ENVS.SENTRY_DSN,
  environment: ENVS.ENVIRONMENT,
  dist: Constants.expoConfig?.version,
  tracesSampleRate: 0.8,
  integrations: [
    httpContextIntegration(),
    reactNativeTracingIntegration(),
  ],
});

Steps to Reproduce

Here's my metro config:

const { getSentryExpoConfig } = require('@sentry/react-native/metro');
const { withUniwindConfig } = require('uniwind/metro');

const config = getSentryExpoConfig(__dirname, {
  includeWebReplay: false,
});

module.exports = withUniwindConfig(config, {
  cssEntryFile: './global.css',
  dtsFile: './uniwind-types.d.ts',
});

Then just build the project.

Expected Result

Maybe im ignorant but I don't think we should have those code in the final bundle? I know for a fact that I'm not using any AI feature from sentry.

Actual Result

AI/MCP related code probably taking over 150kb

Image

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions