Skip to content

Conversation

dandavison
Copy link
Contributor

@dandavison dandavison commented Aug 22, 2025

Replace WorkflowTransport with in-workflow mcp.server.lowlevel.Server.

EDIT: Instead of this PR, I'm going to investigate removing the forward proxy MCP server from the NonWFCaller inbound gateway, and just using ClientSession there.

Advantages

Before this PR, workflow caller and non-workflow caller pathways were different:

NonWfCaller ⮂ mcp.ClientSession ⮂ mcp.lowlevel.Server ⮂ TemporalServer ⮂  NexusMCPGatewayService
   WfCaller ⮂ mcp.ClientSession                        ⮂ TemporalServer ⮂  NexusMCPGatewayService

The workflow caller did not have any mcp.server.lowlevel.Server handling MCP details; this would inevitably have resulted in bugs and inconsistencies.

Now they are the same:

NonWfCaller ⮂ mcp.ClientSession ⮂ mcp.lowlevel.Server ⮂ TemporalServer ⮂ NexusMCPGatewayService
   WfCaller ⮂ mcp.ClientSession ⮂ mcp.lowlevel.Server ⮂ TemporalServer ⮂ NexusMCPGatewayService

It is also a substantial code simplification.

Disadvantages

  • Larger surface area for workflow determinism violations in 3rd party library. However, none dicovered so far and we can try to upstream fixes.

@dandavison dandavison force-pushed the workflow-mcp-server branch from 060d51f to 733b867 Compare August 22, 2025 13:48
@dandavison dandavison force-pushed the workflow-mcp-server branch from 733b867 to e573042 Compare August 22, 2025 13:54
from temporalio.worker import Worker

from nexusmcp import WorkflowTransport
import nexusmcp.workflow
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would go into the Temporal SDK eventually.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant