/cloudflare-vm:workers-vpcfrom cloudflare-vm
Workers VPC Connectivity: Connect Cloudflare Workers to private networks and internal infrastructure using TCP Sockets.
Ships in cloudflare-vm. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Vendored from themusebook/skills (derived from cloudflare/skills, Apache-2.0). This snapshot may be outdated: confirm limits, pricing, API signatures and config options against https://developers.cloudflare.com/ before you cite them. When this file and the docs disagree, trust the docs.
When invoked: read every file in this skill's directory before answering, so you have the full reference: api.md, configuration.md, gotchas.md, patterns.md. Then answer the user's question (or, if none was given, summarise the product: what it is, config, API, patterns and gotchas). Related products are sibling skills, linked as ../<product>/.
Connect Cloudflare Workers to private networks and internal infrastructure using TCP Sockets.
Workers VPC connectivity enables outbound TCP connections from Workers to private resources in AWS, Azure, GCP, on-premises datacenters, or any private network. This is achieved through the TCP Sockets API (cloudflare:sockets), which provides low-level network access for custom protocols and services.
Key capabilities:
Note: This reference documents the TCP Sockets API. For the newer Workers VPC Services product (HTTP-only service bindings with built-in SSRF protection), refer to separate documentation when available. VPC Services is currently in beta (2025+).
Need private network connectivity from Workers?
| Requirement | Use | Why |
|---|---|---|
| HTTP/HTTPS APIs in private network | VPC Services (beta, separate docs) | SSRF-safe, declarative bindings |
| PostgreSQL/MySQL databases | Hyperdrive | Connection pooling, caching, optimized |
| Custom TCP protocols (SSH, MQTT, proprietary) | TCP Sockets (this doc) | Full protocol control |
| Simple HTTP with lowest latency | TCP Sockets + Smart Placement | Manual optimization |
| Expose on-prem to internet (inbound) | Cloudflare Tunnel | Not Worker-specific |
Use TCP Sockets when you need:
Don't use TCP Sockets when:
fetch() or VPC Services)import { connect } from 'cloudflare:sockets';
export default {
async fetch(req: Request): Promise<Response> {
// Connect to private service
const socket = connect(
{ hostname: "db.internal.company.net", port: 5432 },
{ secureTransport: "on" }
);
try {
await socket.opened; // Wait for connection
const writer = socket.writable.getWriter();
await writer.write(new TextEncoder().encode("QUERY\r\n"));
await writer.close();
const reader = socket.readable.getReader();
const { value } = await reader.read();
return new Response(value);
} finally {
await socket.close();
}
}
};
Most private network connectivity combines TCP Sockets with Cloudflare Tunnel:
┌─────────┐ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Worker │────▶│ TCP Socket │────▶│ Tunnel │────▶│ Private │
│ │ │ (this API) │ │ (cloudflared)│ │ Network │
└─────────┘ └─────────────┘ └──────────────┘ └─────────────┘
See configuration.md for Tunnel setup details.
| Limit | Value |
|---|---|
| Max concurrent sockets per request | 6 |
| Blocked destinations | Cloudflare IPs, localhost, port 25 |
| Scope requirement | Must create in handler (not global) |
See gotchas.md for complete limits and troubleshooting.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vmaia00/claude-specs --plugin cloudflare-vm64 skills in this plugin
/agents-sdkCloudflare Agents SDK: Cloudflare Agents SDK enables building AI-powered agents on Durable Objects with state, WebSockets, SQL, scheduling, and AI integration./ai-gatewayCloudflare AI Gateway: Expert guidance for implementing Cloudflare AI Gateway - a universal gateway for AI model providers with analytics, caching, rate limiting, and routing capabilities./ai-searchCloudflare AI Search Reference: Expert guidance for implementing Cloudflare AI Search (formerly AutoRAG), Cloudflare's managed semantic search and RAG service.Other plugins' skills for the same job