Skip to content

MCP SSE transport: New SSE session created on every tool call #3950

@ayubSubhaniya

Description

@ayubSubhaniya

pipecat version

0.0.96

Python version

3.12

Operating System

macOS 26.3

Issue description

While integrating Pipecat with an MCP server using the SSE transport, we observed that a new SSE session is created for every tool call within the same agent session.

This appears to happen even when the MCP client context is reused.

Reproduction steps

..

Expected behavior

The MCP client should ideally:

  • reuse the same SSE session across tool calls within the same Pipecat session
    or
  • maintain a persistent MCP connection lifecycle tied to the agent session.

Actual behavior

For a single agent session:

  1. Tool call is triggered
  2. MCP client opens a new SSE connection
  3. initialize JSON-RPC is sent
  4. Tool executes
  5. Connection closes

On the next tool call:

  • a new SSE connection is opened again
  • initialize runs again
  • a new session ID is created

This results in:

  • repeated session initialization
  • increased latency
  • difficulty maintaining session state on the MCP server

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions