Skip to content

[Chat] Send the MCP server's Warp-side identity in MCPContext - #15942

Draft
Legoben wants to merge 1 commit into
bens/populate-user-query-attributionfrom
bens/mcp-context-warp-id
Draft

[Chat] Send the MCP server's Warp-side identity in MCPContext#15942
Legoben wants to merge 1 commit into
bens/populate-user-query-attributionfrom
bens/mcp-context-warp-id

Conversation

@Legoben

@Legoben Legoben commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

The installation id the client reports in MCPContext.servers[].id (and that comes back as CallMCPTool.server_id) is, for cloud runs, UUIDv5(task_id, spec_token, server_name). The spec token is the run config's warp_id — a managed MCP server uid or a well-known integration id such as linear — and it was hashed into the id and then discarded, so nothing downstream (warp-server, the Factory run transcript) could name the server behind an MCP call.

This keeps it and sends it alongside the opaque id:

  • TemplatableMCPServerInstallation gains warp_id: Option<String> (#[serde(default)], with_warp_id, warp_id()); installations_from_managed_client_config_json records the spec token.
  • TemplatableMCPServerInfo carries it through runtime::spawn_server (new parameter; the one native caller passes installation.warp_id()).
  • MCPServer.warp_id in the request model. convert_to.rs turns it into MCPContext.MCPServer.identity, an MCPServerIdentity: integration (the new MCPIntegration enum — LINEAR, SLACK, JIRA, LINEAR_AGENT_SESSION, mirroring warp-server's well-known id registry) for a well-known id, managed_server_uid for a uuid, and no identity at all for an empty id or one this build does not know, so a newer server-side integration is unnamed rather than misattributed. display_name is left unset; MCPContext.MCPServer.name already carries it and warp-server fills it in when it copies the identity onto tool calls.

Local and ad-hoc servers send no identity. Nothing about the installation id itself changes: it stays the key the manager and permissions use, and the identity travels as a separate field.

Stacked on #15947 (bens/populate-user-query-attribution), which already adapts this repo to the attribution protos. warp_multi_agent_api moves from that branch's c8ed32b to b430a4f: warp-proto-apis branch bens/populate-user-query-attribution-plus-mcp-identity, which is #381's head merged with main at the MCPServerIdentity change (#380), so both sets of fields are in one tree. Once #381 merges, that rev collapses to a main sha.

Downstream: warp-server #17255 copies the identity onto each MCP tool call as server_identity, filling display_name from name; warp-server #17260 renders it.

Linked Issue

No GitHub issue; spec is warp-server specs/factory-threads-viewer/TECH.md (A4 / C8).

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below.

Testing

Against a local proto checkout carrying the new fields ([patch] not included in this PR):

  • cargo check -p mcp and cargo check -p warp --lib --tests clean; cargo fmt --check clean.

  • New tests: mcp_startup::tests::managed_config_installations_carry_the_spec_token_as_warp_id (well-known slug and managed uid both survive as warp_id) and convert_to::tests::mcp_context_servers_carry_their_identity_alongside_the_installation_id (well-known id → integration; uuid → managed_server_uid; display name left to name; empty and unknown ids → no identity).

  • Not manually run end to end: needs a cloud run with a well-known integration to observe mcp_context.servers[].identity.integration == LINEAR in the request.

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

@cla-bot cla-bot Bot added the cla-signed label Sep 11, 2026
@Legoben Legoben changed the title Send the MCP server's warp_id in MCPContext [Chat] Send the MCP server's warp_id in MCPContext Sep 11, 2026
@Legoben
Legoben force-pushed the bens/mcp-context-warp-id branch from e23263b to a83b0db Compare September 11, 2026 19:04
@Legoben Legoben changed the title [Chat] Send the MCP server's warp_id in MCPContext Send the MCP server's Warp-side identity in MCPContext Sep 11, 2026
@Legoben Legoben changed the title Send the MCP server's Warp-side identity in MCPContext [Chat] Send the MCP server's Warp-side identity in MCPContext Sep 11, 2026
@Legoben
Legoben force-pushed the bens/mcp-context-warp-id branch from a83b0db to 7934245 Compare September 11, 2026 22:01
@Legoben
Legoben changed the base branch from master to bens/populate-user-query-attribution September 11, 2026 22:45
The installation id that MCPContext reports to warp-server (and that comes back
as `CallMCPTool.server_id`) is, for cloud runs, a UUIDv5 over the task id, the
spec token, and the server name. The spec token is the run config's `warp_id`
(a managed MCP server uid or a well-known integration id such as "linear"); it
was hashed into the id and then discarded, so nothing downstream could name the
server.

Keep it: `TemplatableMCPServerInstallation::with_warp_id` records it when
installations are built from a managed client config, `TemplatableMCPServerInfo`
carries it through `spawn_server`, and `MCPServer.warp_id` reaches the request
builder. On the wire it becomes `MCPContext.MCPServer.identity`, an
`MCPServerIdentity`: `integration` (the `MCPIntegration` enum: linear, slack,
jira, linear_agent_session) for a well-known id, `managed_server_uid` for a
uuid, and no identity for an empty id or one this build does not know.
`display_name` is left to `MCPContext.MCPServer.name`; warp-server fills it in
when it copies the identity onto MCP tool calls as `server_identity`.

Stacks on the query-attribution change and moves `warp_multi_agent_api` to
b430a4f, the attribution protos (warp-proto-apis #381) merged with main at the
MCPServerIdentity change (#380).
@Legoben
Legoben force-pushed the bens/mcp-context-warp-id branch from 7934245 to 32ee1a0 Compare September 11, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant