Skip to content

createMcpHonoApp should support generics for Env (Bindings and Variables) #1877

@yokonao

Description

@yokonao

NOTE: This issue is a feedback for v2 alpha.

https://github.com/modelcontextprotocol/typescript-sdk/blob/%40modelcontextprotocol/hono%402.0.0-alpha.2/packages/middleware/hono/src/hono.ts#L44

Currently, createMcpHonoApp returns a plain Hono instance with BlankEnv({}).

This makes it difficult to access typed environment variables (like c.env.DB in Cloudflare D1) within MCP handlers without resorting to unsafe type casting.

It would be great if we could pass Env types like:

const app = createMcpHonoApp<Env>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions