From e6bb948b7ad7295e19f8ada9fdebfb71aadeea13 Mon Sep 17 00:00:00 2001 From: ZainnQureshii <43629888+ZainnQureshii@users.noreply.github.com> Date: Sun, 8 Nov 2026 17:19:41 +0100 Subject: [PATCH] docs(hono): type the README route callback as Context createMcpHonoApp() returns a plain Hono, so on an inferred callback context c.get('parsedBody') fails with TS2769. docs/serving/hono.md already uses the explicit c: Context annotation for this reason. Co-Authored-By: Claude Opus 5.5 --- packages/middleware/hono/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/middleware/hono/README.md b/packages/middleware/hono/README.md index b2827954d6..21d7199684 100644 --- a/packages/middleware/hono/README.md +++ b/packages/middleware/hono/README.md @@ -29,9 +29,10 @@ npm install @modelcontextprotocol/server @modelcontextprotocol/hono hono ```ts import { McpServer, WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/server'; import { createMcpHonoApp } from '@modelcontextprotocol/hono'; +import type { Context } from 'hono'; const app = createMcpHonoApp(); -app.all('/mcp', async c => { +app.all('/mcp', async (c: Context) => { // Stateless example: create a server and a transport per request. const server = new McpServer({ name: 'my-server', version: '1.0.0' }); const transport = new WebStandardStreamableHTTPServerTransport({ sessionIdGenerator: undefined });