MCP Integration

Transport Configuration

MCP supports three transport mechanisms for communication between clients and servers. Each transport has different characteristics and use cases optimized for specific scenarios.

Supported Transport Types

Compozy supports the following transport types:

  1. Stdio - Standard I/O for local processes
  2. SSE - Server-Sent Events for HTTP streaming
  3. Streamable HTTP - HTTP with streaming capabilities

Transport Configuration

Stdio Transport

Standard I/O transport for local processes and command execution:

# compozy.yaml
mcps:
  - name: filesystem_server
    transport: stdio
    command: npx
    args: ["-y", "@modelcontextprotocol/server-filesystem", "./workspace"]
    env:
      NODE_ENV: production
      DEBUG: "mcp:*"
OptionDescriptionRequiredDefault
commandExecutable commandYes
argsCommand argumentsNo
envEnvironment variablesNo

Use Cases:

  • Local MCP server processes
  • Docker containers
  • Command-line MCP tools
  • Development and testing

SSE Transport

Server-Sent Events for real-time HTTP streaming:

# compozy.yaml
mcps:
  - name: remote_server
    transport: sse
    url: "https://example.com/mcp"
    headers:
      Authorization: "Bearer token123"
      User-Agent: "Compozy/1.0"
    timeout: 30s
OptionDescriptionRequiredDefault
urlSSE endpoint URLYes
headersHTTP headersNo
timeoutRequest timeoutNo30s

Use Cases:

  • Remote MCP servers
  • Real-time data streaming
  • Web-based MCP services
  • Cloud deployments

Streamable HTTP Transport

HTTP with streaming for large responses and file transfers:

# compozy.yaml
mcps:
  - name: file_server
    transport: streamable-http
    url: "https://api.example.com/mcp-stream"
    headers:
      Content-Type: "application/json"
    timeout: 60s
OptionDescriptionRequiredDefault
urlHTTP endpoint URLYes
headersHTTP headersNo
timeoutRequest timeoutNo30s

Use Cases:

  • Large file transfers
  • Streaming responses
  • High-throughput scenarios
  • API-based MCP servers

Transport Selection Guidelines

Choose stdio when:

  • Running MCP servers locally
  • Using Docker containers
  • Development and testing scenarios
  • Direct process communication is preferred

Choose sse when:

  • Connecting to remote MCP servers
  • Real-time streaming is required
  • Using web-based MCP services
  • Server-sent events are supported

Choose streamable-http when:

  • Handling large file transfers
  • Streaming responses are needed
  • HTTP-based communication is preferred
  • API integration is required