• CLEANUP
  • REMOVAL
  • ROUTING
  • HUMAN

How to manage tunnel lifecycle with your AI

Connect your AI to Cloudflare once. From there, you can clean up your environment by talking to your agent instead of using the CLI.

Ask AI about this page

Short answer

How can I clean up my Cloudflare tunnels with AI?

Your AI client uses specific tools to delete unused tunnels, remove routes, and clear stale connections. This keeps your Cloudflare setup clean and prevents configuration drift. Here is how the process works.

Cleanup outcomes

Where your changes land.

The AI performs the heavy lifting to tidy up your infrastructure.

CLEANUP

Clear stale connections

The AI uses cleanup_connections to drop old sessions. This clears out ghost connections that clutter your dashboard.

REMOVAL

Delete old tunnels

The AI runs delete_tunnel to wipe out decommissioned tunnel instances. You get a clean environment without manual CLI commands.

ROUTING

Remove specific routes

The AI calls delete_route to strip away individual network paths. This is how you fix routing errors or tighten security.

HUMAN

Review and confirm

The AI identifies which tunnels or routes are targets for deletion. You stay in control by deciding which specific items to remove.

The workflow

What your AI does when the cleanup request arrives.

The AI translates your natural language into direct Cloudflare actions.

  1. Identify targets

    Your AI scans your current setup to find the specific tunnels or routes you want to target.

    delete_tunneldelete_route
  2. Clear connections

    The AI wipes out inactive or hanging sessions to refresh the tunnel state.

    cleanup_connections
  3. Remove routes

    The AI strips away the specific network paths you no longer need.

    delete_route
  4. Destroy tunnels

    The AI removes the entire tunnel entity from your Cloudflare account.

    delete_tunnel

Try it

Copy these to start.

Use these prompts to trigger the cleanup tools.

Starting points

These are opening lines. Replace the tunnel names or route IDs with your actual Cloudflare identifiers.

Cloudflare Tunnel Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_hT7kuznY9UnZpXYZT9IsTzVtPYMm0Ja2T7OuWTJd/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Cloudflare Tunnel capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "cloudflare-tunnel-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_hT7kuznY9UnZpXYZT9IsTzVtPYMm0Ja2T7OuWTJd/mcp"
    }
  }
}
Copy into chat04
  • Delete the tunnel named 'dev-tunnel-01'.

  • Remove the route for 'api.example.com' from my tunnels.

  • Clean up all stale connections for my production tunnels.

  • Find and delete any tunnels that haven't been active recently.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Cloudflare Tunnel once, then ask.

One link is all it takes. Your login stays encrypted on our side, and you can start managing your environment immediately.

Connect Cloudflare Tunnel to your AI

FAQ

How this task behaves

  • 01

    Can the AI create new tunnels?

    No. This task is strictly for managing the lifecycle of existing tunnels and routes.

  • 02

    Will the AI delete my entire Cloudflare account?

    No. The AI only has tools to delete specific tunnels, routes, and connections.

  • 03

    Can the AI change my account settings?

    No. The AI cannot modify account-level configurations or billing settings.

  • 04

    Does the AI need my Cloudflare password?

    No. You connect via Vinkius, and your credentials stay encrypted.

  • 05

    Can I undo a tunnel deletion?

    No. Once the AI executes a deletion tool, that tunnel is gone.

  • More questions about Cloudflare Tunnel? The Connector page answers them. See everything the Cloudflare Tunnel Connector can do

Connect Cloudflare Tunnel to Claude, Cursor, ChatGPT & more