Skip to content

Repository files navigation

Let agents and tests reach into your running app — without shipping a debug menu

MIT license npm downloads PRs Welcome

Cordierite lets a terminal, a test runner, or an AI agent call functions inside your React Native app while it's running. You pick what's callable — a few functions you write yourself — and nothing else is reachable.

Why you'd want this

Your E2E tests stop tapping through setup. Most of an end-to-end test isn't the thing you're testing. It's logging in, dismissing onboarding, seeding a cart, waiting for a spinner. With Cordierite, the test calls login(userId) or seedCart(items) directly and jumps straight to the part that matters. Faster runs, far less flakiness, and a lot fewer screenshots for an agent to burn tokens on.

Agents can actually drive your app. Add one line to Claude Code's or Cursor's config and your app's functions show up as tools the agent can call. It can flip a feature flag, jump to a screen, or check some state without you wiring up a single prompt.

No hidden debug UI. No secret gestures, no long-press-the-logo admin panel, nothing extra in the app for someone to go find. The only things reachable are functions you deliberately registered.

It works in whatever build you want. Dev, internal, TestFlight, production — Cordierite isn't tied to debug builds. You decide which builds carry it and what those builds are willing to trust. Most teams ship it in dev and internal builds and strip it from store releases, but that's your call, not something the library decides for you.

Your dev loop doesn't fight you. Metro reloads, backgrounding the app, flaky Wi-Fi — the session survives all of it and picks back up on its own. One background service handles as many devices as you've got plugged in.

What it looks like

Register something you want reachable:

useCordieriteTool({
  name: "seed_cart",
  description: "Fill the cart with test items.",
  inputSchema: z.object({ items: z.number() }),
  handler: async ({ items }) => ({ added: items }),
});

Call it from your terminal:

cordierite invoke seed_cart --input '{"items":3}'

Or hand it to an agent:

{
  "mcpServers": {
    "cordierite": { "command": "cordierite", "args": ["mcp"] }
  }
}

That's the whole idea. Everything else is about which builds include it and what they trust.

Is this safe to ship?

That's the right question to ask, and the honest answer is: it depends on how you set it up, so it's worth ten minutes of reading before you ship it in something customers install.

The short version: the connection is encrypted, your app checks the identity of the machine on the other end rather than trusting whoever's on the network, and a link someone intercepts isn't a way in. On top of that, you choose per build whether Cordierite's code is even in the binary. In development none of this needs configuring — it just works — and you tighten it up for builds that leave your machine.

docs/SECURITY.md walks through what it protects against, what it doesn't, and how to rotate keys.

Getting started

Install the CLI where you'll run it, and the package in your app:

npm install -g cordierite
npm install @cordierite/react-native zod

From there:

  • Set up your app — registering tools, deep-link setup, and how to decide what ships in which build.
  • Use the CLI and MCP server — connecting to a device, listing and calling tools, and checking a built artifact.
  • Try the playground — a working app you can run end to end in a few minutes. Fastest way to see whether this fits your project.

You'll need a development build or a bare React Native app. Expo Go can't do it.

Packages

Package What it is
cordierite The CLI, the background service, and the MCP server
@cordierite/react-native The app-side library and Expo config plugin
@cordierite/shared Types shared by both

Support

iOS 15.1+ and Android, both on the New Architecture. Web gets a no-op stub so shared code doesn't break. The CLI needs Node 20 or newer. Windows works in principle but isn't tested in CI yet.

Docs

Made with ❤️ at Callstack

cordierite is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks, contact us at hello@callstack.com if you need any help with these or just want to say hi!

Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥

About

Expose app tools securely - no debug menus in the binary

Topics

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages