BoilerplateHub

MCP Servers for React Native

React Native shares JSX and hooks with React on the web and shares almost nothing else, which is exactly why agents go wrong here: they carry web assumptions across a boundary that looks invisible in the source. An agent needs to know that there is no DOM, that styling is a constrained flexbox subset rather than CSS, and that any dependency containing native code requires a rebuild rather than a Metro refresh. It also needs to know whether the New Architecture is enabled, since that affects which third party libraries work at all.

Wiring MCP into a React Native project

  • A browser automation server is of limited use here, so prioritise git, GitHub, and crash reporting servers instead.
  • Scope the filesystem server to src/ or app/ so the agent does not spend context reading Pods and Gradle caches.
  • Commit .mcp.json at the repo root so every contributor's agent can read the same library issue trackers.

Servers worth adding

Filesystem MCP server

Scoped read and write access to the project.

The agent needs to see whether ios/ and android/ exist and are committed before it recommends anything involving native code.

Git MCP server

History, diffs, and blame.

Native directory history reveals whether the project maintains its native folders by hand or regenerates them, which changes every native answer.

GitHub MCP server

Reads issues, pull requests, and releases from GitHub.

Native module compatibility, especially around the New Architecture, is usually documented only in a library's open issues.

Sentry MCP server

Pulls crash reports and stack traces from Sentry.

Native crashes never reproduce in the packager, so the symbolicated device trace is the only real evidence.

Skills, MCP and plugins compared →

Rule these out for React Native

These are the failures that repeat across sessions, so each one belongs in .mcp.json.

Polling in useEffect where a native subscription belongs

To react to keyboard visibility, app foreground state, or dimension changes, agents write a useEffect with an interval or a one-shot read, because that pattern is everywhere in web React training data. The platform emits events for all three, and the subscription version is both cheaper and correct. Add to your rules file: 'Use the platform event APIs, Keyboard, AppState, and Dimensions listeners, rather than polling in useEffect, and always return the subscription remove function from the effect.'

Writing CSS that React Native does not implement

Agents produce StyleSheet objects containing grid, position fixed, box-shadow, calc, or a percentage where only a number is accepted. Many of these are silently ignored rather than throwing, so the layout is simply wrong on device and correct in the agent's head. Write: 'Layout is flexbox only. No grid, no position fixed, no CSS shorthand strings. Shadows use shadowColor with shadowOffset and shadowOpacity on iOS plus elevation on Android.'

Assuming browser globals exist

localStorage, document, window.matchMedia, and DOM event listeners appear regularly in agent output for React Native, usually inside a utility file where nothing signals the platform. These fail at runtime on device rather than at build time. Add: 'There is no DOM and no localStorage. Persistence uses the project's storage library, platform differences use Platform.select, and any code touching window or document is a mistake.'

Installing a native dependency without rebuilding

An agent adds a package containing native modules, restarts Metro, sees the module is null, and then starts debugging the JavaScript. The actual requirement is a pod install on iOS and a fresh native build on both platforms. State it: 'Any dependency with native code requires cd ios && pod install and a full rebuild, not a Metro reload. If a native module resolves as undefined, rebuild before changing any application code.'

Rendering long lists with map inside a ScrollView

Agents map over an array of items inside a ScrollView because it is the shortest working code, which mounts every row at once and makes memory and scroll performance degrade with list length. On a mid-range Android device this is very visible. Add: 'Any list that can exceed roughly twenty items uses FlatList or SectionList with a stable keyExtractor. Never map an unbounded array inside a ScrollView.'

Duplicating navigation state in a global store

Rather than reading route params, agents put the selected item into Redux or a context so the next screen can read it, which breaks deep links, back navigation, and state restoration because the store and the navigator disagree. Write: 'Screen inputs are passed as route params and read with the navigation hooks. Global state holds server and session data only, never the identity of the currently viewed screen.'

Same framework, other agents