npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-agent-sdk

v0.1.0

Published

Build AI agents that can actually use your phone. Camera, NFC, Bluetooth, Location, Contacts — all as agent tools. MCP compatible.

Readme

🤖 React Native Agent SDK

Build AI agents that can actually use your phone.

Not another chatbot UI. This is an agent framework that gives AI access to device capabilities — camera, location, NFC, bluetooth, contacts, APIs — as callable tools.

Quick Start

yarn add react-native-agent-sdk
import { createAgent, openai, LocationTool, CameraTool, APITool } from 'react-native-agent-sdk';

const agent = createAgent({
  model: openai({ apiKey: 'sk-...' }),
  tools: [new LocationTool(), new CameraTool(), new APITool()],
});

// Agent thinks, calls tools, returns result
const result = await agent.run("Find nearby restaurants and show me the top 3");
console.log(result.response);
// → "Here are the top 3 restaurants near you: ..."
// (Agent used LocationTool to get GPS, APITool to search Google Places)

What It Does

User prompt → Agent thinks → Calls device tools → Returns result
                                    │
                    ┌────────────────┼────────────────┐
                    ▼                ▼                ▼
              📍 Location      📷 Camera       🌐 API calls
              📇 Contacts      📋 Clipboard    🔔 Notifications
              💾 Storage       📤 Share        🔌 MCP servers

The AI decides which tools to use based on the user's request. You just provide the tools and the prompt.

Built-in Tools

| Tool | What it does | |------|-------------| | LocationTool | GPS coordinates | | CameraTool | Take photo / pick from gallery | | ContactsTool | Search device contacts | | NotificationsTool | Send local notifications | | StorageTool | Read/write local storage | | APITool | HTTP requests to any API | | ClipboardTool | Read/write clipboard | | ShareTool | System share dialog |

Model Providers

import { openai, anthropic, gemini, custom } from 'react-native-agent-sdk';

// OpenAI
const agent = createAgent({ model: openai({ apiKey: '...', model: 'gpt-4o' }) });

// Claude
const agent = createAgent({ model: anthropic({ apiKey: '...', model: 'claude-sonnet-4-20250514' }) });

// Gemini
const agent = createAgent({ model: gemini({ apiKey: '...', model: 'gemini-2.0-flash' }) });

// Custom (bring your own)
const agent = createAgent({ model: custom(async (messages, tools) => { ... }) });

MCP Support

Connect to any MCP server — tools are auto-discovered and usable by the agent:

const agent = createAgent({
  model: openai({ apiKey: '...' }),
  tools: [new LocationTool()],
});

// Connect to MCP server — its tools become available
await agent.connectMCP({
  url: 'https://company.com/mcp',
  auth: 'token-123',
});

// Agent can now use both local tools AND MCP server tools
await agent.run("Get customer data from CRM and send them a notification");

Custom Tools

Create your own tools in minutes:

import { Tool, ToolResult, ParameterDef } from 'react-native-agent-sdk';

class WeatherTool extends Tool {
  name = 'get_weather';
  description = 'Get current weather for a city';
  parameters = {
    city: { type: 'string', description: 'City name', required: true },
  };

  async execute(params: { city: string }): Promise<ToolResult> {
    const res = await fetch(`https://api.weather.com/current?city=${params.city}`);
    const data = await res.json();
    return { success: true, data };
  }
}

agent.registerTool(new WeatherTool());

Agent Callbacks

Monitor what the agent is doing:

const agent = createAgent({
  model: openai({ apiKey: '...' }),
  tools: [...],
  onThinking: (msg) => console.log('🤔', msg),
  onToolCall: (name, params) => console.log('🔧', name, params),
  onResponse: (msg) => console.log('💬', msg),
});

Real-World Examples

// Find nearby coffee shops
await agent.run("Find coffee shops within 500m and share the closest one's address");

// Smart notification
await agent.run("Remind me to call John tomorrow at 9am");

// Data pipeline
await agent.run("Fetch latest Bitcoin price and save it to local storage");

// Multi-step task
await agent.run("Take a photo, then share it on WhatsApp with the caption 'Hello!'");

Architecture

┌─────────────────────────────────────────────────────────┐
│  Your App                                               │
│                                                         │
│  ┌───────────────────────────────────────────────────┐  │
│  │  Agent Core                                       │  │
│  │  - Prompt → Model → Tool calls → Response         │  │
│  │  - Multi-step reasoning loop                      │  │
│  │  - Permission management                          │  │
│  └──────────────┬────────────────────────────────────┘  │
│                 │                                        │
│  ┌──────────────▼────────────────────────────────────┐  │
│  │  Tools Layer                                      │  │
│  │  📍 Location  📷 Camera  📇 Contacts  🌐 API     │  │
│  │  📋 Clipboard 📤 Share  🔔 Notify    💾 Storage  │  │
│  └──────────────┬────────────────────────────────────┘  │
│                 │                                        │
│  ┌──────────────▼────────────────────────────────────┐  │
│  │  MCP Layer (optional)                             │  │
│  │  Connect to any MCP server → auto-discover tools  │  │
│  └───────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────┘
         │                    │
         ▼                    ▼
  ┌──────────────┐   ┌──────────────────┐
  │  LLM API     │   │  MCP Servers     │
  │  (OpenAI /   │   │  (Company APIs / │
  │   Claude /   │   │   External)      │
  │   Gemini)    │   │                  │
  └──────────────┘   └──────────────────┘

Coming Soon

  • @rn-agent/nfc — Read/write NFC tags
  • @rn-agent/bluetooth — BLE device communication
  • @rn-agent/chat-ui — Ready-made chat + voice UI components
  • @rn-agent/cloud — Agent memory, sync, analytics
  • Voice input/output (speech-to-text, text-to-speech)
  • Streaming responses
  • Multi-agent orchestration

License

MIT

Author

Hasan Gönen@hasangonen91