@react-native-nitro-device-info/mcp-server
v1.1.3
Published
MCP server for react-native-nitro-device-info AI tool integration
Downloads
277
Maintainers
Readme
@react-native-nitro-device-info/mcp-server
MCP (Model Context Protocol) server for react-native-nitro-device-info that enables AI tools like Claude, Cursor, and Copilot to accurately access library documentation and API information.
Prerequisites
| Requirement | Version | Notes |
|-------------|---------|-------|
| Node.js | ≥20.0.0 | LTS recommended. Check with node --version |
| npm | ≥10.0.0 | Bundled with Node.js 20+ |
Installation
Option 1: npx (Recommended)
No installation required. Configure your AI tool to run directly:
npx @react-native-nitro-device-info/mcp-serverAdvantages:
- Always uses latest version
- No global installation needed
- Works immediately after npm registry access
Option 2: Global Install
npm install -g @react-native-nitro-device-info/mcp-serverThen run:
nitro-device-info-mcpQuick Setup (Recommended)
Run the init command in your React Native project to automatically configure MCP for Cursor and Claude Code:
cd your-react-native-project
npx @react-native-nitro-device-info/mcp-server initThis creates:
.cursor/mcp.json- Cursor IDE configuration.mcp.json- Claude Code project configuration
Then restart your IDE and start asking questions!
Manual Configuration
Claude Desktop (macOS)
Configuration file: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows path: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nitro-device-info": {
"command": "npx",
"args": ["@react-native-nitro-device-info/mcp-server"]
}
}
}Steps:
- Open the configuration file (create if doesn't exist)
- Add the
mcpServersentry above - Restart Claude Desktop completely (Cmd+Q, then reopen)
- Verify: Ask "What battery APIs does react-native-nitro-device-info have?"
Cursor IDE
Configuration file: .cursor/mcp.json (in your project root)
{
"mcpServers": {
"nitro-device-info": {
"command": "npx",
"args": ["@react-native-nitro-device-info/mcp-server"]
}
}
}Generic MCP Client
For any MCP-compatible client using stdio transport:
{
"command": "npx",
"args": ["@react-native-nitro-device-info/mcp-server"],
"transport": "stdio"
}Verification
Step 1: Check Server Loading
In Claude Desktop or your AI tool, ask:
"What tools does the nitro-device-info MCP server provide?"
Expected response: Should mention search_docs, get_api, and list_apis.
Step 2: Test API Lookup
"Show me the getBatteryLevel API from react-native-nitro-device-info"
Step 3: Test Search
"How do I check if headphones are connected?"
Step 4: Test List
"List all battery-related APIs"
Available Tools
| Tool | Purpose | Example Query |
|------|---------|---------------|
| search_docs | Search documentation with natural language | "how to get device model" |
| get_api | Get detailed info about a specific API | "show me getBatteryLevel" |
| list_apis | List APIs by category, platform, or type | "list all network APIs" |
Usage Examples
Basic Questions
"How do I get the device's battery level?"
The AI will query the MCP server and provide accurate API information:
import { NitroModules } from 'react-native-nitro-modules';
import type { DeviceInfo } from 'react-native-nitro-device-info';
const deviceInfo = NitroModules.createHybridObject<DeviceInfo>('DeviceInfo');
// Get battery level (0.0 to 1.0)
const batteryLevel = deviceInfo.getBatteryLevel();
console.log(batteryLevel < 0
? 'Battery: unavailable'
: `Battery: ${Math.round(batteryLevel * 100)}%`);API Discovery
"What APIs are available for network information?"
Device Attestation
The server also indexes the opt-in
react-native-nitro-device-integrity
package (Play Integrity + App Attest / DeviceCheck), so you can ask:
"How do I request a Play Integrity token?"
"What's the difference between attestKey and generateAssertion?"
"List all device-integrity APIs"
Documentation snapshot
The published package includes the core and attestation API specs, site Markdown, and library README under data/. The server indexes that bundled snapshot without fetching the website or requiring a sibling source checkout.
Rebuild the MCP package after editing source documentation. Publish a new MCP release to deliver those edits to installed clients; deploying the website alone does not update them. Check the installed library declarations when they differ from this snapshot.
The root API and /compat API differ. The API lookup returns native root signatures; use the migration guide for compatibility mappings. Korean search terms are retained, but matching still requires corresponding Korean content. The server does not translate queries.
Troubleshooting Questions
"Why does getIpAddress return empty on iOS simulator?"
Troubleshooting
Server Not Loading
Symptom: AI doesn't recognize react-native-nitro-device-info questions
Diagnostic steps:
Check Node.js version:
node --version # Must be v20.0.0 or higherVerify npx works:
npx --versionTest server directly:
npx @react-native-nitro-device-info/mcp-server --helpCheck Claude Desktop logs (macOS):
tail -f ~/Library/Logs/Claude/mcp*.log
Common Issues
| Issue | Cause | Solution | |-------|-------|----------| | "command not found" | Node.js not in PATH | Reinstall Node.js or add to PATH | | "npm ERR! 404" | Package not published | Wait for npm publish or build from source | | JSON parse error | Invalid config syntax | Check for trailing commas, quotes | | Server timeout | Slow network/registry | Use global install for offline use |
Development
Run from Source
git clone https://github.com/l2hyunwoo/react-native-nitro-device-info.git
cd react-native-nitro-device-info
yarn install
yarn workspace @react-native-nitro-device-info/mcp-server build
yarn workspace @react-native-nitro-device-info/mcp-server startRun Tests
yarn workspace @react-native-nitro-device-info/mcp-server testLicense
MIT
