I find academic articles and books for research and literature reviews.

Hono-MCP-Server-Sse-Transport
1
Github Watches
0
Github Forks
3
Github Stars
MCP Server transport for Hono applications
Overview
This project provides a transport for Hono application that needs to connect to MCP Server. An official TypeScript SDK is designed to be used with express
.
If you try and follow their instructions but change express
with hono
, you will find that it's not going to work. Even if you set HttpBinding
as an env (see an example from @hono/node-server),
it still doesn't work as some headers are being added to a response after it's sent.
This implementation is inspired by the following pull request
You can use this transport until there is a proper support for Hono in the official SDK.
Getting started
Installation
pnpm add -D hono-mcp-server-sse-transport
Usage
import { Hono } from 'hono';
import { serve } from '@hono/node-server';
import { streamSSE } from 'hono/streaming';
import { SSETransport } from 'hono-mcp-server-sse-transport';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
const mcpServer = new McpServer(
{
name: 'your-mcp-server-name',
version: '1.0.0',
},
{
capabilities: {
tools: {},
},
},
);
// here you add your tools
// ...
const app = new Hono();
// to support multiple simultaneous connections we have a lookup object from
// sessionId to transport
const transports: { [sessionId: string]: SSETransport } = {};
app.get('/sse', (c) => {
return streamSSE(c, async (stream) => {
const transport = new SSETransport('/messages', stream);
transports[transport.sessionId] = transport;
stream.onAbort(() => {
delete transports[transport.sessionId];
});
await mcpServer.connect(transport);
while (true) {
// This will keep the connection alive
// You can also await for a promise that never resolves
await stream.sleep(60_000);
}
});
});
app.post('/messages', async (c) => {
const sessionId = c.req.query('sessionId');
const transport = transports[sessionId];
if (transport == null) {
return c.text('No transport found for sessionId', 400);
}
return transport.handlePostMessage(c);
});
serve(
{
fetch: app.fetch,
port: 3000,
},
);
相关推荐
Confidential guide on numerology and astrology, based of GG33 Public information
Advanced software engineer GPT that excels through nailing the basics.
Take an adjectivised noun, and create images making it progressively more adjective!
Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.
Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)
MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.
Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle
La communauté du curseur et de la planche à voile, recherchez des règles et des MCP
Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.
Reviews

user_lcnlOMKT
As a dedicated user of Hono MCP applications, I am thoroughly impressed with the hono-mcp-server-sse-transport by NikaBuligini. The seamless integration and efficient server-sent events transport enhance the overall performance and reliability. It has truly transformed the way we handle real-time data communication. Highly recommend checking it out!