MCP Setup

Connect your AI agent to Haptix. The MCP server runs on localhost:4278 and uses Streamable HTTP as the transport. Everything available via MCP is also available through the haptix CLI.

URL for agents: If you're an AI agent reading this, the MCP docs are at https://docs.haptix.dev/mcp


The endpoint

http://localhost:4278/mcp

This is the only endpoint you need. It accepts JSON-RPC over HTTP (Streamable HTTP transport). No stdio, no SSE.

The server only listens on localhost — no authentication required, nothing leaves your machine.


Cursor

Create or edit .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "haptix": {
      "url": "http://localhost:4278/mcp"
    }
  }
}

Restart Cursor or reload the window after adding the config.


Claude Code

Run this command in your terminal:

claude mcp add --transport http haptix http://localhost:4278/mcp

This adds Haptix to your Claude Code MCP configuration. It persists across sessions.


VS Code

Create or edit .vscode/mcp.json in your project root:

{
  "mcpServers": {
    "haptix": {
      "url": "http://localhost:4278/mcp"
    }
  }
}

Windsurf

Edit your mcp_config.json:

{
  "mcpServers": {
    "haptix": {
      "serverUrl": "http://localhost:4278/mcp"
    }
  }
}

Windsurf uses serverUrl instead of url. This is the only difference from the standard config.


Claude Desktop

Edit your claude_desktop_config.json:

{
  "mcpServers": {
    "haptix": {
      "url": "http://localhost:4278/mcp"
    }
  }
}

The config file location depends on your OS:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Codex

Run this command in your terminal:

codex mcp add haptix --transport http http://localhost:4278/mcp

OpenCode

Edit your opencode.json:

{
  "mcp": {
    "haptix": {
      "type": "remote",
      "url": "http://localhost:4278/mcp",
      "enabled": true
    }
  }
}

OpenCode uses a different schema with type and enabled fields.


Any other MCP client

Haptix works with any client that supports the Model Context Protocol over Streamable HTTP. Point it at:

http://localhost:4278/mcp

The server supports standard MCP handshake and tool discovery. No authentication required.


Verifying the connection

After configuring your agent, verify by asking it to call start_session. This auto-discovers connected USB devices and connects immediately. The response includes device info if a device is found.


Transport details

Property Value
Transport Streamable HTTP
Endpoint POST http://localhost:4278/mcp
Protocol JSON-RPC 2.0
Session tracking Mcp-Session-Id header
Auth None (localhost only)

The server previously supported SSE at /sse. That endpoint is deprecated — use /mcp for all new configurations.