flexx logoflexx docs

MCP Configuration for AI Agents

Configure Cursor, Claude Desktop, ChatGPT, OpenAI Codex, and other MCP-compatible AI tools to connect to your machine via flexx. Includes config snippets and the complete list of available MCP tools.

What is MCP?

Model Context Protocol is an open standard for AI agents to interact with external tools. flexx exposes your machine's capabilities as MCP tools that any compatible agent can call.

Your MCP endpoint

After running flexx setup, your MCP endpoint is:

https://relay.flexx.dev/v1/mcp

Authentication is handled via OAuth 2.1 with PKCE — your AI tool will prompt you to approve access through a consent flow in the dashboard.

Configure your AI tool

Cursor

  1. Open Settings → MCP → Add Server
  2. Set the URL to:
https://relay.flexx.dev/v1/mcp

Cursor handles OAuth authentication automatically. You'll be prompted to approve access on first connection.

Claude Desktop

Add to ~/.claude/mcp_servers.json:

{
  "flexx": {
    "url": "https://relay.flexx.dev/v1/mcp"
  }
}

ChatGPT

Use the MCP endpoint URL directly in your ChatGPT MCP tool configuration:

https://relay.flexx.dev/v1/mcp

OAuth 2.1 with PKCE is supported — ChatGPT will handle the consent flow automatically.

OpenAI Codex

Add flexx as an MCP server in your Codex configuration:

https://relay.flexx.dev/v1/mcp

Any MCP client

flexx works with any tool that supports the Model Context Protocol standard:

SettingValue
Endpoint URLhttps://relay.flexx.dev/v1/mcp
ProtocolMCP (Model Context Protocol)
AuthenticationOAuth 2.1 with PKCE
TransportHTTP + Server-Sent Events

Available MCP tools

Tools are auto-discovered based on what's installed on your machine. Here is the complete list:

File operations

ToolDescription
read_fileRead file contents (supports offset and limit)
write_fileWrite or create files
list_directoryList files and subdirectories
delete_fileDelete a file
glob_filesFind files matching glob patterns (e.g., **/*.ts)

Code editing

ToolDescription
str_replaceFind and replace text in files (exact string match)

Shell

ToolDescription
execute_commandRun shell commands with configurable timeout. Supports optional cwd parameter to run from a subdirectory.
ToolDescription
grep_filesSearch file contents using ripgrep (requires ripgrep installed)

Screenshots

ToolDescription
screenshot_urlCapture a full-page screenshot of a URL (requires Chrome/Chromium)
screenshot_elementCapture a specific DOM element by CSS selector

Tunneling

ToolDescription
tunnel_startExpose a local port via a public URL through the relay
tunnel_stopStop an active tunnel
tunnel_listList all active tunnels

System

ToolDescription
health_checkCheck daemon health and connectivity

Authentication flow

AI Agent

  ├─ Connects to relay.flexx.dev/v1/mcp
  ├─ OAuth 2.1 + PKCE consent flow
  ├─ User approves access and selects remote

Relay (relay.flexx.dev)

  ├─ Validates OAuth token
  ├─ Routes to selected remote

Your Machine (flexx daemon)

  ├─ Executes MCP tool
  ├─ Returns result

Relay → AI Agent

During the consent flow, you choose which remote machine the AI agent connects to. You can revoke access at any time from Dashboard → Settings.

OAuth scopes

ScopePermission
remotes:readView your connected machines and their status
remotes:writeRegister, update, and remove machines
tools:executeRun MCP tools on your machines
profile:readView your account email and organization

Security

  • All communication is encrypted (WSS/HTTPS)
  • Your machine only makes outbound connections
  • OAuth 2.1 with PKCE prevents token interception
  • Tools respect workspace path scoping
  • Commands are filtered through a blocklist
  • File operations have size limits

On this page