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!
📸 Screenshot needed: api-key-create.png
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
📸 Screenshot needed: vscode-claude-extension.png
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
📸 Screenshot needed: vscode-claude-mcp-config.png
Verify Connection¶
CLI:
Expected output:
✓ preloop (https://preloop.ai/mcp/v1)
- Status: Connected
- Tools available: 7
- Last synced: 2 seconds ago
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
📸 Screenshot needed: claude-code-connected.png
Test Tool Discovery¶
CLI:
You should see tools like:
- 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
📸 Screenshot needed: vscode-cline-extension.png
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
📸 Screenshot needed: cline-mcp-settings.png
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
📸 Screenshot needed: cline-connected.png
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
📸 Screenshot needed: zed-mcp-config.png
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
📸 Screenshot needed: zed-mcp-connected.png
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?
Connection Details¶
Endpoint:
Transport:
Authentication:
Required Headers:
MCP Protocol Methods¶
Preloop supports all standard MCP methods:
Discovery:
- tools/list - Get available tools
- tools/call - Execute a tool
Notifications:
- notifications/progress - Tool execution progress
- notifications/cancelled - Tool execution cancelled
Resources (Optional):
- resources/list - List available resources
- resources/read - Read a specific resource
Example: Python Client¶
import requests
API_KEY = "sk_live_abc123..."
BASE_URL = "https://preloop.ai/mcp/v1"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# List available tools
response = requests.post(
f"{BASE_URL}/tools/list",
headers=headers,
json={}
)
tools = response.json()
print(f"Available tools: {len(tools['tools'])}")
# Call a tool
response = requests.post(
f"{BASE_URL}/tools/call",
headers=headers,
json={
"name": "pay",
"arguments": {
"recipient": "alice@example.com",
"amount": 500
}
}
)
result = response.json()
if result.get("requires_approval"):
print(f"Approval required! Request ID: {result['approval_request_id']}")
print(f"Check your email or dashboard to approve.")
else:
print(f"Tool executed: {result['result']}")
Example: Node.js Client¶
const axios = require('axios');
const API_KEY = 'sk_live_abc123...';
const BASE_URL = 'https://preloop.ai/mcp/v1';
const headers = {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
};
// List tools
async function listTools() {
const response = await axios.post(
`${BASE_URL}/tools/list`,
{},
{ headers }
);
return response.data.tools;
}
// Call a tool
async function callTool(name, args) {
const response = await axios.post(
`${BASE_URL}/tools/call`,
{ name, arguments: args },
{ headers }
);
return response.data;
}
// Usage
(async () => {
const tools = await listTools();
console.log(`Available tools: ${tools.length}`);
const result = await callTool('pay', {
recipient: 'alice@example.com',
amount: 500
});
if (result.requires_approval) {
console.log('Approval required!');
console.log(`Request ID: ${result.approval_request_id}`);
} else {
console.log('Tool executed:', result.result);
}
})();
Testing Your Client¶
-
Test connection:
-
Verify tool discovery:
- Should return list of available tools
- Check for
request_approval(always available) -
Check for tools from your MCP servers
-
Test tool call:
-
Check approval flow:
- Should receive approval request
- Check email/dashboard
- Approve or decline
- Client should receive result
Next Steps¶
Next: Test Your Workflow - Verify your setup works correctly.