# Deploying & Managing

Deploy your MCP integrations to production, share them with your team, and monitor their performance—all from within MCP Studio.

{% hint style="success" %}
**One-Click Deployment**: MCP Studio handles containerization, infrastructure, and scaling automatically. Just click deploy and watch your integration go live.
{% endhint %}

## Deployment Overview

When you deploy an MCP server, MCP Studio:

1. **Validates** your code for errors and security issues
2. **Builds** a container image with your code and dependencies
3. **Deploys** the container to cloud infrastructure
4. **Creates** an API endpoint for accessing your integration
5. **Generates** an API key for authentication

| Aspect             | Details                                   |
| ------------------ | ----------------------------------------- |
| **Infrastructure** | AWS-powered secure cloud hosting          |
| **Scaling**        | Automatic scaling based on demand         |
| **Availability**   | High availability with redundancy         |
| **Security**       | Encrypted connections, isolated execution |

{% hint style="info" %}
**Deploy to Your Own AWS Account**: You can optionally deploy MCP servers into your own AWS account for data residency, compliance, or to use existing AWS credits. See [Deploy to Your AWS Account](/integrations-and-configuration/mcp-studio/aws-account-deployment.md) for setup instructions.
{% endhint %}

## Deployment Status Lifecycle

Your MCP server progresses through these statuses:

```
┌─────────┐   ┌────────────┐   ┌──────────┐   ┌───────────┐   ┌──────────┐
│  Draft  │ → │ Validating │ → │ Building │ → │ Deploying │ → │ Deployed │
└─────────┘   └────────────┘   └──────────┘   └───────────┘   └──────────┘
                                                    │
                                                    ↓
                                              ┌─────────┐
                                              │  Error  │
                                              └─────────┘
```

| Status         | Description          | What's Happening                               |
| -------------- | -------------------- | ---------------------------------------------- |
| **Draft**      | Initial state        | Code has not been deployed                     |
| **Validating** | Code validation      | Checking syntax, imports, and tool definitions |
| **Building**   | Container build      | Creating Docker image with dependencies        |
| **Deploying**  | Infrastructure setup | Launching container and configuring endpoints  |
| **Deployed**   | Live and ready       | Integration is available for use               |
| **Error**      | Deployment failed    | Something went wrong (see logs for details)    |
| **Archived**   | Deactivated          | Integration has been stopped                   |

## Deploy Tab: Deploying Your Integration

{% stepper %}
{% step %}
**Navigate to Deploy Tab**

From the MCP Builder, click the **Deploy** tab.
{% endstep %}

{% step %}
**Review Pre-Deployment Checklist**

Before deployment, ensure:

| Requirement           | Description                      |
| --------------------- | -------------------------------- |
| ✅ Code validates      | Run validation on the Build tab  |
| ✅ Secrets configured  | All required secrets have values |
| ✅ Tools defined       | At least one tool is defined     |
| ✅ Documentation added | Tools have clear descriptions    |
| {% endstep %}         |                                  |

{% step %}
**Click Deploy**

Click the **Deploy** button to start the deployment process.

{% hint style="info" %}
**Catalog MCPs**: If you're deploying from the MCP Catalog, validation is skipped since the code is pre-validated.
{% endhint %}
{% endstep %}

{% step %}
**Monitor Progress**

Watch the streaming deployment progress:

```
[12:34:56] Starting deployment...
[12:34:57] Validating code... ✓
[12:34:59] Building container image...
[12:35:15] Pushing image to registry... ✓
[12:35:22] Deploying to infrastructure...
[12:35:45] Creating API endpoint... ✓
[12:35:47] Deployment complete! ✓
```

{% endstep %}

{% step %}
**Verify Deployment**

Once complete, the status changes to **Deployed** and you can proceed to the Connect tab.
{% endstep %}
{% endstepper %}

### Handling Deployment Errors

If deployment fails:

1. **Check the Error Message**: The deployment log shows what went wrong
2. **Review Your Code**: Common issues include syntax errors or missing dependencies
3. **Verify Secrets**: Ensure all required credentials are provided
4. **Try Again**: Fix the issue and click Deploy again

| Common Error       | Cause                   | Solution                           |
| ------------------ | ----------------------- | ---------------------------------- |
| Validation failed  | Code has errors         | Fix errors shown in Build tab      |
| Build failed       | Dependency issues       | Check package versions and imports |
| Deployment timeout | Infrastructure issue    | Wait and retry, or contact support |
| Missing secrets    | Required values not set | Configure all required secrets     |

## Connect Tab: Enabling Your Integration

After deployment, use the Connect tab to enable your integration and get connection details.

### Enable for Darcy

Toggle **Enable for Darcy** to make your integration available in:

| Feature          | How It Works                                 |
| ---------------- | -------------------------------------------- |
| **DarcyIQ Chat** | Tools appear automatically for the AI to use |
| **AI Workflows** | Integration available as a workflow step     |

{% hint style="success" %}
**Instant Availability**: Once enabled, your integration's tools are immediately available. No restart required.
{% endhint %}

### Manual Connection Details

For connecting from external applications, the Connect tab provides:

| Detail           | Description                             | Example                             |
| ---------------- | --------------------------------------- | ----------------------------------- |
| **Endpoint URL** | The HTTPS endpoint for your integration | `https://mcp.darcyiq.com/v1/abc123` |
| **API Key**      | Authentication key for requests         | `mcp_key_xxxxx...`                  |

### Code Examples for External Connections

The Connect tab provides ready-to-use code examples:

**Python (httpx):**

```python
import httpx

endpoint = "https://mcp.darcyiq.com/v1/abc123"
api_key = "mcp_key_xxxxx"

async with httpx.AsyncClient() as client:
    response = await client.post(
        f"{endpoint}/tools/call",
        headers={"Authorization": f"Bearer {api_key}"},
        json={
            "name": "get_customer",
            "arguments": {"customer_id": "12345"}
        }
    )
    result = response.json()
    print(result)
```

**JavaScript (fetch):**

```javascript
const endpoint = "https://mcp.darcyiq.com/v1/abc123";
const apiKey = "mcp_key_xxxxx";

const response = await fetch(`${endpoint}/tools/call`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    name: "get_customer",
    arguments: { customer_id: "12345" }
  })
});

const result = await response.json();
console.log(result);
```

**cURL:**

```bash
curl -X POST "https://mcp.darcyiq.com/v1/abc123/tools/call" \
  -H "Authorization: Bearer mcp_key_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "get_customer", "arguments": {"customer_id": "12345"}}'
```

**MCP Client Configuration:**

```json
{
  "mcpServers": {
    "my-integration": {
      "url": "https://mcp.darcyiq.com/v1/abc123",
      "apiKey": "mcp_key_xxxxx"
    }
  }
}
```

## Monitor Tab: Viewing Logs

The Monitor tab shows real-time logs from your deployed integration.

### Log Information

| Field          | Description                   |
| -------------- | ----------------------------- |
| **Timestamp**  | When the event occurred       |
| **Level**      | INFO, WARNING, ERROR, DEBUG   |
| **Message**    | Log message content           |
| **Request ID** | Unique identifier for tracing |

### Using Logs for Debugging

Logs help you understand:

* **Tool Invocations**: When and how tools are called
* **Errors**: Stack traces and error messages
* **Performance**: Response times and bottlenecks
* **Usage Patterns**: How the integration is being used

### Log Controls

| Control          | Function                         |
| ---------------- | -------------------------------- |
| **Refresh**      | Load latest logs                 |
| **Auto-refresh** | Continuously update (toggle)     |
| **Filter**       | Filter by level or search text   |
| **Pagination**   | Navigate through historical logs |

## Sharing Integrations

Share your integrations with team members to enable collaboration.

### Permission Levels

| Level      | Capabilities                               |
| ---------- | ------------------------------------------ |
| **Owner**  | Full control: edit, deploy, share, delete  |
| **Editor** | Can modify code, configure secrets, deploy |
| **Viewer** | Read-only: can view code and logs          |

### Sharing an Integration

{% stepper %}
{% step %}
**Open Share Dialog**

From the MCP server list or builder, click the **Share** button.
{% endstep %}

{% step %}
**Add Team Members**

Enter email addresses or select from your organization's members.
{% endstep %}

{% step %}
**Set Permissions**

Choose the permission level for each person:

* **Owner**: For co-maintainers
* **Editor**: For contributors
* **Viewer**: For reviewers or users
  {% endstep %}

{% step %}
**Send Invitations**

Click **Share** to grant access. Team members can now see the integration in their MCP Studio.
{% endstep %}
{% endstepper %}

### Managing Shared Access

To modify or revoke access:

1. Open the Share dialog
2. Find the user in the list
3. Change their permission level or click **Remove**

## Managing Deployed Integrations

From the **My MCPs** list, you can manage all your integrations:

### Available Actions

| Action        | Description        | When to Use                               |
| ------------- | ------------------ | ----------------------------------------- |
| **Edit**      | Open in builder    | Modify code or settings                   |
| **Duplicate** | Create a copy      | Test changes without affecting production |
| **Deploy**    | Deploy or redeploy | Push updates to production                |
| **Stop**      | Undeploy           | Temporarily disable the integration       |
| **Share**     | Manage access      | Grant or revoke team access               |
| **Favorite**  | Add to favorites   | Quick access from your list               |
| **Delete**    | Remove entirely    | Permanently delete the integration        |

### Updating a Deployed Integration

To update a live integration:

{% stepper %}
{% step %}
**Make Changes**

Edit your code on the Build tab.
{% endstep %}

{% step %}
**Test Locally**

Use the Test panel to verify changes work correctly.
{% endstep %}

{% step %}
**Redeploy**

Go to the Deploy tab and click **Deploy** again. The new version replaces the current deployment.

{% hint style="warning" %}
**Downtime**: There may be a brief interruption (a few seconds) while the new version deploys.
{% endhint %}
{% endstep %}
{% endstepper %}

### Stopping an Integration

To temporarily disable an integration without deleting it:

1. Click **Stop** from the actions menu
2. The status changes to **Archived**
3. The integration is no longer available in Chat or Workflows
4. You can redeploy later to restore it

### Deleting an Integration

{% hint style="warning" %}
**Permanent Action**: Deleting an integration removes all code, configuration, and history. This cannot be undone.
{% endhint %}

1. Click **Delete** from the actions menu
2. Confirm the deletion
3. The integration is permanently removed

## Organization Favorites

Mark integrations as organization favorites to highlight them for your team:

### Adding to Favorites

1. Click the **star icon** on any integration
2. Optionally set a custom display name
3. The integration appears in the "Organization Recommended" section

### Benefits of Favorites

| Benefit             | Description                                     |
| ------------------- | ----------------------------------------------- |
| **Visibility**      | Appear at the top of the MCP Catalog            |
| **Standardization** | Guide team members to approved integrations     |
| **Custom Naming**   | Use names that make sense for your organization |

## Deployment Best Practices

### Before Deployment

| Practice              | Description                                 |
| --------------------- | ------------------------------------------- |
| **Test Thoroughly**   | Use the Test panel to verify all tools work |
| **Validate Code**     | Run validation to catch errors              |
| **Document Tools**    | Add clear descriptions for AI understanding |
| **Configure Secrets** | Ensure all credentials are set              |

### After Deployment

| Practice             | Description                             |
| -------------------- | --------------------------------------- |
| **Monitor Logs**     | Check for errors or unexpected behavior |
| **Test in Chat**     | Verify tools work in real conversations |
| **Share Carefully**  | Only give necessary permissions         |
| **Update Regularly** | Keep dependencies and code current      |

### Security Considerations

| Practice                | Description                              |
| ----------------------- | ---------------------------------------- |
| **Rotate API Keys**     | Change keys if they may be compromised   |
| **Minimum Permissions** | Share with appropriate access levels     |
| **Monitor Usage**       | Watch logs for unexpected activity       |
| **Secure Secrets**      | Never expose credentials in code or logs |

## Next Steps

| Goal                      | Documentation                                                                              |
| ------------------------- | ------------------------------------------------------------------------------------------ |
| View code examples        | [Code Samples](/integrations-and-configuration/mcp-studio/mcp-studio-samples.md)           |
| Troubleshoot issues       | [Troubleshooting](/integrations-and-configuration/mcp-studio/troubleshooting.md)           |
| Browse the MCP Catalog    | [MCP Catalog](/integrations-and-configuration/mcp-studio/mcp-catalog.md)                   |
| Build custom integrations | [Building Custom MCPs](/integrations-and-configuration/mcp-studio/building-custom-mcps.md) |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.darcyiq.com/integrations-and-configuration/mcp-studio/deploying-mcps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
