h3-mcp
v0.2.0
Published
<!-- automd:badges color=yellow -->
Readme
h3-mcp
Lightweight Model Context Protocol (MCP) server utilities for h3. Zero MCP SDK dependency. (~16kb gzip, dual-era)
One endpoint serves both protocol eras: the stateless 2026-07-28 revision and the initialize-based revisions (2025-11-25, 2025-06-18, 2025-03-26).
[!WARNING]
h3-mcpis still evolving and may introduce breaking changes.
Quick Start
npx nypm install h3 h3-mcpimport { H3, serve } from "h3";
import { defineMcpHandler, defineTool } from "h3-mcp";
const app = new H3();
app.all(
"/mcp",
defineMcpHandler({
name: "my-server",
version: "1.0.0",
tools: [
defineTool({
name: "hello",
description: "Say hello",
inputSchema: {
type: "object",
properties: { name: { type: "string" } },
required: ["name"],
},
handler: async ({ name }) => ({
content: [{ type: "text", text: `Hello, ${name}!` }],
}),
}),
],
}),
);
serve(app, { port: 3000 });Development
- Clone this repository
- Install latest LTS version of Node.js
- Enable Corepack using
corepack enable - Install dependencies using
pnpm install - Run interactive tests using
pnpm dev - Run the playground using
pnpm play - Run the official conformance suite using
pnpm conformance - Run the docs site using
pnpm install && pnpm devinsidedocs/
License
Published under the MIT license.
