MCP Agent Cloud is currently in open beta. Follow the instructions below to get started. For feedback, issues and feature requests, visit https://github.com/lastmile-ai/mcp-agent/issues or join our Discord at https://lmai.link/discord/mcp-agent.

Prerequisites

Before you begin, make sure you have:

mcp-agent installed

# Using uv (recommended)
uv tool install mcp-agent

# Or using pip
pip install mcp-agent

A working agent

An mcp-agent project that runs locally

Quick Start

1

Authenticate

Log in to MCP Agent Cloud:
mcp-agent login
This will direct you to the API keys page for obtaining credentials.
2

Prepare Your Project

Ensure your project has the required configuration files:
mcp_agent.config.yaml
execution_engine: temporal  # Cloud uses Temporal
logger:
  transports: [console]
  level: info

mcp:
  servers:
    # Your MCP server configurations
    fetch:
      command: "uvx"
      args: ["mcp-server-fetch"]

# Your LLM provider config
openai:
  default_model: gpt-4o
[!IMPORTANT] Swap your api_key with !developer_secret to mark what keys will be saved as secrets within mcp-agent cloud.
mcp_agent.secrets.yaml
openai:
  api_key: !developer_secret
anthropic:
  api_key: !developer_secret
# Other secrets as needed
3

Deploy

Deploy your agent with a single command:
mcp-agent deploy my-first-agent
The deployment process will:
  1. Check for existing app with this name or create a new one
  2. Process your secrets file (transforming !developer_secret tags to secure handles)
  3. Bundle and upload your code using Wrangler
  4. Deploy to MCP Agent Cloud’s managed infrastructure
You’ll see output like:
App ID: app_abc123xyz
App URL: https://deployments.mcp-agent.com/servers/my-first-agent
App Status: ONLINE
4

Test Your Deployment

List your deployed agents:
mcp-agent cloud servers list
Test your agent:
# Get server details
mcp-agent cloud servers describe app_abc123xyz

# View logs - this is essential for debugging!
mcp-agent cloud logger tail app_abc123xyz --follow

# Filter for errors
mcp-agent cloud logger tail app_abc123xyz --grep "ERROR" --since 5m
The cloud logger tail command is your best friend for debugging deployments. Use --follow to stream logs in real-time and --grep to filter for specific patterns.

Your First Cloud Workflow

Let’s create and deploy a simple agent that can fetch web content and summarize it.

Create the Agent

import asyncio
from mcp_agent.app import MCPApp
from mcp_agent.agents.agent import Agent
from mcp_agent.workflows import Workflow, WorkflowResult
from mcp_agent.workflows.llm.augmented_llm_openai import OpenAIAugmentedLLM

app = MCPApp(name="web_summarizer")

@app.workflow
class WebSummarizerWorkflow(Workflow[str]):
    """Fetches and summarizes web content."""
    
    @app.workflow_run
    async def run(self, url: str) -> WorkflowResult[str]:
        # Create an agent with fetch capabilities
        agent = Agent(
            name="summarizer",
            instruction="Fetch and summarize web content concisely.",
            server_names=["fetch"]
        )
        
        async with agent:
            llm = await agent.attach_llm(OpenAIAugmentedLLM)
            
            # Fetch and summarize
            summary = await llm.generate_str(
                f"Fetch {url} and provide a 3-sentence summary"
            )
            
            return WorkflowResult(value=summary)

# For local testing
if __name__ == "__main__":
    async def test():
        async with app.run():
            workflow = WebSummarizerWorkflow()
            result = await workflow.run("https://example.com")
            print(result.value)
    
    asyncio.run(test())

Deploy to Cloud

# Deploy the agent
mcp-agent deploy web-summarizer

# Or deploy from a specific app directory
mcp-agent deploy web-summarizer -c <path-to-app-directory>


# or deploy with a custom app description
mcp-agent deploy web-summarizer --app-description "Web content summarizer agent"

Use Your Cloud Agent

Your agent is now available as an MCP server. Here’s how to use it:
First configure the agent (this handles authentication and user secrets):
mcp-agent cloud configure --id https://deployments.mcp-agent.com/servers/web-summarizer
Then add to your Claude Desktop config (~/.claude-desktop/config.json):
{
  "servers": {
    "web-summarizer": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://deployments.mcp-agent.com/servers/web-summarizer/sse",
        "--header",
        "Authorization: Bearer <MCP_AGENT_API_KEY>"
      ]
    },
  }
}
Restart Claude Desktop and your agent will appear in the tools menu.

Advanced Deployment Options

Deployment Configuration

Control your deployment with additional options:
# Deploy with custom configuration directory
mcp-agent deploy my-agent --config-dir ./my-config

# Skip secrets processing if not needed
mcp-agent deploy my-agent --no-secrets

# Non-interactive mode (fail if secrets require prompting)
mcp-agent deploy my-agent --non-interactive

# Dry run to validate without deploying
mcp-agent deploy my-agent --dry-run

# Deploy with description
mcp-agent deploy my-agent --app-description "My production agent"

Environment Variables

Environment variables for the CLI:
# Set API base URL
export MCP_API_BASE_URL="https://deployments.mcp-agent.com"

# Set API key (alternative to login)
export MCP_API_KEY="your-api-key"

# Deploy with environment variables
MCP_API_KEY="your-key" mcp-agent deploy my-agent

Secrets Management

MCP Agent Cloud securely handles secrets through the mcp_agent.secrets.yaml file:
# mcp_agent.secrets.yaml
openai:
  api_key: !developer_secret  # Will be stored securely

anthropic:
  api_key: !developer_secret

custom_service:
  token: !developer_secret
During deployment, secrets marked with !developer_secret are:
  1. Prompted for if not already stored
  2. Securely uploaded to MCP Agent Cloud’s vault
  3. Referenced by handle in the deployed configuration

Testing with MCP Inspector

MCP Inspector is a powerful tool for testing and debugging your deployed MCP servers. It provides a web interface to interact with your agent’s tools and resources.

Using MCP Inspector

Test your deployed agent with the MCP Inspector:
  1. Open MCP Inspector: Visit https://modelcontextprotocol.io/inspector
  2. Connect to your server:
    • Select “SSE” as the transport
    • Enter your server URL, and append “/sse”
    • Add the required authentication headers (Bearer $MCP_AGENT_CLOUD_API_KEY)
  3. Test your tools:
    • Browse available tools and resources
    • Execute tool calls interactively
    • View request/response payloads
    • Debug workflow executions
MCP Inspector is especially useful for:
  • Testing tool implementations before integrating with clients
  • Debugging authentication issues
  • Understanding the exact payloads your agent expects
  • Verifying workflow execution flows

Managing Deployments

View Deployments

# List all deployments
mcp-agent cloud servers list

# Get details
mcp-agent cloud servers describe app_abc123xyz

# View statistics (if available)
mcp-agent cloud servers stats app_abc123xyz

Monitor Workflows

# List workflow runs
mcp-agent cloud servers workflows app_abc123xyz

# Get workflow status
mcp-agent cloud workflows describe app_abc123xyz run_123

# Suspend a workflow
mcp-agent cloud workflows suspend app_abc123xyz run_123

# Resume with data
mcp-agent cloud workflows resume app_abc123xyz run_123 \
  --payload '{"continue": true}'

# Cancel a workflow
mcp-agent cloud workflows cancel app_abc123xyz run_123

View Logs

# Tail logs
mcp-agent cloud logger tail app_abc123xyz

# Follow logs
mcp-agent cloud logger tail app_abc123xyz --follow

# Filter logs
mcp-agent cloud logger tail app_abc123xyz \
  --since 1h \
  --grep "ERROR" \
  --limit 100

Update Deployment

# Redeploy with latest code (simply run deploy again)
mcp-agent deploy my-agent

# The deployment will update the existing app if it already exists

Delete Deployment

# Delete a deployment
mcp-agent cloud servers delete app_abc123xyz

# Force delete (skip confirmation)
mcp-agent cloud servers delete app_abc123xyz --force

Client Integration

Help users connect to your deployed agent:
# Configure access for a deployed agent (handles auth and secrets)
mcp-agent cloud configure --id https://deployments.mcp-agent.com/servers/my-agent

# Show required parameters for configuration
mcp-agent cloud configure --id https://deployments.mcp-agent.com/servers/my-agent --params
After configuration, users can connect with their MCP client using the server URL and appropriate transport (SSE or streamable HTTP).

Best Practices

Troubleshooting

Example Projects

Explore complete examples:

Next Steps