Using Claude as a BinaryLane Agent with MCP

This guide shows you how to connect Claude (by Anthropic) directly to your BinaryLane account, turning it into an AI agent that can manage your servers, DNS, load balancers, VPCs, and more — all through natural conversation.

This is made possible by two open-source Model Context Protocol (MCP) servers that give Claude the tools to interact with the BinaryLane API and SSH into your servers.

GitHub: binarylane-mcp | ssh-mcp


What is MCP?


The Model Context Protocol (MCP) is an open standard that lets AI assistants like Claude use external tools. Without MCP, Claude can only talk about your infrastructure. With MCP, Claude can actually manage it — listing servers, creating DNS records, configuring firewalls, and more.

This guide uses two MCP servers that work together:

MCP ServerWhat It Does
binarylane-mcpConnects Claude to the BinaryLane API — 86 tools covering servers, DNS, VPCs, load balancers, images, SSH keys, and account management
ssh-mcpGives Claude SSH access to your servers — run commands, read files, upload configs. Auto-discovers your BinaryLane servers by name so Claude can just say "connect to web-1" instead of needing IP addresses





⚠️ Security Considerations

Important: These MCP servers give Claude real access to your BinaryLane account and servers. Claude can create, modify, and delete resources. Treat this integration with the same care you would give any API token or SSH key.


Risks on Production Servers

Before connecting Claude to production infrastructure, understand these risks:

  • Destructive actions are real — if Claude deletes a server, it's gone. If it modifies a firewall incorrectly, you could lose access.
  • SSH commands execute as root (by default) — Claude has the same privileges as your SSH user. A misunderstood instruction could modify or delete critical files.
  • API token = full account access — your BinaryLane API token grants access to every server and resource on your account.
  • Billing impact — Claude can create servers and resources that incur charges on your account.

Recommendation: Start by using these tools on development or test servers. Get familiar with how Claude interacts with your infrastructure before connecting it to anything critical.


Built-In Safety Features

Both MCP servers include safety mechanisms designed to reduce risk:

FeatureHow It Protects You
Tool AnnotationsEvery tool is tagged as read-only, destructive, or idempotent. Claude (and Claude Desktop) uses these hints to warn you before dangerous actions and to ask for confirmation.
Audit LoggingAll destructive operations (server deletion, firewall changes, etc.) are logged with timestamps and parameters for traceability.
Input ValidationEvery request is validated before being sent to the API. Invalid server names, bad port numbers, or malformed inputs are rejected with clear error messages.
Rate LimitingMaximum of 5 concurrent API requests with automatic queuing, preventing runaway operations.
Retry with BackoffFailed requests are retried with exponential backoff (up to 3 retries), not hammered repeatedly.
Token ValidationAPI token format is checked at startup. If it's missing or malformed, the server refuses to start rather than failing silently.
Claude Desktop ConfirmationWhen using Claude Desktop, you are prompted to approve tool calls before they execute. You always have the chance to review and deny any action.



Note: These MCP servers are community-developed open-source tools, not official BinaryLane products. BinaryLane support cannot assist with MCP-specific issues. For help, visit the GitHub repositories.



Prerequisites


RequirementDetails
BinaryLane AccountWith an API token from home.binarylane.com.au/api-info
Node.js 18+Check with node --version. Download from nodejs.org
GitTo clone the repositories. Check with git --version
Claude DesktopDownload from claude.ai/download (macOS or Windows)
SSH KeyFor the ssh-mcp server to connect to your BinaryLane servers. The key must already be added to your servers.




Step 1: Get Your BinaryLane API Token

  1. Log in to the BinaryLane Dashboard
  2. Navigate to Account → API Info (or go directly to home.binarylane.com.au/api-info)
  3. Copy your API token and save it somewhere secure

Keep your API token secret. Anyone with this token has full access to your BinaryLane account. Do not commit it to version control or share it publicly.




Step 2: Install the BinaryLane MCP Server


Open a terminal and run:

git clone https://github.com/termau/binarylane-mcp.git
cd binarylane-mcp
npm install
npm run build

Note the full path to the built server — you'll need it for configuration. For example:

  • macOS/Linux:/home/youruser/binarylane-mcp/dist/index.js
  • Windows:C:\Users\youruser\binarylane-mcp\dist\index.js

To verify the build succeeded:

ls dist/index.js




Step 3: Install the SSH MCP Server

In a separate directory:

git clone https://github.com/termau/ssh-mcp.git
cd ssh-mcp
npm install
npm run build

The SSH MCP server works hand-in-hand with the BinaryLane MCP. When given the same API token, it automatically discovers all your BinaryLane servers and makes them available to Claude by name. No manual IP configuration needed.



Step 4: Configure Claude Desktop


Open the Claude Desktop configuration file:

PlatformConfig File Location
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json


Add both MCP servers to the configuration. Replace the paths and token with your own:

{
  "mcpServers": {
    "binarylane": {
      "command": "node",
      "args": ["/path/to/binarylane-mcp/dist/index.js"],
      "env": {
        "BINARYLANE_API_TOKEN": "your-api-token-here"
      }
    },
    "ssh": {
      "command": "node",
      "args": ["/path/to/ssh-mcp/dist/index.js"],
      "env": {
        "BINARYLANE_API_TOKEN": "your-api-token-here"
      }
    }
  }
}



Both servers use the same API token. The BinaryLane MCP uses it to manage resources via the API. The SSH MCP uses it to auto-discover your server names and IPs, so Claude can connect to them by name (e.g., "SSH into web-1") instead of by IP address.



After saving the configuration file, restart Claude Desktop for the changes to take effect.



Step 5: Verify the Connection


Open Claude Desktop and try these commands to confirm everything is working:

Test the BinaryLane MCP:

"List my BinaryLane servers"


Claude should return a list of your servers with names, IPs, regions, and status.

Test the SSH MCP:

"Show me all available SSH connections"


Claude should list your BinaryLane servers as available connections, auto-discovered from your account.

If either fails, check the Troubleshooting section below.



What Can You Do With It?


Once both MCP servers are connected, Claude becomes a capable infrastructure assistant. Here are some examples of what you can ask:

Server Management

Ask Claude...What Happens
"List all my servers"Queries the BinaryLane API and returns server names, IPs, regions, sizes, and status
"Create a new Ubuntu 24.04 server in Sydney called test-box"Creates the server via the API, waits for it to become active, returns connection details
"What size is my web-1 server and how much does it cost?"Looks up server details including vCPU, RAM, disk, and monthly pricing
"Resize web-1 to 2 vCPUs"Issues a resize action via the API (may require a reboot)
"Take a snapshot of db-1 before I make changes"Creates a backup snapshot with a label you specify


SSH & Remote Administration

Ask Claude...What Happens
"SSH into web-1 and check disk usage"Connects via SSH, runs df -h, returns the output
"Check if nginx is running on web-1"Runs systemctl status nginx over SSH and reports the status
"Show me the last 50 lines of the error log on web-2"Reads the log file via SSH and summarises any issues
"Install fail2ban on all my web servers"Connects to each server in turn, runs the install commands, and reports results
"What's the uptime and load average across all my servers?"SSHs into each server, collects metrics, and presents a summary table


DNS & Networking

Ask Claude...What Happens
"Add a DNS A record for app.example.com pointing to web-1"Looks up web-1's IP, creates the DNS record via the API
"Show me all DNS records for example.com"Lists all A, CNAME, MX, TXT records for the domain
"Create a VPC in Sydney and move web-1 and web-2 into it"Creates the VPC, then changes the network configuration for each server


Load Balancers & Firewalls

Ask Claude...What Happens
"Set up a load balancer for web-1 and web-2 on port 80"Creates a load balancer, adds forwarding rules, and attaches the servers
"Show me the firewall rules on web-1"Retrieves and displays the current advanced firewall configuration
"Lock down web-1 to only allow SSH, HTTP, and HTTPS"Configures stateless firewall rules with explicit deny rules at the end


Account & Billing

Ask Claude...What Happens
"What's my current BinaryLane balance?"Returns your account balance and usage summary
"Show me my last 3 invoices"Lists recent invoices with amounts and dates
"What regions and server sizes are available?"Lists all BinaryLane regions and available plans with pricing




SSH MCP Configuration (Optional)


The SSH MCP auto-discovers your BinaryLane servers, but you can also add custom connections for non-BinaryLane servers or override settings.

The configuration file is automatically created at:

~/.config/ssh-mcp/connections.json


Example configuration:

{
  "defaultPrivateKeyPath": "~/.ssh/id_ed25519",
  "binarylane": {
    "enabled": true,
    "apiToken": "your-token-here",
    "defaultUsername": "root",
    "defaultPrivateKeyPath": "~/.ssh/id_ed25519"
  },
  "connections": [
    {
      "name": "my-other-server",
      "host": "203.0.113.50",
      "port": 22,
      "username": "deploy",
      "privateKeyPath": "~/.ssh/deploy_key"
    }
  ]
}


When duplicate server names exist, the priority order is:

  1. Config file connections (highest priority)
  2. Environment variables
  3. BinaryLane auto-discovery (lowest priority)

This means you can override auto-discovered settings by adding a connection with the same name to your config file.



Troubleshooting


ProblemSolution
Claude says it doesn't have BinaryLane toolsRestart Claude Desktop after editing the config file. Check that the paths in claude_desktop_config.json are correct and absolute (not relative).
Authentication error (401/403)Verify your API token at home.binarylane.com.au/api-info. Make sure the token is pasted correctly with no extra spaces or quotes.
"Token validation failed" on startupThe BinaryLane MCP validates that the token is 64 alphanumeric characters. Check you've copied the full token.
SSH connection refusedEnsure your SSH key is added to the target server. Check the privateKeyPath in your SSH MCP config points to the correct key file.
SSH MCP doesn't find my serversConfirm the BINARYLANE_API_TOKEN is set in the SSH MCP config. Ask Claude to refresh_connections to re-scan.
npm install or npm run build failsCheck your Node.js version with node --version — must be 18.0.0 or higher. Try deleting node_modules and running npm install again.
Server creation says "invalid size"BinaryLane size slugs don't include RAM. Use std-min, std-1vcpu, std-2vcpu, etc. Ask Claude to list_sizes to see all valid options.
Firewall change locked me outUse the BinaryLane Dashboard or VNC console (get_server_console) to regain access. BinaryLane firewalls are stateless — you need explicit rules for both directions.




Useful Links

Disclaimer: The BinaryLane MCP and SSH MCP are community-developed open-source projects, not official BinaryLane products. BinaryLane support cannot assist with MCP-specific issues. For bugs or feature requests, please open an issue on the respective GitHub repository.