Skip to main content
Replit Agent is a browser-based AI coding agent. MCP servers are added as custom connectors from the Integrations pane, and Perfai Cloud connects as a remote streamable-http server with a custom Bearer header.
Replit connects MCP servers at the account level, not per project — a server you add once is available to Agent across every Repl you build, and Agent fetches the tool list itself.

Get an API key

Perfai Cloud authenticates Replit Agent with a Perfai API key. Create one and copy it — Perfai shows the full key only once. You’ll paste it into Replit’s authentication header as Bearer pfk_xxxxxxxxxxxx_....

Installation

This is a workspace-level setting, not a per-project one.
  1. Click your workspace name (top left) to open workspace settings, then under Workspace click Integrations.
  2. Make sure the Your integrations tab is selected, then click + Add personal MCP server.
    Replit's Integrations page, Your integrations tab, showing the Add personal MCP server button
  3. In the Connect an MCP server dialog, fill in:
    • Display name: Perfai MCP
    • MCP Server URL: https://mcp-server.perfai.ai/mcp
    • Leave Scan tool output for prompt injection checked.
    • Open Advanced settings → Custom headers → + Add header:
      • Header name: Authorization
      • Header value: Bearer pfk_xxxxxxxxxxxx_...
    The Connect an MCP server dialog with Display name, MCP Server URL, and a custom Authorization header under Advanced settings
  4. Click Test & save. Back in the Connectors table, Perfai MCP should show as connected.
Credentials go in the authentication fields only — never in the connector’s description or in Agent instructions, since those are visible in plain text.
If it fails, re-check that the header value is Bearer followed by the full key, with no trailing whitespace. If it worked before and now fails, the key has expired or been revoked — create a new one and update the connector.

Confirm you’re signed in

The API key signs you in — there is no separate login step. Every tool call runs as the user who created the key, with that user’s organizations and role. In Replit Agent’s chat, type:
It answers with the key’s id (pfk_xxxxxxxxxxxx_…), never the secret. If a tool call fails with 401, the key has expired or been revoked — create a new one and update the connector.

Use it

Tell Agent:
Registers the app and runs a security test.
Shows what it found.
Fixes everything, prioritized by severity.