* feat: added hono/mcp package
* chore: changeset
* chore: minor changes
* chore: minor changes
* chore: formated the code
* chore: minor correction
* chore: removed changelog file
* chore: changed the class name
* chore: updated the readme
* fix: closed the stream
* chore: minor change
* fix: added an interval to keep the connection alive and merge 2 streams into a single one
* chore: updated lockfile
* fix: stupid mistake 😅
* chore: formatted the README.md file
* chore: minor change
* chore: minor changes
* chore: minor change
* add an explicit return type annotation
* format the code
---------
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
|
||
---|---|---|
.. | ||
src | ||
README.md | ||
package.json | ||
tsconfig.build.json | ||
tsconfig.json | ||
tsconfig.spec.json | ||
vitest.config.ts |
README.md
Hono MCP (Model Context Protocol)
Connect Hono with a Model Context Protocol (MCP) server over HTTP Streaming Transport.
Usage
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import { StreamableHTTPTransport } from '@hono/mcp'
import { Hono } from 'hono'
const app = new Hono()
// Your MCP server implementation
const mcpServer = new McpServer({
name: 'my-mcp-server',
version: '1.0.0',
})
app.all('/mcp', async (c) => {
const transport = new StreamableHTTPTransport()
await mcpServer.connect(transport)
return transport.handleRequest(c)
})
export default app
Author
Aditya Mathur https://github.com/mathuraditya724
License
MIT