Overview

The ExpressVPN MCP server (beta) allows you to connect ExpressVPN directly to your AI developer tools using the Model Context Protocol (MCP). This local integration lets your AI assistant read and control your VPN connection through natural language or programmatic commands—checking your connection state, switching server regions, changing protocols, and troubleshooting issues without you ever needing to open the ExpressVPN app.

This feature is available to 1-year and 2-year plan subscribers on Basic, Advanced, or Pro tier, and all ExpressVPN for Teams users.

Prerequisites

Before you can connect to the ExpressVPN MCP server:

  1. A MCP-compatible AI client. The tool must support HTTP-based MCP servers.
  2. An active ExpressVPN or ExpressVPN for Teams subscription.
  3. The latest ExpressVPN beta apps for desktop (macOS, Windows, or Linux).
  4. Enable MCP in ExpressVPN:
    • Open the ExpressVPN desktop app.
    • Go to Profile, then toggle on “Enable MCP Server”.
    • The local MCP server will start automatically in the background.

Toggle Enable MCP Server

Once enabled, connect your AI tool using one of the options below.

Connect your AI tool

Note that the ports shown below are the default port for our MCP server, which may be different on your machine. When enabling the MCP server, it will show you the port being used—ensure you use that port to replace 20090 below.

Claude Code

Run this command in your terminal:

claude mcp add --transport http expressvpn http://127.0.0.1:20090/mcp

Codex

Add the following to your Codex MCP configuration file:

{
  "mcpServers": {
    "expressvpn": {
      "url": "http://127.0.0.1:20090/mcp"
    }
  }
}

Cursor

  1. Open Cursor → Settings
  2. Go to Tools & MCP
  3. Click + Add custom MCP
  4. Enter the following configuration and save:
{
  "mcpServers": {
    "expressvpn": {
      "url": "http://127.0.0.1:20090/mcp",
      "headers": {}
    }
  }
}

LM Studio

  1. Open LM Studio → right sidebar → Integrations tab
  2. Click Install → Edit mcp.json
  3. Enter the configuration below and save:
{
  "mcpServers": {
    "expressvpn": {
      "url": "http://127.0.0.1:20090/mcp",
      "headers": {}
    }
  }
}

VS Code

You can manually configure MCP servers by editing the mcp.json file. There are two locations for this file:

  • Workspace: create or open .vscode/mcp.json in your project. Include this file in source control to share MCP server configurations with your team.
  • User profile: run the MCP: Open User Configuration command to open the mcp.json file in your user profile. Servers configured here are available across all your workspaces. When you use multiple profiles, each profile can have its own MCP server configuration.

You can also run MCP: Add Server in the Command Palette (⇧⌘P) to add a server through a guided flow, choosing either Workspace or Global as the target.

Enter the configuration below:

{
  "servers": {
    "expressvpn": {
      "type": "http",
      "url": "http://127.0.0.1:20090/mcp"
    }
  }
}
Available tools

Learn what you can do with ExpressVPN MCP tools.

Now that you’ve enabled the ExpressVPN MCP server, your AI assistant can directly read and control your VPN connection through simple prompts.

These tools are designed to work together. Instead of manually opening the ExpressVPN app to check your status, switch regions, or change protocols, you can do it programmatically or through natural language inside your AI coding environment.

VPN Connection

ToolDescription
expressvpn_connectConnect to ExpressVPN. Without a region, uses the currently selected region. Pass a region slug (from expressvpn_get_regions) to connect to a specific location, e.g. “us-new-york” or “portugal”. The ExpressVPN GUI must be running or background mode must be enabled.
expressvpn_disconnectDisconnect from ExpressVPN. Drops the active VPN tunnel. Your real IP will be exposed unless Network Lock is enabled. The DNS might take a couple of seconds to become operational, so please take that into account if running any network operations immediately after disconnecting.

Status

ToolDescription
expressvpn_statusShow a full ExpressVPN status summary. Returns a multi-line human-readable report including: connection state, connected server location, VPN protocol, Network Lock (kill switch) status, and advanced protection (ad/tracker/malware blocking) status. Use this for a quick overview; use individual expressvpn_get_* tools for specific values.

Connection and Network

ToolDescription
expressvpn_get_connectionstateGet the current VPN connection state. Returns one of: Disconnected, Connecting, Connected, Interrupted, Reconnecting, DisconnectingToReconnect, Disconnecting. Use this to check if the VPN tunnel is active before performing network-dependent tasks.
expressvpn_get_dnsconfiguredCheck if DNS is properly configured through the VPN tunnel. Returns “true” when DNS queries are routed through ExpressVPN’s DNS servers, preventing DNS leaks. “false” may indicate a configuration issue.
expressvpn_get_protocolGet the VPN protocol currently in use. Returns one of: auto, lightwayudp, lightwaytcp, openvpnudp, openvpntcp, wireguard. Lightway is ExpressVPN’s proprietary protocol optimized for speed and reliability. “auto” lets the client choose the best protocol.
expressvpn_get_pubipYour public IP address as provided by your ISP, even if connected to VPN (cached before the connection to the VPN server).
expressvpn_get_vpnipIP address assigned by the VPN server (Unknown when disconnected).

Location

ToolDescription
expressvpn_get_regionGet the currently selected VPN server region as a slug (e.g., “germany-frankfurt-1”, “us-new-york”) or “smart” if smart location is selected. This is the region that will be used on the next connect.
expressvpn_get_regionsList all available VPN server regions, one slug per line (e.g., “us-new-york”, “uk-london”, “germany-frankfurt-1”). The output reflects the active server region catalog at the time of the request. Use this to discover valid region IDs for connecting.
expressvpn_get_smartGet the smart (auto-selected) region. ExpressVPN picks this based on proximity and server load for the best performance. Returns a region slug like “us-new-york”.

Settings (Read)

ToolDescription
expressvpn_get_allowlanCheck if local network (LAN) access is allowed while VPN is connected. When enabled, devices on the same local network (printers, NAS, etc.) remain accessible even with VPN active. Returns “true” or “false”.
expressvpn_get_autoconnectCheck if ExpressVPN will automatically connect on system startup. Requires background mode to be enabled. Use together with Network Lock for protection from boot. Returns “true” or “false”.
expressvpn_get_debugloggingCheck if debug logging is enabled in the ExpressVPN daemon. When enabled, verbose logs are written for troubleshooting. Returns “true” or “false”.
expressvpn_get_networklockCheck if Network Lock (kill switch) is enabled. When active, Network Lock blocks all internet traffic if the VPN connection drops, preventing IP/DNS leaks. Returns “true” or “false”.
expressvpn_get_split_appGet the current Split Tunnel per-app rules. Shows which apps are configured to bypass the VPN or be forced through it. Returns the rule list or empty if no rules are set.
expressvpn_get_splittunnelCheck if Split Tunnel is enabled. Split Tunnel lets specific apps bypass the VPN or use the VPN while others don’t. Returns “true” or “false”. Use expressvpn_get_split_app to see per-app rules.

Settings (Write)

ToolDescription
expressvpn_set_allowlanEnable or disable local network (LAN) access while VPN is connected. When enabled, devices on the same local network (printers, NAS, etc.) remain reachable.
expressvpn_set_autoconnectEnable or disable automatic VPN connection on system startup. Requires background mode to be active.
expressvpn_set_debugloggingEnable or disable debug logging in the ExpressVPN daemon. When enabled, verbose logs are written for troubleshooting.
expressvpn_set_networklockEnable or disable Network Lock (kill switch). When enabled, all internet traffic is blocked if the VPN connection drops, preventing IP and DNS leaks.
expressvpn_set_protocolSet the VPN protocol. Accepted values: auto, lightwayudp, lightwaytcp, openvpnudp, openvpntcp, wireguard. Takes effect on the next connection.
expressvpn_set_regionSet the default VPN server region without connecting. Use a region slug from expressvpn_get_regions (e.g., “us-new-york”, “germany-frankfurt-1”) or “smart” for automatic selection.
expressvpn_set_split_appAdd or remove a per-app Split Tunnel rule. Value format: “bypass:/path/to/app” to exclude an app from VPN, or “remove:/path/to/app” to delete a rule. Split Tunnel must be enabled first.
expressvpn_set_splittunnelEnable or disable Split Tunnel. When enabled, specific apps can bypass or be forced through the VPN. Use expressvpn_set_split_app to configure per-app rules.

Advanced Protection (Read)

ToolDescription
expressvpn_get_blockadsCheck if ad blocking is enabled. Part of ExpressVPN’s advanced protection (Threat Manager). Blocks known ad-serving domains at the DNS level. Returns “true” or “false”.
expressvpn_get_blockadultCheck if adult content blocking is enabled. Part of advanced protection. Blocks access to adult websites at the DNS level. Returns “true” or “false”.
expressvpn_get_blockallCheck if all advanced protection features are enabled (ads, trackers, malicious sites, adult content). Returns “true” only if every individual blocker is active. Returns “false” if any is disabled.
expressvpn_get_blockmaliciousCheck if malicious site blocking is enabled. Part of advanced protection (Threat Manager). Blocks known malware, phishing, and command-and-control domains at the DNS level. Returns “true” or “false”.
expressvpn_get_blocktrackersCheck if tracker blocking is enabled. Part of advanced protection (Threat Manager). Blocks known tracking domains that monitor browsing activity across websites. Returns “true” or “false”.

Advanced Protection (Write)

ToolDescription
expressvpn_set_blockadsEnable or disable ad blocking (Threat Manager). Blocks known ad-serving domains at the DNS level.
expressvpn_set_blockadultEnable or disable adult content blocking. Blocks access to adult websites at the DNS level.
expressvpn_set_blockallEnable or disable all advanced protection features at once (ads, trackers, malicious sites, adult content).
expressvpn_set_blockmaliciousEnable or disable malicious site blocking (Threat Manager). Blocks known malware, phishing, and command-and-control domains at the DNS level.
expressvpn_set_blocktrackersEnable or disable tracker blocking (Threat Manager). Blocks known tracking domains that monitor browsing activity across websites.

Diagnostics

ToolDescription
expressvpn_speedtestRun a speed test on the current connection. Measures ping latency, jitter, packet loss, and download/upload bandwidth. Can take 30+ seconds. Set json=true for structured output. Mode can be “automatic” or “manual”. Location is an optional location ID.

Health Check

ToolDescription
expressvpn_pingReturns “pong”. Verify the server is reachable.
Use cases

The ExpressVPN MCP server makes VPN state and network controls available directly inside the AI tools where you already work. This lets you automate region switching, enforce network policies, troubleshoot connectivity, and build VPN-related workflows inside LLM-based developer clients.

With the MCP, you can:

  • Connect or disconnect the VPN programmatically
  • Switch to specific countries or cities for testing
  • Query real-time connection state and public/VPN IP
  • Change VPN protocols for performance validation
  • Enable Network Lock (kill switch)
  • Configure Split Tunnel rules for specific applications
  • Toggle advanced protection features (block ads, trackers, malicious sites)
  • Run speed tests and diagnostics
  • Build logic that reacts to VPN state changes

These capabilities support workflows like QA testing, CI/CD validation, geo-based testing, privacy enforcement, and automated troubleshooting.

For example, you might:

  • Ask your AI client to connect to Germany before running integration tests.
  • Automatically switch between US and UK regions to verify geo-restricted content behavior.
  • Confirm the VPN is connected before executing network-dependent scripts.
  • Run a speed test after changing protocol from OpenVPN to Lightway.
  • Enforce Network Lock before running sensitive tasks.
  • Temporarily bypass the VPN for a specific app using Split Tunnel.
  • Toggle malware site blocking before testing threat detection behavior.
Security

The ExpressVPN MCP server is designed with your privacy and security in mind.

  • Local only: The MCP server runs on localhost and is not accessible from other devices or the internet. VPN control signals never leave your machine.
  • Opt-in: MCP is disabled by default. You choose to enable it explicitly in Settings.
  • No credential exposure: Your ExpressVPN account credentials are never passed through the MCP interface. The server communicates directly with the local ExpressVPN daemon.
  • User-confirmed actions: We recommend keeping human confirmation enabled in your AI tool for any connect or disconnect actions. Your agent will ask before making changes.
  • Revoke at any time: Toggle MCP off in Settings to immediately stop the local server. Any connected tools will lose access instantly.
Troubleshooting

ExpressVPN MCP server not reachable

  • Make sure “Enable MCP Server” is toggled on in ExpressVPN Profile → Settings.
  • If you’ve just enabled it, restart your AI tool. Some MCP clients only discover servers on startup.

To verify the server is running, open a terminal and run:

curl http://127.0.0.1:20090/mcp

If the server is active, you’ll receive a response. If you get a connection refused error, reopen the ExpressVPN app and check the toggle again.

Speed test hangs or takes too long

expressvpn_speedtest can take 30 seconds or more to complete, depending on your network conditions and the number of servers being tested. This is expected behaviour as the tool is running real throughput measurements, not a ping check.

My AI tool isn’t listed in the setup guide

You can manually add the MCP server using this configuration:

{
  "mcpServers": {
    "expressvpn": {
      "url": "http://127.0.0.1:20090/mcp"
    }
  }
}

Once configured, refresh or start the server. You should see a successful connection and the available tools. If the connection fails or you do not see any tools, double-check that the MCP server is enabled in the ExpressVPN desktop app.

Alternatively, check your tool’s documentation for how to add a local MCP server by URL. If your tool doesn’t support MCP yet, consider reaching out to the developers to request MCP support.

My AI tool is using curl instead of MCP tools

If your AI tool, like Claude Code tries to use curl instead of the ExpressVPN MCP tools, or says a tool like expressvpn_speedtest doesn’t exist, the MCP transport may not have loaded correctly.

What a correct setup looks like

After adding the transport and restarting your AI tool:

  • Check if your transport is available. For example, from your terminal, run claude mcp list – Claude should show you the MCP is loaded, like expressvpn: http://localhost:20090/mcp (HTTP) – ✓ Connected
  • Run expressvpn_ping. You should get pong back successfully.
  • Ask your AI tool to show you all ExpressVPN MCP tools. You should see a full list of tools like expressvpn_connect and expressvpn_set_protocol.

If you don’t see them, the transport likely wasn’t registered correctly.

Fix

If the AI still defaults to curl or does not recognize ExpressVPN MCP tools:

  • Restart your AI client
  • Re-run the MCP add command
  • Confirm you’re using the correct port shown in your ExpressVPN app
  • Run expressvpn_ping again, then ask your AI to list available ExpressVPN MCP tools
  • Additionally, Claude and many AI tools suggest you work in per project directories. Ensure you’re working in a new directory for your project and add the transport to the current projects settings again.

Connection refused on 127.0.0.1:20090

The local MCP server only runs while the ExpressVPN desktop app is open and MCP is enabled. Check:

  • The ExpressVPN desktop app is running
  • Profile → Settings → Enable MCP Server is toggled on
  • No firewall or security tool is blocking connections on port 20090

How to unblock port 20090 (Firewall guide)

The ExpressVPN MCP server communicates locally with your AI developer tools using port 20090 at the localhost address 127.0.0.1.

Because some operating systems and security programs block local port connections by default, your AI client might return a “connection refused” error. If the MCP server is enabled but your tool can’t connect, you will need to whitelist the port in your system’s firewall.

Windows Defender Firewall

Windows Defender often blocks new local port connections on strict or public network profiles. To manually allow the connection:

  1. Click the Start menu and search for Windows Defender Firewall with Advanced Security.
  2. Select Inbound Rules on the left panel, then click New Rule on the right panel.
  3. Select Port and click Next.
  4. Choose TCP, specify 20090 in the “Specific local ports” field, and click Next.
  5. Select Allow the connection and apply the rule to your active network profiles.
  6. Name the rule (e.g., “ExpressVPN MCP Server”) and click Finish.

macOS privacy settings and firewall

macOS requires explicit permission for terminal applications to communicate over your local network. It may also block the port via the built-in application firewall.

  • Fix local network permissions: Go to System Settings > Privacy & Security > Local Network. Find your terminal application (such as Terminal, iTerm2, or Cursor) in the list and ensure the toggle is switched to the ON position.
  • Fix the macOS firewall: Go to System Settings > Network > Firewall. Click Options and ensure that ExpressVPN is set to Allow incoming connections.

Linux UFW and iptables setups

If you’re running a strict firewall configuration on Linux, you must allow local loopback traffic on port 20090.

  • For UFW (Uncomplicated Firewall): Open your terminal and run the following command to allow localhost traffic on the specific port:
sudo ufw allow from 127.0.0.1 to 127.0.0.1 port 20090 proto tcp
  • For iptables: Open your terminal and append the following rule to your input chain:
sudo iptables -A INPUT -p tcp -s 127.0.0.1 -d 127.0.0.1 --dport 20090 -j ACCEPT

Third-party antivirus software

If you use third-party antivirus or endpoint protection software, it may feature a “Web Shield” or “Local Network Monitor” that intercepts localhost traffic. If you still can’t connect after configuring your OS firewall, check your antivirus settings and add an exclusion for 127.0.0.1:20090.

FAQs
Which operating systems and devices are supported?

To automate your VPN state and network routing with AI, you’ll need to run the latest beta version of the ExpressVPN app on one of the following operating systems:

  • macOS
  • Windows
  • Linux

This means you can’t enable, configure, or use the MCP server on the following devices:

  • Mobile phones or tablets (iOS and Android)
  • Network routers (including ExpressVPN Aircove and manually configured routers)
  • Smart TVs or streaming devices (Apple TV, Android TV, Fire TV)
Does the MCP server give the AI tool access to my account password?

No. The ExpressVPN MCP server doesn’t give your AI developer tool (such as Claude Code or Codex) access to your account password, email address, or billing details.

How authentication works with MCP

The MCP server functions as a local bridge that communicates directly with the ExpressVPN desktop app already running on your machine. Because your desktop app is already authenticated and securely logged into your ExpressVPN account, the AI tool doesn’t need to process your login details. Your raw credentials aren’t passed through the MCP interface and are never exposed to your terminal environment or the AI agent.

What the AI tool can access

The ExpressVPN MCP server is built with a fixed allowlist of permitted commands. It can only execute specific network tasks and diagnostic checks.

The AI tool can read or configure network settings such as:

  • Your connected server region
  • Your active VPN protocol
  • Your Network Lock status
  • Your current VPN IP address

The MCP server doesn’t have the programmatic endpoints or technical capability to query, read, or export your account profile data.

Can I connect multiple AI tools?

Yes. Multiple clients can connect simultaneously as long as they use the same localhost port.

Does this work in CI/CD?

No. The MCP server requires the ExpressVPN desktop app and runs locally.

Does the ExpressVPN MCP server support Dedicated IP?

Yes. If your ExpressVPN subscription includes Dedicated IP, the MCP server can control connections to that Dedicated IP location in the same way it controls any other region.

Dedicated IP must already be activated and available in your ExpressVPN desktop app.

Was this article helpful?

We're sorry to hear that. Let us know how we can improve.

A member of our Support Team will follow up on your issue.