hono-rpc

Generate type-safe API clients from Hono server routes with TypeScript inference.

68|19|Updated Nov 21, 2025
One-click install
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill hono-rpc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hono-rpc
Source: https://github.com/bobmatnyc/claude-mpm-skills/tree/main/toolchains/javascript/frameworks/hono/rpc
Command: npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill hono-rpc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines full-stack TypeScript development by enabling end-to-end type-safe API client generation without manual code generation, reducing integration errors and improving developer experience.

Core Features & Use Cases

  • Zero-Codegen Type Safety: Automatically infers API client types directly from server routes using TypeScript's type system.
  • End-to-End Validation: Works seamlessly with validators like Zod for both request and response validation.
  • Use Case: When building a complex web application with Hono on the backend and a TypeScript frontend, use this skill to ensure that all API calls made from the client are type-checked against the server's defined routes, preventing runtime errors and improving code maintainability.

Quick Start

Export your server's AppType and use the hc client to make type-safe API calls.

Frequently Asked Questions about hono-rpc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a type-safe API client for a Hono application?

To generate a type-safe API client for a Hono application, export your server's AppType and use the built-in hc client to make fully type-checked API calls. This approach uses TypeScript inference to derive client types directly from server routes.

Can I use Zod validation for request and response types in a Hono RPC setup?

Yes, you can use Zod validation in a Hono RPC setup to achieve end-to-end type safety. The client automatically infers types for JSON bodies, query parameters, and headers validated by Zod on the server, preventing runtime errors.

What is the best way to achieve end-to-end type safety in a full-stack TypeScript app without codegen?

The best way to achieve end-to-end type safety without codegen is using TypeScript's inference system. By exporting your Hono server's AppType, the client automatically derives route types, eliminating manual code generation and reducing integration errors.

Does Hono's RPC client support path parameters and form data?

Yes, Hono's RPC client supports path parameters and form data. The type-safe client inference automatically handles path parameters, query parameters, JSON bodies, form data, and headers, ensuring all client API calls are strictly type-checked.

Why do I need to export my server's AppType for Hono RPC?

You need to export your server's AppType for Hono RPC because the client relies on TypeScript inference to automatically derive types from your server routes. Without exporting the AppType, the hc client cannot access the route definitions to provide type checking.