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-serverAuthentication
Before using MCP tools, authenticate with your API key:
Get Your API Key
- Go to ProtectMyAPI Dashboard
- Navigate to Settings â API Keys
- Click Create API Key
- 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:
- Check your app configuration
- Verify Play Integrity settings
- 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:
| URI | Description |
|---|---|
protectmyapi://docs/quick-start | Getting started guide |
protectmyapi://docs/ios-sdk | iOS SDK documentation |
protectmyapi://docs/android-sdk | Android SDK documentation |
protectmyapi://docs/flutter-sdk | Flutter SDK documentation |
protectmyapi://docs/react-native-sdk | React Native SDK documentation |
protectmyapi://docs/troubleshooting | Common 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 testEnvironment Variables
| Variable | Description |
|---|---|
PROTECTMYAPI_BASE_URL | API base URL (default: https://api.protectmyapi.com) |
DEBUG | Enable debug logging |
Troubleshooting
MCP Server Not Connecting
-
Verify installation:
npx @protectmyapi/mcp-server --version -
Check config format: Ensure JSON is valid
-
Restart the AI client: Changes require restart
-
Check logs:
- Claude:
~/Library/Logs/Claude/mcp.log - Cursor: Developer Tools â Console
- Claude:
Authentication Fails
- Verify API key: Check itâs not expired in dashboard
- Check permissions: Key needs read access
- Try regenerating: Create a new key if needed
Tools Not Appearing
- Wait for connection: Initial connection takes ~5 seconds
- Check server status: Run manually to see errors
npx @protectmyapi/mcp-server - Update the package:
npx @protectmyapi/mcp-server@latest
Feedback
Have suggestions for MCP tools or prompts?