Skip to content

[Bug]: Grok threads do not load grok.com connectors from grok /mcps #14175

Description

@Pandoks

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On grok.com/connectors, connect an account connector (Notion is enough). Confirm it in an interactive grok session with /mcps. It shows up as a managed gateway server, for example managed_gateway:notion, status ready.
  2. On the same machine and Grok account, grok mcp list --json prints [] when ~/.grok/config.toml has no [mcp_servers.*] entries.
  3. Open a T3 Code thread whose provider is Grok (full access). This build spawns grok agent --always-approve stdio with GROK_OAUTH2_REFERRER=t3code.
  4. Ask that thread to use the connector, or inspect the MCP servers attached to the session.

Same result outside T3, which isolates the entrypoint. grok agent --always-approve stdio, then ACP initialize / authenticate / session/new with mcpServers: []:

  • The debug log says the session was created with 0 MCP servers.
  • It never logs Fetched managed MCP gateway tool catalog.
  • ACP x.ai/mcp/list returns -32601 Method not found.
  • Sending _meta.clientType = grok-pager on that stdio session does not start the fetch either.

managed_mcps.gateway_tools_enabled was already true (GROK_MANAGED_MCP_GATEWAY_TOOLS_ENABLED). That does not make grok agent fetch the catalog.

Expected behavior

A T3 Grok thread on this account can call the same grok.com connectors that grok /mcps shows as ready. T3 keeps injecting its own t3-code server on top of that list.

Actual behavior

The T3 thread only has the t3-code MCP server. Notion, GitHub, Finance, Automations, and X Money never become tools.

Interactive grok /mcps on 2026-09-28, same account, after the pager logged Fetched managed MCP gateway tool catalog count=161:

Connector id status tools
Finance managed_gateway:finance ready 6
GitHub managed_gateway:github ready 94
Notion managed_gateway:notion ready 45
Automations managed_gateway:tasks ready 10
X Money managed_gateway:x_money ready 6

grok mcp list does not show these. The user guide says grok mcp enable / disable is not /mcps parity for gateway connectors (managed_gateway:… stays Space-only in the TUI).

Cause

Grok has two lists.

  • Local and compat servers live in ~/.grok/config.toml and Claude/Cursor compat files. grok mcp list, grok agent, and a T3 session all see this list. Here it is empty.
  • grok.com connectors are a managed gateway catalog. Only the interactive pager fetches it and serves it through in-process x.ai/mcp/list. The binary also requires a gateway client to call them (Managed MCP gateway tool '…' is indexed but no gateway client is available).

T3 never starts the pager. Full access uses grokAcpSpawnArgs → ["agent", "--always-approve", "stdio"] in apps/server/src/provider/acp/GrokAcpSupport.ts. GROK_OAUTH2_REFERRER=t3code is OAuth attribution. apps/server/src/provider/Layers/GrokAdapter.ts puts one HTTP server on ACP session/new: t3-code. That add is on top of whatever the CLI already loaded (admit_client_mcp_servers on Grok 1.0.40+). The CLI loaded nothing from the gateway catalog, so the thread ends with t3-code only.

Orchestrator V2 does not change this path. On t3code/codex-turn-mapping (#2829), grokAcpSpawnArgs is still grok agent stdio, and AcpAdapterV2 attaches only the t3-code bridge. The V2 MCP doc says Grok receives T3's endpoint through session/new mcpServers. It does not fetch grok.com connectors.

Fix

The break is in the Grok CLI entrypoint T3 is required to use.

  1. In grok agent session startup, fetch the managed gateway catalog and construct the gateway client whenever managed_mcps.gateway_tools_enabled is on. The pager and x.ai/mcp/list cannot be the only loader. ACP clientType=grok-pager is not a switch for this.
  2. Leave T3's session/new additive. Once the agent loads the catalog, t3-code and the connectors coexist. A strict-MCP spawn (feat(grok): let a t3-started Grok session run with only the MCP servers t3 declares #12914) has to stay opt-in, or it drops these connectors again.

T3 cannot paper over this by copying /mcps rows into mcpServers. Those ids are gateway tools, not stdio/HTTP servers, and there is no URL to inject.

Impact

Major degradation or frequent failure

Version or commit

T3 Code 0.0.43-nightly.20260922.2123 (orchestrator V1: src/orchestration/Layers/OrchestrationEngine.ts). Grok CLI 1.0.41 (4220f3b224a6).

Environment

Linux. Provider Grok. Same Grok account in the TUI and in T3.

Logs or stack traces

grok mcp list --json
[]

# interactive grok --debug, after /mcps
Fetched managed MCP gateway tool catalog count=161

# grok agent --always-approve stdio
Session created with 0 MCP servers
x.ai/mcp/list -> {"code":-32601,"message":"Method not found"}

Workaround

grok mcp add writes a normal stdio or HTTP server into ~/.grok/config.toml. grok agent inherits that list, so T3 will see it. That is a second setup. It does not turn on the grok.com connector from /mcps.

Not a duplicate

Activity

  1. juliusmarminge commented on Sep 28, 2026

    @juliusmarminge
    Member

    Triage

    Confirmed on current main. This is a real gap, and it is not a T3 wiring bug. T3 is not going to grow a second copy of grok.com’s connector catalog.

    What T3 does

    A full-access Grok thread spawns grok agent --always-approve stdio. Every other runtime mode is the same agent / stdio entrypoint with a --permission-mode prefix (grokAcpSpawnArgs in apps/server/src/provider/acp/GrokAcpSupport.ts). The only env T3 adds is GROK_OAUTH2_REFERRER=t3code, which is OAuth attribution.

    session/new, session/load, and session/resume pass mcpServers from apps/server/src/provider/acp/AcpSessionRuntime.ts. GrokAdapter.startSession puts one server on that list when the thread has a T3 MCP endpoint: HTTP t3-code. Otherwise the list is empty. That matches the session you described, and it matches admit_client_mcp_servers being additive.

    Nothing in this repo reads managed_gateway:* or calls the gateway catalog. Orchestrator V2 (#2829) and the ACP bridge port (#13784) still attach only t3-code. They do not fetch grok.com connectors.

    Why T3 cannot inject these

    Current xai-org/grok-build crates/codegen/xai-grok-shell/src/session/managed_mcp.rs says managed connectors exist only via the gateway catalog (GET /v1/mcp/tools/list), not as injected HTTP servers. grok mcp list --json printing [] with an empty [mcp_servers.*] config is the local list, not /mcps. Copying those rows into ACP mcpServers would not work: there is no command or URL to send.

    grok mcp add remains a separate setup for a normal stdio or HTTP server. It does not turn on the grok.com connector.

    Upstream

    Your out-of-T3 repro is the right isolation: grok agent --always-approve stdio, then initialize / authenticate / session/new with mcpServers: [], never logs Fetched managed MCP gateway tool catalog, and x.ai/mcp/list is -32601. GROK_MANAGED_MCP_GATEWAY_TOOLS_ENABLED and _meta.clientType = grok-pager not starting that fetch matches the CLI owning this, not T3.

    One correction against current grok-build main, which may be newer than 1.0.41 (4220f3b). The ACP agent calls spawn_managed_gateway_tool_catalog_fetch() from initialize and again after the session is registered (acp_agent.rs). That fetch is gated on managed_mcp_gateway_tools_enabled and on the session auth being managed-MCP eligible (OIDC or web login, not the flag alone). T3 picks xai.api_key when XAI_API_KEY is set and cached_token otherwise. Your standalone grok agent run already shows 1.0.41 did not fetch, so T3’s auth choice is not the whole story. I could not open 4220f3b from here.

    A catalog fetch is still not a callable tool. ShellManagedGatewayToolClient in acp_session.rs is what POSTs call_gateway_tool with the auth token. The error you quoted (indexed but no gateway client is available) is that second half. x.ai/mcp/list is the pager’s extension, not something T3 should implement.

    Worth one retest after grok update, same standalone grok agent --always-approve stdio steps, before treating “pager is the only loader” as still true. If a newer CLI fetches the catalog but the thread still cannot call Notion or GitHub, the remaining break is still in the CLI.

    Once grok agent loads the catalog and has a gateway client, T3 picks the connectors up with no change: session/new stays additive, so t3-code and managed_gateway:* coexist. A strict-MCP spawn (#12914) has to stay opt-in, or it drops these connectors again.

    Not a duplicate

    Leaving this open as upstream. No T3 code change until grok agent can call the catalog on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.upstreamvia-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions