Connect Your MCP Client¶
Learn how to connect Claude Code, Cline, Zed, or any MCP-compatible client to Preloop.
Overview¶
MCP clients are applications that can discover and use tools through the MCP (Model Context Protocol). Once connected to Preloop, these clients can use your prelooped tools with approval workflows automatically enforced.
Popular MCP Clients:
- OpenClaw - Managed local agent onboarding with gateway-aware model routing
- OpenCode - Multi-provider coding agent with native MCP support
- Claude Code - Anthropic's official CLI and VS Code extension
- Codex CLI - OpenAI's official CLI client
- Gemini CLI - Google's terminal agent with native MCP support
- Hermes - Nous Research's autonomous coding agent (
~/.hermes/config.yaml) - Cursor, Windsurf, Antigravity, Zed - Modern code editors with built-in MCP support
- Custom Clients - Any application implementing MCP protocol
What you'll need: - Preloop account (see Creating Your Account) - API key from Preloop - MCP client installed
If you already use a supported local agent, you can often start with discovery instead of configuring everything by hand:
Discovery can inspect local configurations for OpenClaw, OpenCode, Claude Code, Codex CLI, Gemini CLI, and Hermes. On supported managed onboarding paths, Preloop can import the agent's configured tools and AI model metadata into your account and reconfigure the local runtime to use the Preloop Gateway and Preloop Tool Firewall.
Quick Start¶
1. Get Your API Key¶
- Log in to preloop.ai
- Go to Settings → API Keys
- Click + Create API Key
- Give it a name (e.g., "Claude Code")
- Click Create and copy the key
- Save it somewhere safe - you won't see it again!
2. Choose Your Client¶
Select your MCP client below for specific setup instructions:
- Claude Code - Recommended for beginners
- Cline (VS Code)
- Zed Editor
- Custom/Other Clients
Claude Code¶
Claude Code is Anthropic's official MCP client available as: - CLI tool for terminal use - VS Code extension for in-editor assistance
Installation¶
Option 1: CLI (Terminal)
Option 2: VS Code Extension
- Open VS Code
- Go to Extensions (Cmd+Shift+X or Ctrl+Shift+X)
- Search for "Claude Code"
- Click Install
Configuration¶
CLI Configuration:
claude mcp add \
--transport http \
--header "Authorization: Bearer YOUR_API_KEY_HERE" \
preloop \
https://preloop.ai/mcp/v1
Replace YOUR_API_KEY_HERE with your actual API key.
VS Code Configuration:
- Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
- Type "Claude Code: Configure MCP Server"
- Fill in the form:
- Name:
preloop - URL:
https://preloop.ai/mcp/v1 - Transport:
http-streaming - Authentication:
Bearer Token -
Token: Your API key
-
Click Save
Verify Connection¶
CLI:
Output (illustrative):
VS Code:
- Open Claude Code panel
- Look for "MCP Servers" section
- You should see "preloop" with green checkmark
- Click to expand and see available tools
Test Tool Discovery¶
CLI:
You should see tools like (illustrative — depends on your configuration):
- request_approval (always available)
- pay (if you added example MCP server)
- create_issue, update_issue (if trackers connected)
VS Code:
- In Claude Code chat, type:
@preloop - You should see tool suggestions
- Try: "Using @preloop, show me available tools"
Usage¶
CLI:
VS Code:
In the Claude Code chat panel:
If the pay tool is prelooped, you'll get an approval request!
Cline (VS Code)¶
Cline is a popular VS Code extension for AI-powered coding assistance with MCP support.
Installation¶
- Open VS Code
- Go to Extensions (Cmd+Shift+X or Ctrl+Shift+X)
- Search for "Cline"
- Click Install
Configuration¶
Method 1: Via Settings UI¶
- Open Cline settings:
- Click Cline icon in sidebar
- Click gear icon (⚙️) in top-right
-
Go to "MCP Servers" tab
-
Click + Add MCP Server
-
Fill in the form:
-
Click Save and Test Connection
Method 2: Via Configuration File¶
- Open VS Code settings.json:
- Cmd+Shift+P (or Ctrl+Shift+P)
-
Type "Preferences: Open Settings (JSON)"
-
Add MCP server configuration:
{
"cline.mcpServers": {
"preloop": {
"url": "https://preloop.ai/mcp/v1",
"transport": "http-streaming",
"headers": {
"Authorization": "Bearer YOUR_API_KEY_HERE"
}
}
}
}
- Save and reload VS Code
Verify Connection¶
- Open Cline panel (click Cline icon in sidebar)
- Look for "Connected MCP Servers" section
- You should see "Preloop" with green status
- Click to expand and verify tools are listed
Usage¶
In the Cline chat:
Or reference specific tools:
Zed Editor¶
Zed is a modern code editor with native MCP support built-in.
Installation¶
Download from zed.dev
macOS:
Linux:
Windows: Download installer from zed.dev/download
Configuration¶
- Open Zed
- Go to Zed → Settings (or Cmd+, / Ctrl+,)
- Click MCP Servers in the sidebar
- Click + Add Server
- Fill in the form:
Name: Preloop
URL: https://preloop.ai/mcp/v1
Transport: http-streaming
Headers:
Authorization: Bearer YOUR_API_KEY_HERE
- Click Save
Alternative: Configuration File¶
Zed stores MCP config in ~/.config/zed/mcp.json:
{
"servers": {
"preloop": {
"url": "https://preloop.ai/mcp/v1",
"transport": "http-streaming",
"headers": {
"Authorization": "Bearer YOUR_API_KEY_HERE"
}
}
}
}
Verify Connection¶
- Open Command Palette: Cmd+Shift+P (or Ctrl+Shift+P)
- Type "MCP: List Servers"
- You should see "preloop" with status "Connected"
- Type "MCP: List Tools"
- Select "preloop"
- Verify tools are shown
Usage¶
Zed's AI assistant can use MCP tools:
- Open AI panel: Cmd+Shift+A (or Ctrl+Shift+A)
- In the chat:
Or invoke tools directly:
Custom Clients¶
Building your own MCP client or using a different MCP-compatible tool?
https://preloop.ai/mcp/v1 is a single streamable-HTTP MCP endpoint speaking JSON-RPC 2.0. Any MCP SDK client (Python mcp, TypeScript @modelcontextprotocol/sdk, etc.) works against it — point the SDK's streamable-HTTP transport at the URL and set an Authorization: Bearer YOUR_API_KEY header. There are no REST-style sub-paths; all methods (initialize, tools/list, tools/call, ...) are JSON-RPC messages POSTed to the same URL.
Minimal curl Example¶
Initialize the session:
curl -X POST https://preloop.ai/mcp/v1 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"my-client","version":"1.0"}}}'
Then call a tool (reuse the session ID returned in the Mcp-Session-Id response header):
curl -X POST https://preloop.ai/mcp/v1 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: SESSION_ID_FROM_INITIALIZE" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"request_approval","arguments":{"reason":"Testing my custom MCP client"}}}'
If the tool is prelooped, the call blocks until the approval is granted or declined — approval enforcement happens server-side, and your client just sees the final tool result (or an error if declined).
Next Steps¶
Next: Test Your Workflow - Verify your setup works correctly.