Skip to main content
The Perfai MCP server (perfai-cloud-mcp) connects Perfai to your AI coding assistant via the Model Context Protocol. Once installed, you can register an app, run a security scan, review vulnerabilities, and get AI-powered fix prompts and auto-fix instructions — all without leaving your editor.
Where to run Perfai commands: every Perfai action — Login to Perfai, Run a security test, Show me the vulnerabilities it found, and so on — is a natural-language prompt you type into your code agent’s chat (Claude Code, Cursor, VS Code Copilot Agent Mode, Windsurf, or Zed). They are not terminal commands. Only the one-time installation steps (npx, claude mcp add, editing a config file) run in a shell.

Claude Code

One-command setup via the claude mcp add CLI.

Claude

The chat app, not Claude Code — custom connector via Settings.

Cursor

Global or per-project config via .cursor/mcp.json.

VS Code (Copilot Agent Mode)

Add to .vscode/mcp.json or user settings.

Windsurf

Drop the config in ~/.codeium/windsurf/mcp_config.json.

Zed

Register via context_servers in Zed’s settings.json.

Postman

Native MCP request type and call tools directly.

AWS Kiro

Amazon’s AI IDE — successor to Amazon Q Developer. Config via mcp.json.

Cline

VS Code extension for autonomous coding. Config via cline_mcp_settings.json.

LM Studio

Local model runner — add via the Program tab’s mcp.json.

Continue.dev

VS Code / JetBrains extension. Config via .continue/mcpServers/.

Replit

Browser-based agent — custom connector via the Integrations pane.

Lovable

Browser-based app builder — custom connector via the Connectors dashboard.

Bolt

Browser-based app builder — custom connector via account-level Connectors.

IBM Bob

Standalone AI coding IDE. Config via mcp.json, global or per-project.

Generic MCP client

Works with any client that supports stdio MCP servers.

Requirements

  • Node.js 18 or later — run node --version to check.
  • A Perfai account — sign up at cloud.perfai.ai.

The command

The Perfai MCP server is published as perfai-cloud-mcp. Launch it with npx:
In a JSON config file this becomes:
On Windows, some MCP hosts fail to spawn npx directly with a spawn npx ENOENT error, because npx is a .cmd shim rather than an executable. If you hit this, wrap it through cmd: "command": "cmd", "args": ["/c", "npx", "-y", "perfai-cloud-mcp"].

How authentication works

How you sign in depends on how your client runs Perfai MCP:
  • Local clients (Claude Code, Cursor, VS Code, Windsurf, Zed, and other stdio clients) launch perfai-cloud-mcp on your machine. Browser login is the default. For headless machines and CI, set a Perfai API key as PERFAI_API_KEY instead.
  • Remote clients (Postman, AWS Kiro, Cline, LM Studio, Continue.dev, Replit, Lovable, Bolt, IBM Bob) connect to https://mcp-server.perfai.ai/mcp. They authenticate with a Perfai API key, sent as Authorization: Bearer pfk_xxxxxxxxxxxx_... or pasted into the client’s API Key / Bearer token field.

Browser login (local clients)

Calling login with no arguments opens a browser to Perfai’s own sign-in page (OAuth) and completes the session automatically. No credentials go in your config.
1

Run the login tool

Ask your AI assistant: “Login to Perfai”. A browser window opens to Perfai’s sign-in page. If that browser already has an active cloud.perfai.ai session, this can complete silently via SSO with no prompt at all.
2

Confirm you're authenticated

Ask “What’s my Perfai auth status?” — once it reports authenticated, the protected tools become available.
3

Register your app

Register the app you want to test by URL. All security-testing and vulnerability tools operate on the currently selected app.

API key in the env block (local clients)

To skip the browser, create an API key and add it to the server’s env block:
PERFAI_TOKEN also accepts an API key, so you can paste a key into an existing PERFAI_TOKEN entry.
Local clients still read PERFAI_EMAIL / PERFAI_PASSWORD from the env block as a fallback. That stores your password in a config file, so use an API key instead.
If you put an API key in a config file, treat that file like a secret — don’t commit it to a shared repository. Prefer user-scoped (global) config over project-scoped config for anything containing a key.
Base64 email:password Bearer values are deprecated and will be removed. If a remote client still sends Authorization: Bearer <base64 of email:password>, replace that value with an API key.

Create an API key

A Perfai API key (pfk_<key id>_<secret>) is a personal credential for MCP clients:
  • It acts as you. The key has the same organizations and role as the user who created it. A Viewer’s key can’t dismiss or fix findings. Organization selection works the same as with a normal login.
  • It’s shown once. Perfai returns the full key only in the creation response. Copy it straight into your client config.
  • It expires. Keys last 90 days by default. You can set up to 365 days.
  • It’s revocable. Revoke a key at any time and it stops working.
  • You can hold up to 10 active keys. Use one key per client or machine, so you can revoke one without breaking the others.
  1. Log into cloud.perfai.ai.
  2. In the left sidebar, click API Keys.
  3. Click + Create key.
  4. Name: something that identifies where it’s used, e.g. Cursor or Replit.
  5. Expires after (days): optional — leave blank for the 90-day default, or set up to 365.
  6. Click Create key and copy the value immediately — it’s shown once, right after creation, and never shown again. Store it like a password.
Paste that value into your client’s config exactly as-is. Each client page shows where it goes.

List and revoke keys

The same API Keys page lists every key you’ve created, with its creation date, expiry, and last-used time. Click Revoke next to any key to disable it immediately — the list never shows a key’s secret again. If you lose a key, revoke it and create a new one.

Troubleshooting API keys


Tools

Only login and auth_status are available before you authenticate. After login, all of the following become available:

Authentication

Organization management

App management

Security testing

Vulnerability management


Typical workflow

1

Log in

Login to Perfai
2

Register your app

Register https://myapp.com with Perfai
3

Run a security test

Run a security test on the selected app
4

Review the findings

Show me the vulnerabilities it found
5

Fix and verify

Auto-fix all critical and high vulnerabilities, then confirm each one: Mark vulnerability 3 as fixed

Registering an app and running a scan


Fixing vulnerabilities

One at a time:
All at once, prioritized by severity:
After applying a fix, mark it done and verify progress:

Useful prompts


Next steps

Pick your editor to get started: