Skip to main content
Glama
MrNitro360

React Native MCP Server

by MrNitro360
README.md
# React Native MCP Server

<div align="center">

[![npm version](https://badge.fury.io/js/%40mrnitro360%2Freact-native-mcp-guide.svg)](https://badge.fury.io/js/%40mrnitro360%2Freact-native-mcp-guide)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Model Context Protocol](https://img.shields.io/badge/MCP-1.1.0-blue.svg)](https://modelcontextprotocol.io/)
[![Auto-Deploy](https://github.com/MrNitro360/React-Native-MCP/actions/workflows/auto-deploy.yml/badge.svg)](https://github.com/MrNitro360/React-Native-MCP/actions/workflows/auto-deploy.yml)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
[![React Native](https://img.shields.io/badge/React%20Native-0.72+-blue.svg)](https://reactnative.dev/)

**Professional AI-powered React Native development companion with expert-level code remediation**

*Expert remediation β€’ Automated fixes β€’ Industry best practices β€’ Enterprise security*

</div>

## Overview

A comprehensive Model Context Protocol (MCP) server designed for professional React Native development teams. This tool provides intelligent code analysis, **expert-level automated code remediation**, security auditing, and performance optimization with production-ready fixes.

**πŸ†• v1.1.0 - Expert Remediation Features:**

- πŸ”§ **Expert Code Remediation** - Automatically fix security, performance, and quality issues
- πŸ—οΈ **Advanced Refactoring** - Comprehensive component modernization and optimization
- πŸ›‘οΈ **Security Fixes** - Automatic hardcoded secret migration and vulnerability patching
- ⚑ **Performance Fixes** - Memory leak prevention and React Native optimization
- πŸ“ **Production-Ready Code** - TypeScript interfaces, StyleSheet extraction, accessibility

**Key Benefits:**

- πŸš€ **Accelerated Development** - Automated code analysis, fixing, and test generation
- πŸ”’ **Enterprise Security** - Vulnerability detection with automatic remediation
- πŸ“Š **Quality Assurance** - Industry-standard testing frameworks and coverage analysis
- ⚑ **Performance Optimization** - Advanced profiling with automatic fixes
- 🎯 **Best Practices** - Expert guidance with code implementation
- πŸ”„ **Automated Updates** - Continuous integration with automatic version management

---

## Quick Start

### Prerequisites

- **Node.js** 18.0 or higher
- **Claude CLI** or **Claude Desktop**
- **React Native** development environment

### Installation

#### Automated Installation (Recommended)

```bash
# Install globally via npm
npm install -g @mrnitro360/react-native-mcp-guide

# Configure with Claude CLI
claude mcp add react-native-guide npx @mrnitro360/react-native-mcp-guide
```

#### Development Installation

```bash
# Clone repository
git clone https://github.com/MrNitro360/React-Native-MCP.git
cd React-Native-MCP

# Install dependencies and build
npm install && npm run build

# Add to Claude CLI
claude mcp add react-native-guide node ./build/index.js
```

### Verification

```bash
claude mcp list
```

Verify that `react-native-guide` appears as **Connected** βœ…

---

## πŸ†• Expert Remediation Examples

### Before vs. After: Automatic Code Fixing

**❌ Before (Problematic Code):**
```typescript
const MyComponent = () => {
  const apiKey = "sk-1234567890abcdef"; // Hardcoded secret
  const [data, setData] = useState([]);
  
  useEffect(() => {
    console.log("API Key:", apiKey); // Sensitive logging
    fetch('http://api.example.com/data') // HTTP instead of HTTPS
      .then(response => response.json())
      .then(data => setData(data));
      
    const interval = setInterval(() => { // Memory leak
      console.log('Polling...');
    }, 1000);
  }, []);

  return (
    <ScrollView>
      {data.map(item => ( // Performance issue
        <Text key={item.id} style={{color: 'red'}}>{item.name}</Text>
      ))}
    </ScrollView>
  );
};
```

**βœ… After (Expert Remediation):**
```typescript
interface Props {
  children?: React.ReactNode;
  onPress?: () => void;
}

const MyComponent: React.FC<Props> = () => {
  // TODO: Add API_KEY to your environment variables
  const apiKey = process.env.API_KEY || Config.API_KEY;
  const [data, setData] = useState([]);
  
  useEffect(() => {
    // Removed sensitive logging for security
    // console.log('[REDACTED - contains sensitive data]');
    
    // Upgraded to HTTPS for security
    fetch('https://api.example.com/data')
      .then(response => response.json())
      .then(data => setData(data));
      
    const interval = setInterval(() => {
      console.log('Polling...');
    }, 1000);
    
    // Cleanup intervals to prevent memory leaks
    return () => {
      clearInterval(interval);
    };
  }, []);

  return (
    <FlatList
      data={data}
      keyExtractor={(item, index) => item.id?.toString() || index.toString()}
      renderItem={({ item }) => (
        <Text style={styles.itemText}>{item.name}</Text>
      )}
    />
  );
};

const styles = StyleSheet.create({
  itemText: {
    color: 'red'
  }
});

export default React.memo(MyComponent);
```

**🎯 What Got Fixed Automatically:**
- βœ… **Security**: Hardcoded API key β†’ Environment variable
- βœ… **Security**: Sensitive logging β†’ Sanitized
- βœ… **Security**: HTTP β†’ HTTPS upgrade
- βœ… **Performance**: ScrollView + map β†’ FlatList with keyExtractor
- βœ… **Memory**: Added interval cleanup to prevent leaks
- βœ… **Best Practices**: Inline styles β†’ StyleSheet.create
- βœ… **Type Safety**: Added TypeScript interface
- βœ… **Performance**: Wrapped with React.memo

---

## Core Features

### πŸ”§ Expert Code Remediation (NEW in v1.1.0)

| Tool | Capability | Level | Output |
|------|------------|-------|--------|
| **`remediate_code`** | Automatic security, performance, and quality fixes | Expert | Production-ready code |
| **`refactor_component`** | Advanced component modernization and optimization | Senior | Refactored components with tests |
| **Security Remediation** | Hardcoded secrets β†’ environment variables | Enterprise | Secure code patterns |
| **Performance Fixes** | Memory leaks, FlatList optimization, StyleSheet | Expert | Optimized components |
| **Type Safety** | Automatic TypeScript interface generation | Professional | Type-safe code |

### πŸ§ͺ Advanced Testing Suite

| Feature | Description | Frameworks |
|---------|-------------|------------|
| **Automated Test Generation** | Industry-standard test suites for components | Jest, Testing Library |
| **Coverage Analysis** | Detailed reports with improvement strategies | Jest Coverage, LCOV |
| **Strategy Evaluation** | Testing approach analysis and recommendations | Unit, Integration, E2E |
| **Framework Integration** | Multi-platform testing support | Detox, Maestro, jest-axe |

### πŸ” Comprehensive Analysis Tools

| Analysis Type | Capabilities | Output |
|---------------|--------------|--------|
| **Security Auditing** | Vulnerability detection with auto-remediation | Risk-prioritized reports + fixes |
| **Performance Profiling** | Memory, rendering, bundle optimization + fixes | Actionable recommendations + code |
| **Code Quality** | Complexity analysis with refactoring implementation | Maintainability metrics + fixes |
| **Accessibility** | WCAG compliance with automatic improvements | Compliance reports + code |

### πŸ“¦ Dependency Management

- **Automated Package Auditing** - Security vulnerabilities and outdated dependencies
- **Intelligent Upgrades** - React Native compatibility validation
- **Conflict Resolution** - Dependency tree optimization
- **Migration Assistance** - Deprecated package modernization

### πŸ“š Expert Knowledge Base

- **React Native Documentation** - Complete API references and guides
- **Architecture Patterns** - Scalable application design principles  
- **Platform Guidelines** - iOS and Android specific best practices
- **Security Standards** - Mobile application security frameworks

---

## Usage Examples

### πŸ”§ Expert Code Remediation (NEW)

```bash
# Automatically fix all detected issues with expert-level solutions
claude "remediate_code with remediation_level='expert' and add_comments=true"

# Advanced component refactoring with performance optimization
claude "refactor_component with refactor_type='comprehensive' and include_tests=true"

# Security-focused remediation
claude "remediate_code with issues=['hardcoded_secrets', 'sensitive_logging'] and remediation_level='expert'"

# Performance-focused refactoring
claude "refactor_component with refactor_type='performance' and target_rn_version='latest'"
```

### Testing & Quality Assurance

```bash
# Generate comprehensive component tests
claude "generate_component_test with component_name='LoginForm' and test_type='comprehensive'"

# Analyze testing strategy
claude "analyze_testing_strategy with focus_areas=['unit', 'accessibility', 'performance']"

# Generate coverage report
claude "analyze_test_coverage with coverage_threshold=85"
```

### Code Analysis & Optimization

```bash
# Comprehensive codebase analysis with auto-remediation suggestions
claude "analyze_codebase_comprehensive"

# Performance optimization with specific focus areas
claude "analyze_codebase_performance with focus_areas=['memory_usage', 'list_rendering']"

# Security audit with vulnerability detection
claude "analyze_codebase_comprehensive with analysis_types=['security', 'performance']"
```

### Dependency Management

```bash
# Package upgrade recommendations
claude "upgrade_packages with update_level='minor'"

# Resolve dependency conflicts
claude "resolve_dependencies with fix_conflicts=true"

# Security vulnerability audit
claude "audit_packages with auto_fix=true"
```

### Real-World Scenarios

| Scenario | Command | Outcome |
|----------|---------|---------|
| **πŸ”§ Automatic Code Fixing** | `"Fix all security and performance issues in my component with expert solutions"` | Production-ready remediated code |
| **πŸ—οΈ Component Modernization** | `"Refactor my legacy component to modern React Native patterns with tests"` | Modernized component + test suite |
| **πŸ›‘οΈ Security Hardening** | `"Automatically fix hardcoded secrets and security vulnerabilities"` | Secure code with environment variables |
| **⚑ Performance Optimization** | `"Fix memory leaks and optimize FlatList performance automatically"` | Optimized code with cleanup |
| **πŸ“ Type Safety Enhancement** | `"Add TypeScript interfaces and improve type safety automatically"` | Type-safe code with interfaces |
| **Pre-deployment Security Check** | `"Scan my React Native project for security vulnerabilities"` | Security report + automatic fixes |
| **Performance Bottleneck Analysis** | `"Analyze my app for performance bottlenecks and memory leaks"` | Optimization roadmap + fixes |
| **Code Quality Review** | `"Review my codebase for refactoring opportunities"` | Quality improvement + implementation |
| **Accessibility Compliance** | `"Check my app for accessibility issues and fix them automatically"` | WCAG compliance + code fixes |
| **Component Test Generation** | `"Generate comprehensive tests for my LoginScreen component"` | Complete test suite |
| **Testing Strategy Optimization** | `"Analyze my current testing strategy and suggest improvements"` | Testing roadmap |

---

## Claude Desktop Integration

### NPM Installation Configuration

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "react-native-guide": {
      "command": "npx",
      "args": ["@mrnitro360/react-native-mcp-guide@1.1.0"],
      "env": {}
    }
  }
}
```

### Development Configuration

```json
{
  "mcpServers": {
    "react-native-guide": {
      "command": "node",
      "args": ["/absolute/path/to/React-Native-MCP/build/index.js"],
      "env": {}
    }
  }
}
```

**Configuration Paths:**
- **Windows:** `C:\Users\{Username}\Desktop\React-Native-MCP\build\index.js`
- **macOS/Linux:** `/Users/{Username}/Desktop/React-Native-MCP/build/index.js`

---

## Development & Maintenance

### Local Development

```bash
# Development with hot reload
npm run dev

# Production build
npm run build

# Production server
npm start
```

### Continuous Integration

This project implements enterprise-grade CI/CD:

- βœ… **Automated Version Management** - Semantic versioning with auto-increment
- βœ… **Continuous Deployment** - Automatic npm publishing on merge
- βœ… **Release Automation** - GitHub releases with comprehensive changelogs
- βœ… **Quality Gates** - Build validation and testing before deployment

### Update Management

```bash
# Check current version
npm list -g @mrnitro360/react-native-mcp-guide

# Update to latest version
npm update -g @mrnitro360/react-native-mcp-guide

# Reconfigure Claude CLI
claude mcp remove react-native-guide
claude mcp add react-native-guide npx @mrnitro360/react-native-mcp-guide
```

---

## Technical Specifications

### 🎯 Analysis & Remediation Capabilities

- **Expert Code Remediation** - Automatic fixing of security, performance, and quality issues
- **Advanced Component Refactoring** - Comprehensive modernization with test generation
- **Comprehensive Codebase Analysis** - Multi-dimensional quality assessment with fixes
- **Enterprise Security Auditing** - Vulnerability detection with automatic remediation
- **Performance Intelligence** - Memory, rendering, and bundle optimization with fixes
- **Quality Metrics** - Complexity analysis with refactoring implementation
- **Accessibility Compliance** - WCAG 2.1 AA standard validation with automatic fixes
- **Testing Strategy Optimization** - Coverage analysis and framework recommendations

### πŸ› οΈ Technical Architecture

- **12 Specialized Tools** - Complete React Native development lifecycle coverage + remediation
- **2 Expert Remediation Tools** - `remediate_code` and `refactor_component`
- **6 Expert Prompt Templates** - Structured development workflows
- **5 Resource Libraries** - Comprehensive documentation and best practices
- **Industry-Standard Test Generation** - Automated test suite creation
- **Multi-Framework Integration** - Jest, Detox, Maestro, and accessibility tools
- **Real-time Coverage Analysis** - Detailed reporting with improvement strategies
- **Production-Ready Code Generation** - Expert-level automated fixes and refactoring

### 🏒 Enterprise Features

- **Expert-Level Remediation** - Senior engineer quality automatic code fixes
- **Production-Ready Solutions** - Enterprise-grade security and performance fixes
- **Professional Reporting** - Executive-level summaries with implementation code
- **Security-First Architecture** - Comprehensive vulnerability assessment with fixes
- **Scalability Planning** - Large-scale application design patterns with refactoring
- **Compliance Support** - Industry standards with automatic compliance fixes
- **Multi-Platform Optimization** - iOS and Android specific considerations with fixes

---

## πŸ“‹ Changelog

### v1.1.0 - Expert Code Remediation (Latest)

**πŸš€ Major Features:**
- ✨ **NEW**: `remediate_code` tool - Expert-level automatic code fixing
- ✨ **NEW**: `refactor_component` tool - Advanced component refactoring with tests
- πŸ”§ **Enhanced**: Component detection accuracy improved
- πŸ›‘οΈ **Security**: Automatic hardcoded secret remediation
- ⚑ **Performance**: Memory leak prevention and FlatList optimization
- πŸ“ **Quality**: TypeScript interface generation and StyleSheet extraction
- 🎯 **Accessibility**: WCAG compliance with automatic fixes

**🎯 Remediation Capabilities:**
- Hardcoded secrets β†’ Environment variables
- Sensitive logging β†’ Sanitized code
- HTTP requests β†’ HTTPS enforcement
- Memory leaks β†’ Automatic cleanup
- Inline styles β†’ StyleSheet.create
- Performance issues β†’ Optimized patterns
- Type safety β†’ TypeScript interfaces

### v1.0.5 - Previous Version
- Comprehensive analysis tools
- Testing suite generation
- Dependency management
- Performance optimization guidance

---

## Support & Community

### Resources

- πŸ“¦ **[NPM Package](https://www.npmjs.com/package/@mrnitro360/react-native-mcp-guide)** - Official package repository
- πŸ™ **[GitHub Repository](https://github.com/MrNitro360/React-Native-MCP)** - Source code and development
- πŸ› **[Issue Tracker](https://github.com/MrNitro360/React-Native-MCP/issues)** - Bug reports and feature requests
- πŸ“– **[MCP Documentation](https://modelcontextprotocol.io/)** - Model Context Protocol specification
- βš›οΈ **[React Native Docs](https://reactnative.dev/)** - Official React Native documentation

### Contributing

We welcome contributions from the React Native community. Please review our [Contributing Guidelines](CONTRIBUTING.md) for development standards and submission processes.

### License

This project is licensed under the [MIT License](LICENSE). See the license file for detailed terms and conditions.

---

<div align="center">

**Professional React Native Development with Expert-Level Remediation**

*Empowering development teams to build secure, performant, and accessible mobile applications with automated expert-level code fixes*

πŸ†• **v1.1.0 - Now with Expert Code Remediation!**

[Get Started](https://www.npmjs.com/package/@mrnitro360/react-native-mcp-guide) β€’ [Documentation](https://github.com/MrNitro360/React-Native-MCP) β€’ [Community](https://github.com/MrNitro360/React-Native-MCP/issues)

</div>

TDQS

B3.1/5.0

Scored across 13 tools

Disambiguation3/5

Several tools overlap in purpose: analyze_component, analyze_codebase_performance, analyze_codebase_comprehensive, and analyze_testing_strategy/analyze_test_coverage all perform analysis with unclear boundaries. generate_component_test and remediate_code/refactor_component also have some overlap in modifying code, though their primary intents differ.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (generate_component_test, analyze_testing_strategy, optimize_performance, debug_issue, refactor_component). Minor deviations exist with check_for_updates and get_version_info, but the overall pattern is predictable.

Tool Count4/5

13 tools is within the reasonable range for a developer-focused server covering analysis, testing, optimization, and maintenance. The count feels slightly heavy given the overlapping analysis tools, but each tool has a distinct enough target area to justify its presence.

Completeness3/5

The server covers analysis, testing, performance, architecture, debugging, updates, and remediationβ€”a broad surface. However, there are gaps: no explicit tool for dependency management, no tool for generating new components (only tests/refactoring), and no tool for running or executing tests, which limits end-to-end workflows.

Maintenance

ActivityInactive
ResponsivenessUnresponsive