Skip to content

Transports

lynq supports two transports: stdio for local development, HTTP for production.

Stdio

ts
await server.stdio();

The client spawns your server as a child process and communicates over stdin/stdout. Use for local development, Claude Desktop, Claude Code, and CLI tools.

HTTP

server.http() returns a Web Standard request handler:

ts
const handler = server.http();
// handler: (req: Request) => Promise<Response>

Mount it on any runtime:

Hono

ts
app.all("/mcp", (c) => handler(c.req.raw));

Deno

ts
Deno.serve(handler);

Bun

ts
Bun.serve({ fetch: handler });

Cloudflare Workers

ts
export default { fetch: handler };

Or use the framework adapters for batteries-included setup:

  • Hono -- mountLynq(app, server)
  • Express -- mountLynq(app, server)

For full HTTP options, stateful vs sessionless, and the onRequest hook, see HTTP Adapter.

What's Next