Skip to main content
OpenSRE connects to X’s official Model Context Protocol (MCP) server, exposing X’s API — tweet search, timelines, user profiles, likes, retweets, bookmarks, and posting — as tools the agent can call while investigating an incident. Unlike PostHog or Sentry’s always-on hosted MCP servers, XMCP is designed to run locally: you clone the xmcp repo, supply your own X API credentials, and run the server yourself. OpenSRE connects to that local endpoint (or a tunneled URL if you need remote access, e.g. via ngrok).

Tools

ToolWhat it does
list_x_toolsList the tools the connected X MCP server exposes (compact, filterable)
call_x_toolCall a named X MCP tool (e.g. search tweets, inspect a timeline, look up a tweet)
The agent typically calls list_x_tools first to discover what is available, then call_x_tool with the chosen tool name and arguments. Pass name_filter (space- or comma-separated terms, e.g. "search tweet") to narrow a large tool list, and include_schema=true on a narrowed list to fetch the full input schema for the tool you intend to call.

Prerequisites

  • A running instance of xmcp with your own X API credentials configured (X_BEARER_TOKEN, and OAuth1/OAuth2 credentials if you need write access such as posting)
  • Network access from OpenSRE to the xmcp server’s URL (local by default; tunnel it if OpenSRE runs elsewhere)
XMCP authenticates to the X API using its own environment (X_BEARER_TOKEN, OAuth credentials) at startup. OpenSRE does not need to know your X API credentials for streamable-http/sse connections to an already-running server — it only needs the server’s URL. An optional auth token can be set if your endpoint sits behind an authenticating tunnel or proxy.

Setup

Option 1: Interactive CLI

opensre integrations setup x_mcp
opensre integrations verify x_mcp
You’ll be prompted for the xmcp server URL (defaults to http://127.0.0.1:8000/mcp) and, optionally, an auth token if the endpoint is tunneled behind an authenticating proxy.

Option 2: Environment variables

Add to your .env:
X_MCP_MODE=streamable-http
X_MCP_URL=http://127.0.0.1:8000/mcp
X_MCP_AUTH_TOKEN=                     # optional, only for a tunneled/proxied endpoint
VariableDefaultDescription
X_MCP_URLhttp://127.0.0.1:8000/mcpX MCP server URL (local or tunneled)
X_MCP_MODEstreamable-httpTransport: streamable-http, sse, or stdio
X_MCP_AUTH_TOKENOptional bearer token, only needed if the endpoint requires client auth
X_MCP_COMMANDCommand to launch the xmcp server directly (stdio mode only)
X_MCP_ARGSArguments for the local xmcp command (stdio mode only)
X_BEARER_TOKENX API bearer token forwarded to the server when OpenSRE launches it (stdio mode only); not sent over the MCP transport
To have OpenSRE launch the local xmcp server itself instead of connecting to one you already started, use stdio mode:
X_MCP_MODE=stdio
X_MCP_COMMAND=python
X_MCP_ARGS=server.py
X_BEARER_TOKEN=your_x_api_bearer_token

Option 3: Persistent store

{
  "version": 1,
  "integrations": [
    {
      "id": "x-mcp-local",
      "service": "x_mcp",
      "status": "active",
      "credentials": {
        "url": "http://127.0.0.1:8000/mcp",
        "mode": "streamable-http"
      }
    }
  ]
}

Verify

opensre integrations verify x_mcp
A successful check connects to the MCP server and reports how many tools it discovered. If it fails, confirm the xmcp server is running and reachable at the configured URL, and that its own X API credentials (X_BEARER_TOKEN) are valid.