🔌 MCP Server

MCP Server Integration

Use ProtectMyAPI with AI assistants like Claude, Cursor, and GitHub Copilot through the Model Context Protocol (MCP).

🤖

MCP allows AI assistants to generate integration code using your actual app configuration.


What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely access external tools and data sources. With our MCP server:

  • AI assistants can see your apps, endpoints, and secrets
  • Generate platform-specific code with your real App Token
  • Help you troubleshoot integration issues
  • Provide contextual documentation

Supported AI Tools


Installation

Claude Desktop

Open Claude Desktop settings

Click the menu icon → Settings → Developer

Enable MCP

Toggle on “Enable Model Context Protocol”

Add server configuration

Edit the config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "protectmyapi": {
      "command": "npx",
      "args": ["-y", "@protectmyapi/mcp-server"]
    }
  }
}

Restart Claude Desktop

Close and reopen the app to load the MCP server.

Cursor IDE

Open Cursor settings

Cmd/Ctrl + , → Search “MCP”

Add MCP server

In the MCP Servers section, click “Add Server”

Configure

{
  "name": "protectmyapi",
  "command": "npx",
  "args": ["-y", "@protectmyapi/mcp-server"]
}

Save and restart

Cursor will automatically connect to the MCP server.

VS Code + Copilot

Install MCP extension

Search for “MCP” in the Extensions marketplace

Configure in settings.json

{
  "mcp.servers": {
    "protectmyapi": {
      "command": "npx",
      "args": ["-y", "@protectmyapi/mcp-server"]
    }
  }
}

Reload VS Code

The MCP server will be available to Copilot.

Other MCP Clients

Any MCP-compatible client can use our server:

{
  "command": "npx",
  "args": ["-y", "@protectmyapi/mcp-server"]
}

Or run directly:

npx @protectmyapi/mcp-server

Authentication

Before using MCP tools, authenticate with your API key:

Get Your API Key

  1. Go to ProtectMyAPI Dashboard
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Copy the key (it won’t be shown again)

Authenticate in AI Assistant

Ask your AI assistant:

“Authenticate with ProtectMyAPI using API key: pma_xxxxxxxxxxxx”

Or the AI will prompt you when needed.


Available Tools

Once connected, these tools are available to your AI assistant:

authenticate

Authenticate with your API key to access your data.

Example prompt:

“Connect to ProtectMyAPI with my API key”

list_apps

List all apps in your organization.

Example prompt:

“Show me all my ProtectMyAPI apps”

get_app

Get detailed configuration for a specific app.

Example prompt:

“Get details for my iOS app”

list_endpoints

List all configured API endpoints.

Example prompt:

“What endpoints do I have configured?”

list_secrets

List secret names (not values) in your account.

Example prompt:

“Show me my configured secrets”

generate_integration_code

Generate platform-specific SDK code.

Example prompt:

“Generate Swift code to call my OpenAI chat endpoint”


Example Workflows

Generate iOS Integration Code

I need to add ProtectMyAPI to my iOS app. Generate the 
complete setup code for making requests to my OpenAI 
chat completions endpoint.

Troubleshoot Integration Issues

I'm getting ATTESTATION_FAILED errors in my Android app. 
Can you help me debug this using my ProtectMyAPI configuration?

The AI will:

  1. Check your app configuration
  2. Verify Play Integrity settings
  3. Suggest specific fixes based on your setup

Set Up a New Endpoint

I want to add the Anthropic Claude API to my ProtectMyAPI 
configuration. Show me how to set it up and generate the 
Flutter code to use it.

Available Resources

The MCP server also provides documentation resources:

URIDescription
protectmyapi://docs/quick-startGetting started guide
protectmyapi://docs/ios-sdkiOS SDK documentation
protectmyapi://docs/android-sdkAndroid SDK documentation
protectmyapi://docs/flutter-sdkFlutter SDK documentation
protectmyapi://docs/react-native-sdkReact Native SDK documentation
protectmyapi://docs/troubleshootingCommon issues and solutions

Ask the AI to read these for context:

“Read the iOS SDK documentation and help me integrate ProtectMyAPI”


Security Considerations

What the AI Can Access

  • ✅ App names and configurations
  • ✅ Endpoint slugs and settings
  • ✅ Secret names (not values)
  • ✅ Organization structure

What the AI Cannot Access

  • ❌ Actual secret values
  • ❌ API keys after initial auth
  • ❌ Request/response logs
  • ❌ Billing information

API Key Safety

  • API keys are only used for authentication
  • Keys are not stored by the MCP server
  • Session expires after 1 hour of inactivity
  • Revoke keys anytime in the dashboard

Local Development

For contributing or testing:

# Clone the repo
git clone https://github.com/protectmyapi/protectmyapi.git
cd protectmyapi/packages/mcp-server
 
# Install dependencies
npm install
 
# Run in development mode
npm run dev
 
# Run tests
npm test

Environment Variables

VariableDescription
PROTECTMYAPI_BASE_URLAPI base URL (default: https://api.protectmyapi.com)
DEBUGEnable debug logging

Troubleshooting

MCP Server Not Connecting

  1. Verify installation:

    npx @protectmyapi/mcp-server --version
  2. Check config format: Ensure JSON is valid

  3. Restart the AI client: Changes require restart

  4. Check logs:

    • Claude: ~/Library/Logs/Claude/mcp.log
    • Cursor: Developer Tools → Console

Authentication Fails

  1. Verify API key: Check it’s not expired in dashboard
  2. Check permissions: Key needs read access
  3. Try regenerating: Create a new key if needed

Tools Not Appearing

  1. Wait for connection: Initial connection takes ~5 seconds
  2. Check server status: Run manually to see errors
    npx @protectmyapi/mcp-server
  3. Update the package:
    npx @protectmyapi/mcp-server@latest

Feedback

Have suggestions for MCP tools or prompts?