Skip to content

Support adding MCP servers that are exposed as service bindings #551

@kamal

Description

@kamal

Expose the ability to add a service binding as an MCP server via this.addMcpServer. Since the MCP server options need to be serializable, one option is to expose it as a serviceBinding option in transport.

e.g.

await this.addMcpServer("Service Binding MCP", "dummy_url", env.HOST, "agent", {
  transport: {
    type: "streamable-http",
    serviceBinding: "SERVICE_BINDING_MCP"
  }
})

The benefits would be:

  1. faster
  2. not consume the simultaneous open connections which might be the issue i'm seeing in streamText hanging in a multi-turn MCP session #538

Both SSEEdgeClientTransport and StreamableHTTPEdgeClientTransport support the ability to provide a custom fetch function so conceptually we would be able to pass in env[serviceBinding].fetch

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions