Skip to content

MCPs & Add-ons โ€‹

Extend OpenAI Codex's capabilities with Model Context Protocol (MCP) servers and powerful add-ons.

What is MCP? โ€‹

The Model Context Protocol (MCP) is an open standard that enables OpenAI Codex to connect to external data sources and tools. MCPs provide:

  • Real-time Data Access: Live information from databases, APIs, and services
  • Tool Integration: Connect with development tools and platforms
  • Custom Functions: Extend Claude with domain-specific capabilities
  • Secure Communication: Standardized protocol for safe data exchange

๐Ÿ—„๏ธ Database MCPs โ€‹

PostgreSQL MCP

bash
# Install
npm install -g @anthropic/mcp-postgresql

# Configure
{
  "mcpServers": {
    "postgresql": {
      "command": "mcp-postgresql",
      "args": ["--connection-string", "postgresql://localhost:5432/mydb"]
    }
  }
}

Features:

  • Query execution and result formatting
  • Schema introspection and documentation
  • Query optimization suggestions
  • Migration assistance

MongoDB MCP

bash
# Install
npm install -g @anthropic/mcp-mongodb

# Configure
{
  "mcpServers": {
    "mongodb": {
      "command": "mcp-mongodb",
      "args": ["--uri", "mongodb://localhost:27017/mydb"]
    }
  }
}

Features:

  • Document queries and aggregations
  • Index analysis and recommendations
  • Schema validation and modeling
  • Performance monitoring

๐Ÿ™ Git & Version Control MCPs โ€‹

GitHub MCP

bash
# Install
npm install -g @anthropic/mcp-github

# Configure with GitHub token
{
  "mcpServers": {
    "github": {
      "command": "mcp-github",
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      }
    }
  }
}

Capabilities:

  • Repository analysis and documentation
  • Pull request reviews and suggestions
  • Issue management and triage
  • Release planning and changelog generation

GitLab MCP

bash
# Install
npm install -g @anthropic/mcp-gitlab

# Configure
{
  "mcpServers": {
    "gitlab": {
      "command": "mcp-gitlab",
      "env": {
        "GITLAB_TOKEN": "your-gitlab-token",
        "GITLAB_URL": "https://gitlab.com"
      }
    }
  }
}

๐ŸŒ Web & API MCPs โ€‹

REST API MCP

bash
# Install
npm install -g @anthropic/mcp-rest-api

# Configure with OpenAPI spec
{
  "mcpServers": {
    "api": {
      "command": "mcp-rest-api",
      "args": ["--spec", "./openapi.yaml"]
    }
  }
}

Features:

  • API endpoint documentation
  • Request/response validation
  • Integration code generation
  • Performance testing suggestions

Web Scraping MCP

bash
# Install
npm install -g @anthropic/mcp-web-scraper

# Configure
{
  "mcpServers": {
    "webscraper": {
      "command": "mcp-web-scraper",
      "args": ["--rate-limit", "1000ms"]
    }
  }
}

โ˜๏ธ Cloud Platform MCPs โ€‹

AWS MCP

bash
# Install
npm install -g @anthropic/mcp-aws

# Configure with AWS credentials
{
  "mcpServers": {
    "aws": {
      "command": "mcp-aws",
      "env": {
        "AWS_REGION": "us-east-1",
        "AWS_PROFILE": "default"
      }
    }
  }
}

Services Supported:

  • EC2 instance management
  • S3 bucket operations
  • Lambda function deployment
  • RDS database management
  • CloudFormation template analysis

Google Cloud MCP

bash
# Install
npm install -g @anthropic/mcp-gcp

# Configure with service account
{
  "mcpServers": {
    "gcp": {
      "command": "mcp-gcp",
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
      }
    }
  }
}

Essential Add-ons โ€‹

๐Ÿงช Testing Add-ons โ€‹

Test Generator Pro

bash
npm install -g claude-code-test-generator

Features:

  • Intelligent test case generation
  • Multiple framework support (Jest, Vitest, Cypress)
  • Coverage analysis and gap identification
  • Mock generation and setup

Usage Example:

typescript
// Generate comprehensive tests
> /addon test-generator
> Generate tests for UserService with edge cases

// Results: Complete test suite with:
// - Unit tests for all methods
// - Integration tests for database operations  
// - Mock configurations
// - Error scenario coverage

Visual Testing Add-on

bash
npm install -g claude-code-visual-testing

Capabilities:

  • Screenshot comparison testing
  • UI component testing
  • Cross-browser compatibility
  • Accessibility testing

๐Ÿ”’ Security Add-ons โ€‹

Security Scanner

bash
npm install -g claude-code-security-scanner

Security Checks:

  • OWASP Top 10 vulnerability detection
  • Dependency vulnerability scanning
  • Code pattern security analysis
  • Compliance verification (SOC2, GDPR, HIPAA)

Crypto Helper

bash
npm install -g claude-code-crypto-helper

Features:

  • Secure random generation
  • Encryption/decryption utilities
  • Hash function recommendations
  • Key management best practices

โšก Performance Add-ons โ€‹

Performance Profiler

bash
npm install -g claude-code-performance-profiler

Analysis Capabilities:

  • Code complexity analysis
  • Performance bottleneck identification
  • Memory usage optimization
  • Algorithm efficiency suggestions

Bundle Analyzer

bash
npm install -g claude-code-bundle-analyzer

Features:

  • JavaScript bundle size analysis
  • Dependency tree visualization
  • Code splitting recommendations
  • Load time optimization

๐ŸŽจ Frontend Add-ons โ€‹

Component Library Generator

bash
npm install -g claude-code-component-generator

Supports:

  • React, Vue, Angular, Svelte
  • TypeScript interfaces
  • Storybook stories
  • Unit test generation

Design System Helper

bash
npm install -g claude-code-design-system

Features:

  • Design token management
  • Component consistency checking
  • Accessibility compliance
  • Style guide generation

Custom MCP Development โ€‹

Creating a Custom MCP Server โ€‹

Basic MCP Server Structure:

typescript
import { Server } from '@anthropic/mcp-sdk';

class CustomMCPServer extends Server {
  async onRequest(request: MCPRequest): Promise<MCPResponse> {
    switch (request.method) {
      case 'tools/list':
        return this.listTools();
      case 'tools/call':
        return this.callTool(request.params);
      case 'resources/list':
        return this.listResources();
      case 'resources/read':
        return this.readResource(request.params);
      default:
        throw new Error(`Unknown method: ${request.method}`);
    }
  }

  private async listTools(): Promise<MCPResponse> {
    return {
      tools: [
        {
          name: 'analyze_code',
          description: 'Analyze code for patterns and issues',
          inputSchema: {
            type: 'object',
            properties: {
              code: { type: 'string' },
              language: { type: 'string' }
            }
          }
        }
      ]
    };
  }

  private async callTool(params: any): Promise<MCPResponse> {
    const { name, arguments: args } = params;
    
    switch (name) {
      case 'analyze_code':
        return this.analyzeCode(args.code, args.language);
      default:
        throw new Error(`Unknown tool: ${name}`);
    }
  }
}

Example: Database MCP Server

typescript
class DatabaseMCPServer extends Server {
  private connection: DatabaseConnection;

  constructor(connectionString: string) {
    super();
    this.connection = new DatabaseConnection(connectionString);
  }

  async listTools() {
    return {
      tools: [
        {
          name: 'execute_query',
          description: 'Execute SQL query and return results',
          inputSchema: {
            type: 'object',
            properties: {
              query: { type: 'string' },
              limit: { type: 'number', default: 100 }
            }
          }
        },
        {
          name: 'describe_table',
          description: 'Get table schema information',
          inputSchema: {
            type: 'object',
            properties: {
              tableName: { type: 'string' }
            }
          }
        }
      ]
    };
  }

  async callTool(params: any) {
    const { name, arguments: args } = params;
    
    switch (name) {
      case 'execute_query':
        const results = await this.connection.query(args.query, args.limit);
        return {
          content: [
            {
              type: 'text',
              text: this.formatQueryResults(results)
            }
          ]
        };
        
      case 'describe_table':
        const schema = await this.connection.describeTable(args.tableName);
        return {
          content: [
            {
              type: 'text',
              text: this.formatTableSchema(schema)
            }
          ]
        };
    }
  }
}

Publishing Your MCP โ€‹

Package Configuration:

json
{
  "name": "@yourorg/mcp-custom-tool",
  "version": "1.0.0",
  "main": "dist/index.js",
  "bin": {
    "mcp-custom-tool": "dist/cli.js"
  },
  "keywords": ["mcp", "claude-code", "tool"],
  "peerDependencies": {
    "@anthropic/mcp-sdk": "^1.0.0"
  }
}

CLI Entry Point:

typescript
#!/usr/bin/env node
import { CustomMCPServer } from './server.js';

const server = new CustomMCPServer(process.argv[2]);
server.start();

Configuration Management โ€‹

MCP Server Configuration โ€‹

Global Configuration:

json
{
  "mcpServers": {
    "database": {
      "command": "mcp-postgresql",
      "args": ["--connection-string", "postgresql://localhost:5432/mydb"],
      "env": {
        "PGPASSWORD": "password"
      }
    },
    "github": {
      "command": "mcp-github",
      "env": {
        "GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    },
    "aws": {
      "command": "mcp-aws",
      "args": ["--region", "us-east-1"],
      "env": {
        "AWS_PROFILE": "development"
      }
    }
  }
}

Project-Specific Configuration:

json
{
  "mcpServers": {
    "project-db": {
      "command": "mcp-postgresql",
      "args": ["--connection-string", "$DATABASE_URL"],
      "workingDirectory": "./scripts"
    },
    "local-api": {
      "command": "mcp-rest-api",
      "args": ["--spec", "./api/openapi.yaml", "--base-url", "http://localhost:3000"]
    }
  }
}

Environment-Specific Settings โ€‹

Development:

json
{
  "mcpServers": {
    "database": {
      "args": ["--connection-string", "postgresql://localhost:5432/myapp_dev"]
    }
  }
}

Production:

json
{
  "mcpServers": {
    "database": {
      "args": ["--connection-string", "$PROD_DATABASE_URL"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}

Best Practices โ€‹

Security Guidelines โ€‹

API Key Management:

bash
# Use environment variables
export GITHUB_TOKEN="your-token"
export AWS_ACCESS_KEY_ID="your-key"

# Never commit secrets to configuration files
# Use .env files that are gitignored

Access Control:

json
{
  "mcpServers": {
    "production-db": {
      "command": "mcp-postgresql",
      "args": ["--readonly", "--connection-string", "$PROD_DB_URL"]
    }
  }
}

Performance Optimization โ€‹

Connection Pooling:

json
{
  "mcpServers": {
    "database": {
      "command": "mcp-postgresql",
      "args": [
        "--connection-string", "$DATABASE_URL",
        "--pool-size", "10",
        "--timeout", "30000"
      ]
    }
  }
}

Caching Configuration:

json
{
  "mcpServers": {
    "api": {
      "command": "mcp-rest-api",
      "args": [
        "--spec", "./openapi.yaml",
        "--cache-ttl", "300",
        "--max-cache-size", "100MB"
      ]
    }
  }
}

Troubleshooting โ€‹

Common Issues โ€‹

MCP Server Not Starting:

bash
# Check if command exists
which mcp-postgresql

# Verify configuration
claude-code config validate

# Check logs
claude-code logs --mcp-server database

Connection Timeouts:

json
{
  "mcpServers": {
    "database": {
      "args": ["--timeout", "60000"],
      "healthCheck": {
        "enabled": true,
        "interval": 30000
      }
    }
  }
}

Permission Errors:

bash
# Fix file permissions
chmod +x /usr/local/bin/mcp-custom-tool

# Verify environment variables
env | grep -E "(API_KEY|TOKEN|PASSWORD)"

Ready to supercharge OpenAI Codex? Start with the GitHub MCP for seamless repository integration!