# Caddy Server MCP for AI Agents AI Agent Connect

> Caddy Server MCP lets you manage your web server infrastructure directly through your AI agent. Instead of manually editing Caddyfiles or checking logs, you can tell your agent to update proxy settings, check certificate status, or swap out configs on the fly. It handles the heavy lifting of the Caddy Admin API so you can focus on deploying your apps faster.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_gShVUlwT05Svndiw6yTP7MMzUZIbPaSZETyLT6Vt/ai-agent-connect
- **Tags:** web-server, reverse-proxy, api-gateway, ssl-certificates, automation

## Description

This Connector connects your Caddy instance to your AI agent, turning your web server management into a conversation. You can stop messing around with manual configuration files and instead just tell your agent what you need. If you need to point a new backend to a specific domain, you just ask. If you need to see if your upstreams are actually healthy, the agent pulls that data for you in real-time. It handles everything from basic configuration changes to complex PKI certificate inspections. Because it's hosted on the Vinkius catalog, you can get this set up in minutes and start managing your reverse proxies without switching tabs. It's built for people who want to treat their infrastructure as code but prefer the speed of natural language. You can swap out configuration objects, append new items to arrays, or even gracefully shut down the server process when you're done with a task. It's about having a direct line to your web server's brain.

## Tools

### adapt_config
Converts a Caddyfile into a JSON format without applying it. This is great for previewing changes before you commit them.

### append_config
Adds elements to an array in your Caddy configuration. This lets you expand lists like allowed IPs or backend pools.

### delete_config
Removes a specific value from your Caddy config. Use this to clean up old routes or settings quickly.

### replace_config
Swaps out an existing object or array element. Use this to update specific parts of a config without touching the rest.

### get_config_by_id
Fetches a configuration object using its unique ID. It's the fastest way to grab a specific setting.

### get_config
Exports a configuration path as JSON. Use this to see your current settings in a structured format.

### get_metrics
Pulls server metrics in Prometheus format. It helps you see how your traffic is actually flowing.

### get_pki_ca_certs
Retrieves the certificate chain for a specific CA. This is useful for troubleshooting SSL issues.

### get_pki_ca
Shows details about a specific PKI application CA. Use it to check your internal certificate authority status.

### get_upstreams
Reports the current status of your proxy upstreams. Use this to quickly find which backend nodes are down.

### insert_config
Creates a new object or places an item into a specific array index. This gives you precise control over config order.

### load_config
Sets or replaces the active configuration using JSON or Caddyfile formats. This is how you push changes live.

### stop_server
Gracefully shuts down the Caddy server process. This is your manual kill switch for the web server.

## Prompt Examples

**Prompt:** 
```
Get the full JSON configuration of my Caddy server.
```

**Response:** 
```
I've retrieved your configuration. Here is the current setup:

| Component | Configuration |
| :--- | :--- |
| **HTTP Servers** | 2 |
| **Routes** | 4 |
| **Active Backends** | 3 |

Would you like me to analyze a specific path like `apps/http` or check a specific route?
```

**Prompt:** 
```
Adapt this Caddyfile to JSON: 'example.com { reverse_proxy localhost:8080 }'
```

**Response:** 
```
I've adapted that Caddyfile for you. Here is the resulting JSON structure:

```json
{
  "servers": [{
      "bind_address": ":443",
      "directives": [{
        "type": "reverse_proxy",
        "uri": "http://localhost:8080"
      }]
    }]
}
```

Shall I apply this configuration to your server now?
```

**Prompt:** 
```
Check the status of my proxy upstreams.
```

**Response:** 
```
Fetching upstream status... I found 3 configured upstreams:

*   **api-cluster**: ✅ Healthy (All nodes reachable)
*   **static-assets**: ⚠️ Warning (1 node reporting timeout)
*   **auth-service**: ✅ Healthy

Would you like to see the full Prometheus metrics for these backends?
```

## Capabilities

### Update server configurations
Change your Caddyfile or JSON settings instantly via natural language.

### Convert Caddyfiles to JSON
Turn text-based configs into JSON without actually applying them yet.

### Check upstream health
See if your backend servers are up and running in real-time.

### Inspect PKI certificates
Look up CA information and certificate chains for your domains.

### View performance metrics
Get Prometheus-style data on your server traffic and performance.

### Modify specific config paths
Add, replace, or delete specific parts of your configuration.

### Shut down the server
Gracefully stop the Caddy process when you need to perform maintenance.

## Use Cases

### Updating a proxy backend
A dev needs to point a new API to a load balancer. They ask the agent to use load_config to update the backend settings.

### SSL Troubleshooting
An SRE sees a certificate error. They ask the agent to check get_pki_ca_certs to see if the certificate chain is broken.

### Real-time health checks
A DevOps engineer wants to know why a site is slow. They ask the agent to check get_upstreams to find the hanging node.

### Config migration preview
A team is moving from Caddyfile to JSON. They use adapt_config to see how their old files look in the new format before applying them.

## Benefits

- Update configs instantly with load_config or replace_config instead of manual file editing.
- Debug SSL issues faster by retrieving certificate chains with get_pki_ca_certs.
- Monitor backend health in real-time using get_upstreams to spot failing nodes immediately.
- Preview changes before they go live by using adapt_config to convert Caddyfiles to JSON.
- Track server performance and request traffic using get_metrics for Prometheus-style observability.
- Clean up configuration clutter by using delete_config to remove outdated paths.

## How It Works

The bottom line is you get a direct conversational interface for your web server's admin API.

1. Subscribe to the Caddy Server MCP on Vinkius.
2. Provide your Caddy Admin API URL to your AI client.
3. Ask your agent to perform tasks like updating configs or checking health.

## Frequently Asked Questions

**How does the Caddy Server MCP help with web server management?**
It gives your AI agent direct access to your Caddy Admin API. You can ask it to update configurations, check server health, and manage SSL certificates using natural language instead of manual CLI commands.

**Can I use Caddy Server MCP to update my proxy settings?**
Yes. You can tell your agent to update specific proxy paths, add new backends to a pool, or replace existing configuration objects instantly.

**Does Caddy Server MCP support SSL and certificate management?**
It does. You can use it to inspect internal CA information and retrieve certificate chains for your managed domains to troubleshoot SSL issues.

**Can I monitor my server performance with Caddy Server MCP?**
Yes, the Connector can pull Prometheus-style metrics. Your agent can summarize your traffic volume and server performance for you.

**Is Caddy Server MCP safe for production use?**
It works directly with your Caddy Admin API. As long as your API is secured and you only provide the agent with the necessary permissions, it's a standard way to automate infrastructure.

**Do I need to know JSON to use the Caddy Server MCP?**
No. While the underlying API uses JSON, you can talk to your agent in plain English. It handles the conversion of your requests into the correct format.

**Can I use a Caddyfile instead of JSON to update my configuration?**
Yes! Use the `load_config` tool and set the `content_type` to `text/caddyfile`. You can also use `adapt_config` to preview the JSON conversion before applying it.

**How can I monitor the health of my load-balanced backends?**
Use the `get_upstreams` tool. It returns the current status and health metrics of all configured proxy upstreams in your Caddy instance.

**Is it possible to remove a specific site or route without resetting the whole server?**
Absolutely. Use `delete_config` with the specific path (e.g., `apps/http/servers/srv0/routes/1`) to remove only that element from the active configuration.