Wire SDK
For teams building agents, harnesses, or AI infrastructure who want Wire container connectivity as a first-class part of the product. Your user authorizes in their browser; you get back a scoped MCP endpoint and API key to hand to your agent.
You don’t run the storage. You don’t build the import flow. You don’t manage user data. Wire owns the connect screen, the auth, and the connection lifecycle. Your agent keeps speaking MCP, now with whatever the user has brought along.
This page covers connect mode, where each user authorizes against their own Wire account. If your product should own the containers and the billing instead, with no end-user Wire account at all, see Provision mode.
Install
Section titled “Install”npm install @usewire/sdkRuns on Node 18+, Cloudflare Workers, Deno, and Bun.
Register your agent
Section titled “Register your agent”Before the SDK can connect on behalf of your users, register your agent from the Agents entry in your account menu in the Wire dashboard. You’ll get a slug (passed as agentId) that the SDK uses to identify your agent on every call.
Connect
Section titled “Connect”import { WireClient } from '@usewire/sdk';
const client = new WireClient({ agentId: 'my-agent' });
const connection = await client.connect({ label: 'my-laptop' });
// Hand these to your agent's MCP client:const mcp = new MCPClient({ url: connection.mcpUrl, headers: { 'x-api-key': connection.apiKey },});connect() shows the user a short code and opens their browser. The user types the code on the connect screen, picks a container, and connect() resolves with the result. That’s the whole happy path.
What you get
Section titled “What you get”interface Connection { mcpUrl: string; apiUrl: string; apiKey: string; containerId: string; containerName: string; orgSlug: string | null; expiresAt: Date | null; // ephemeral containers only agentId: string; credentialId: string; deviceKey: DeviceKey; connectedAt: Date; label?: string;}The SDK persists nothing. Keep whatever fields you want from the result, however you want. For typical agent use, the only fields you need at runtime are mcpUrl and apiKey.
Disconnect and status
Section titled “Disconnect and status”await client.disconnect(connection.apiKey);await client.getStatus(connection.apiKey);disconnect revokes the apiKey but keeps the install identity, so reconnect from the same deviceKey still works. getStatus returns a live snapshot of the container and connection.