Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

adapter-standalone

Skill by trpc

Explains how to mount tRPC on Node.js built-in HTTP servers. It covers createHTTPServer(), createHTTPHandler() for custom http.createServer setups, and createHTTP2Handler() for HTTP/2 with TLS.

  • Score 91
  • 41k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install adapter-standalone

Built from the published package, never by AI.

git clone --depth 1 https://github.com/trpc/trpc /tmp/trpc && mkdir -p ~/.claude/skills && cp -r /tmp/trpc/packages/server/skills/adapter-standalone ~/.claude/skills/adapter-standalone

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install adapter-standalone in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a reference for running tRPC on Node.js built-in HTTP servers. It shows how to use createHTTPServer() for a quick standalone server, and createHTTPHandler() when you need your own http.createServer. It also covers createHTTP2Handler() for HTTP/2 over TLS.

The skill explains how to set basePath to strip a URL prefix, add CORS by passing the cors npm package as the middleware option, and limit batch size with maxBatchSize. It is aimed at developers building tRPC APIs on Node.js without a framework such as Express. It depends on the server-setup skill and includes a common mistake note on missing CORS configuration.

Written from the project's SKILL.md and checked against it.

What it can do

  • createHTTPServer()Starts a tRPC server on Node.js's built-in HTTP server with a router and context.
  • createHTTPHandler()Creates a handler to attach tRPC to a custom http.createServer.
  • createHTTP2Handler()Creates a handler for HTTP/2 served over TLS with http2.createSecureServer.
  • basePath optionStrips a URL prefix such as /trpc/ before routing to procedures.
  • CORS via middlewarePasses the cors npm package as the middleware option for cross-origin requests.
  • maxBatchSize optionRejects batch requests with more operations than the set limit with a 400 error.

What you need

  • Node.js
  • @trpc/server package
  • cors npm package for CORS support
  • TLS key and certificate files for HTTP/2
  • zod for input validation in the example

Try asking

  • Set up a tRPC server on Node.js with createHTTPServer and port 3000.
  • Add CORS to my tRPC standalone server for http://localhost:5173.
  • Mount tRPC under /trpc/ with basePath on a custom http.createServer.

Good to know

  • The standalone adapter has no CORS handling by default.
  • The HTTP/2 handler needs a TLS key and certificate.
  • Batches above maxBatchSize are rejected with 400 Bad Request.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: packages/server/skills/adapter-standalone/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to adapter-standalone

All alternatives →

Compare with react-component-performance, react-component-performance or lecture-style

adapter-standalone: common questions

Does the tRPC standalone adapter support CORS?

Not by default. The source says you add CORS by passing the cors npm package as the middleware option.

Can tRPC run over HTTP/2?

Yes. The skill describes createHTTP2Handler() for use with http2.createSecureServer and a TLS key and certificate.

What happens when a batch request is too large?

Requests with more operations than maxBatchSize are rejected with a 400 Bad Request. The source advises setting maxItems on the client's httpBatchLink to the same value.

How do I install adapter-standalone?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is adapter-standalone free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is adapter-standalone safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to adapter-standalone?

Similar skills: react-component-performance, react-component-performance, lecture-style, workshop-style.

adapter-standalone Install

Add to stack

Loading.