MCP Integration

Overview

Understanding Model Context Protocol (MCP) integration in Compozy

Model Context Protocol (MCP) is a standardized protocol that enables AI agents to interact with external tools, services, and data sources through a unified interface. It bridges the gap between language models and the external world, providing a consistent way for agents to extend their capabilities beyond their core language model functionality.

Quick Navigation

What is MCP?

MCP is a protocol that allows AI agents to:

File System Access

Read, write, and manipulate files and directories

Database Operations

Query and modify databases with SQL and NoSQL support

API Integration

Interact with external REST APIs and web services

Code Execution

Run Python, JavaScript, and other code runtimes

Architecture Overview

Loading diagram...

Key Components

MCP Server Types

Remote MCP Servers (HTTP/HTTPS)

Remote servers accessed via network endpoints using Server-Sent Events (SSE) or HTTP streaming:

Weather API Server
mcps:
  - id: weather-api
    url: "https://api.weather-mcp.com/v1"
    transport: sse
    headers:
      Authorization: "Bearer {{ .env.WEATHER_API_KEY }}"
    timeout: 30s
    auto_reconnect: true

Transport Types Comparison

TransportDescriptionUse CasePerformance
sseServer-Sent EventsReal-time streaming from HTTP serversMedium latency, good for real-time
streamable-httpHTTP with streamingLarge responses, file transfersHigh throughput, handles large data
stdioStandard I/OLocal processes, Docker containersLow latency, high performance

Key Features

Dynamic Registration

Hot-add, update, or remove servers via Admin API with zero downtime

Security & Authentication

Token-based auth, IP allow-lists, and environment variable management

Observability & Monitoring

Health checks, metrics tracking, and comprehensive logging

Tool Discovery

Automatic discovery and aggregation across multiple servers

Environment Requirements

Environment Variables
# Required: MCP proxy service URL
MCP_PROXY_URL=http://localhost:6001

# Optional: Admin token for proxy management
MCP_PROXY_ADMIN_TOKEN=your-admin-token

# Optional: Global authentication token
MCP_PROXY_GLOBAL_AUTH_TOKEN=global-token

Quick Start with CLI

Get started with MCP in Compozy using the CLI:

# 1. Initialize a new project
compozy init my-mcp-project
cd my-mcp-project

# 2. Start the development environment
compozy dev --watch

# 3. In another terminal, start the MCP proxy
compozy mcp-proxy --mcp-port 6001 --debug
1

Initialize Project

Use compozy init to create a new project with MCP support and default configurations.

2

Start Development Server

Run compozy dev --watch to start the development server with hot reload capabilities.

3

Start MCP Proxy

Launch compozy mcp-proxy to handle all MCP server connections and routing.

4

Test Integration

Use compozy workflow execute to verify that your workflows can use MCP tools.

Integration with Compozy Workflow System

MCP seamlessly integrates with Compozy's workflow orchestration through a unified architecture:

Loading diagram...

Integration with Components

Learning Paths