SDKs & ToolsMCP Server

MCP Server

The Surfinguard MCP (Model Context Protocol) Server exposes all 18 analyzers as tools that AI assistants can call directly. It runs locally using the CoreEngine with zero network dependencies.

What is MCP?

The Model Context Protocol is an open standard for connecting AI assistants to external tools and data sources. When you configure Surfinguard as an MCP server, AI assistants like Claude Desktop and Cursor can automatically check actions for security risks before executing them.

Setup

Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "surfinguard": {
      "command": "npx",
      "args": ["@surfinguard/mcp-server"]
    }
  }
}

Cursor

Add to your Cursor MCP configuration (.cursor/mcp.json in your project):

{
  "mcpServers": {
    "surfinguard": {
      "command": "npx",
      "args": ["@surfinguard/mcp-server"]
    }
  }
}

VS Code (with MCP extension)

Add to your VS Code settings or MCP configuration:

{
  "mcpServers": {
    "surfinguard": {
      "command": "npx",
      "args": ["@surfinguard/mcp-server"]
    }
  }
}

Running Manually

You can also start the server directly:

npx @surfinguard/mcp-server

Or if installed globally:

surfinguard mcp-server

Available Tools

The MCP server exposes 19 tools (18 typed + 1 universal):

Universal Tool

ToolParametersDescription
surfinguard_checktype, value, metadata?Check any action type

Typed Tools

ToolParametersDescription
surfinguard_check_urlurlCheck a URL for phishing/scam indicators
surfinguard_check_commandcommandCheck a shell command for dangerous operations
surfinguard_check_texttextCheck text for prompt injection
surfinguard_check_file_readpathCheck if reading a file path is safe
surfinguard_check_file_writepath, content?Check if writing to a file path is safe
surfinguard_check_api_callvalue, metadata?Check an API call for SSRF, credential forwarding
surfinguard_check_queryqueryCheck a database query for injection/exfiltration
surfinguard_check_codecode, metadata?Check code for malicious patterns
surfinguard_check_messagemessage, metadata?Check a message for social engineering
surfinguard_check_transactionvalue, metadata?Check a financial transaction
surfinguard_check_authvalue, metadata?Check an authentication action
surfinguard_check_gitvalue, metadata?Check a Git operation
surfinguard_check_ui_actionvalue, metadata?Check a UI interaction
surfinguard_check_infravalue, metadata?Check an infrastructure operation
surfinguard_check_agent_commvalue, metadata?Check agent communication
surfinguard_check_data_pipelinevalue, metadata?Check a data pipeline operation
surfinguard_check_documentvalue, metadata?Check a document operation
surfinguard_check_iotvalue, metadata?Check an IoT device command

Tool Response Format

Each tool returns a structured response:

{
  "score": 9,
  "level": "DANGER",
  "primitives": {
    "DESTRUCTION": 0,
    "EXFILTRATION": 4,
    "ESCALATION": 0,
    "PERSISTENCE": 0,
    "MANIPULATION": 9
  },
  "reasons": [
    "Brand impersonation: google",
    "Risky TLD: .tk",
    "Suspicious path: /verify"
  ],
  "threats": [
    { "id": "U05", "name": "Brand impersonation", "score": 5, "primitive": "MANIPULATION" },
    { "id": "U04", "name": "Risky TLD", "score": 3, "primitive": "MANIPULATION" }
  ]
}

How It Works

The MCP server uses the stdio transport protocol. When an AI assistant starts a session:

  1. The server initializes the CoreEngine with all 18 analyzers
  2. Tools are registered and advertised to the AI assistant
  3. When the assistant calls a tool, the CoreEngine analyzes the action locally
  4. The result is returned to the assistant, which can use it to make decisions

All analysis happens locally — no data is sent to any external server. This makes the MCP server suitable for sensitive environments where data cannot leave the machine.

Example Usage in Claude

Once configured, Claude will automatically have access to the Surfinguard tools. You can ask it to check actions:

“Check if this URL is safe: https://paypa1-verify.tk/login

Claude will call surfinguard_check_url and report the findings:

The URL has been flagged as DANGER (score: 9). Detected threats:

  • Brand impersonation of PayPal (U05)
  • Risky TLD .tk (U04)
  • Suspicious path /login (U07)

This URL should not be visited.