📦
Hono MCP Generator
Generate an MCP server for a Hono app using @hono/zod-openapi and openapi-ts
0 installs
1 stars
Trust: 41 — Fair
Devtools
Installation
npx hono-mcp-generatorAsk AI about Hono MCP Generator
Powered by Claude · Grounded in docs
I know everything about Hono MCP Generator. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Loading tools...
Reviews
Documentation
Getting Started
To install dependencies:
bun install
To generate OpenAPI spec, along with client SDK and MCP app:
bun client:gen
Then un-comment the mcpApp import and routing in src/index.ts:
import mcpApp from '../sdk/mcp.gen';
// ...
app.route('/mcp', mcpApp);
To run:
bun dev
To launch MCP inspector:
bun mcp:inspector
Testing
-
Set the MCP Inspector target URL to
http://localhost:3000/mcp. -
Select
Connect, thenList Tools. -
Select the
Get Usertool. -
Add an arbitrary ID value as a path parameter.
-
Select
Run Tool. -
The returned mock User should have the ID value you entered!
Notes
- Client generation fails on any TypeScript errors, so the initial generated MCP import must be commented-out.
- The
@modelcontextprotocol/sdkdependency is only compatible with Zod 3, so theopenapi-tsconfig was updated accordingly. - Paths in the
openapi-tsconfig were updated to be compatible with this project's structure. - The
api-config.tsfile depends on a generated type file, which seems a little fragile, but doesn't cause any compile-time problems. - The
api-config.tsfile was modified to directly includeclientConfig, and project-specific values likeappConfigandApiErrorwere removed for simplicity.
Roadmap
- The
registerToolmethod is recommended overtoolfor more robust use-cases. - It may be helpful to add a
List ToolsMCP endpoint to help clients discover available tools and resources. - Passing auth credentials via MCP is not currently supported.
