Type something to search...

Longarm MCP Server

Back to longarm Docs

longarm exposes a streamable HTTP MCP server for agent integrations.

Endpoint

http://<host>:<mcpPort>/mcp

Health check:

  • GET /mcp

Example response:

{ "status": "running", "transport": "mcp" }

Authentication

If token auth is enabled, MCP requests must include:

Authorization: Bearer <token>

Protocol details

  • transport: streamable HTTP over POST /mcp
  • JSON-RPC version: 2.0
  • supported RPC methods: initialize, ping, tools/list, tools/call
  • initialize responses include an Mcp-Session-Id header

Minimal calls

initialize

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": {
      "name": "example-client",
      "version": "1.0.0"
    }
  }
}

tools/list

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list"
}

tools/call

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "open_app",
    "arguments": {
      "packageName": "com.android.settings"
    }
  }
}

Tool availability

Always available:

  • screen_info
  • tap
  • long_press
  • open_app
  • open_intent
  • batch_list
  • batch_get
  • batch_save
  • batch_delete
  • batch_run
  • batch_run_inline
  • batch_status
  • batch_history_list
  • batch_history_get
  • batch_history_export
  • batch_history_delete

Plus only:

  • swipe
  • pinch
  • two_finger_swipe
  • rotate

Only when UI inspection is enabled and auth remains enabled:

  • ui_tree
  • ui_find
  • ui_wait
  • ui_action
  • ui_set_text
  • ui_scroll

Result shape

Tool calls return content, structuredContent, and isError when the tool-level result failed.

{
  "content": [
    {
      "type": "text",
      "text": "{\"success\":true}"
    }
  ],
  "structuredContent": {
    "success": true
  }
}

MCP tool calls also appear in the Logs view with method MCP and paths such as tools/call/open_app.