MCP Setup

Give your AI agent security data tools. One JSON config, or one command.

1 Claude Desktop

In Claude Desktop, open Settings, then Developer, then Edit Config. The file is ~/Library/Application Support/Claude/claude_desktop_config.json on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows:

json{ "mcpServers": { "contrastapi": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.contrastcyber.com/mcp/"] } } }

Restart Claude Desktop. Done.

2 Cursor

Add to .cursor/mcp.json in your project root:

json{ "mcpServers": { "contrastapi": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.contrastcyber.com/mcp/"] } } }

3 Claude Code

Run this command in your terminal:

bashclaude mcp add --transport http contrastapi https://api.contrastcyber.com/mcp/

Or add a project file named .mcp.json in your project root:

json{ "mcpServers": { "contrastapi": { "type": "http", "url": "https://api.contrastcyber.com/mcp/" } } }

4 VS Code

VS Code has its own MCP file. Add it as .vscode/mcp.json in your workspace. Its top-level key is servers, not mcpServers:

json{ "servers": { "contrastapi": { "type": "http", "url": "https://api.contrastcyber.com/mcp/" } } }

5 Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json{ "mcpServers": { "contrastapi": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.contrastcyber.com/mcp/"] } } }

6 OpenClaw

Run this command in your terminal (adds ContrastAPI to OpenClaw's gateway config):

bashopenclaw mcp set contrastapi '{"url":"https://api.contrastcyber.com/mcp/","transport":"streamable-http"}'

Or edit your OpenClaw config directly and add under mcp.servers:

json{ "mcp": { "servers": { "contrastapi": { "url": "https://api.contrastcyber.com/mcp/", "transport": "streamable-http" } } } }

7 OpenCode

Add to opencode.json in your project root, or to ~/.config/opencode/opencode.json:

json{ "$schema": "https://opencode.ai/config.json", "mcp": { "contrastapi": { "type": "remote", "url": "https://api.contrastcyber.com/mcp/" } } }

8 Any MCP Client (HTTP)

Use the remote HTTP transport directly. The server answers plain JSON: no SSE stream, no session id.

httpPOST https://api.contrastcyber.com/mcp/ Content-Type: application/json Accept: application/json, text/event-stream {"jsonrpc":"2.0","id":1,"method":"initialize", "params":{"protocolVersion":"2025-11-25", "capabilities":{}, "clientInfo":{"name":"my-app","version":"1.0"}}}

9 From agent frameworks

Each snippet connects to the same server URL. Read the key from the environment. On the free tier, leave out the line that sets the Authorization header.

OpenAI Agents SDK (Python):

pythonimport os from agents import Agent from agents.mcp import MCPServerStreamableHttp server = MCPServerStreamableHttp( name="contrastapi", params={ "url": "https://api.contrastcyber.com/mcp/", "headers": {"Authorization": f"Bearer {os.environ['CONTRASTAPI_API_KEY']}"}, }, ) # Use it as: async with server: agent = Agent(name="Analyst", mcp_servers=[server])

LangChain (langchain-mcp-adapters):

pythonimport os from langchain_mcp_adapters.client import MultiServerMCPClient client = MultiServerMCPClient({ "contrastapi": { "transport": "http", "url": "https://api.contrastcyber.com/mcp/", "headers": {"Authorization": f"Bearer {os.environ['CONTRASTAPI_API_KEY']}"}, } }) tools = await client.get_tools()

Vercel AI SDK (TypeScript):

javascriptimport { createMCPClient } from '@ai-sdk/mcp'; const mcpClient = await createMCPClient({ transport: { type: 'http', url: 'https://api.contrastcyber.com/mcp/', headers: { Authorization: `Bearer ${process.env.CONTRASTAPI_API_KEY}` }, }, }); const tools = await mcpClient.tools();

n8n: add the MCP Client Tool node to an AI Agent node. Enter the server URL in the Endpoint field, choose the HTTP Streamable transport, and choose Bearer authentication for a key.

Dify: install the ContrastAPI tool plugin from the Dify Marketplace.

10 Pro API Key (optional)

Free tier (30 credits/hr) works without a key. Add a Pro key to unlock 500 credits/hr and the monitoring tools watchlist_edit and watchlist_events. The server reads the key from Authorization: Bearer or X-API-Key.

stdio transport (Claude Desktop, Cursor, Windsurf, Cline): pass the key via mcp-remote's --header flag; env holds the raw value:

json{ "mcpServers": { "contrastapi": { "command": "npx", "args": [ "-y", "mcp-remote", "https://api.contrastcyber.com/mcp/", "--header", "Authorization: Bearer ${CONTRASTAPI_API_KEY}" ], "env": { "CONTRASTAPI_API_KEY": "contrastapi_..." } } } }

HTTP transport (OpenClaw, generic HTTP clients): add headers:

json{ "mcpServers": { "contrastapi": { "url": "https://api.contrastcyber.com/mcp/", "headers": { "Authorization": "Bearer contrastapi_..." } } } }

Claude Code: add --header to the command:

bashclaude mcp add --transport http contrastapi https://api.contrastcyber.com/mcp/ \ --header "Authorization: Bearer $CONTRASTAPI_API_KEY"

VS Code: ask for the key with an input variable, so it is not stored in the file:

json{ "inputs": [ { "type": "promptString", "id": "contrastapi-key", "description": "ContrastAPI key", "password": true } ], "servers": { "contrastapi": { "type": "http", "url": "https://api.contrastcyber.com/mcp/", "headers": { "Authorization": "Bearer ${input:contrastapi-key}" } } } }

OpenCode: read the key from the environment, and set oauth to false so a refused key is not taken for an OAuth prompt:

json{ "$schema": "https://opencode.ai/config.json", "mcp": { "contrastapi": { "type": "remote", "url": "https://api.contrastcyber.com/mcp/", "oauth": false, "headers": { "Authorization": "Bearer {env:CONTRASTAPI_API_KEY}" } } } }