Hono MCP remote server

R
Renaudil y a 2 jours
0

Description

A MCP server that does simple math operations, built on Hono

npx boilerapp hono-mcp-remote-server

文档

Hono Remote MCP Server Example

This example demonstrates how to build a Model Context Protocol (MCP) server using Hono, a lightweight web framework, and deploy it to Vercel. The server exposes mathematical operation tools (add, subtract, multiply, divide) that can be consumed by MCP clients.

Demo

To connect your MCP client to the server, use: https://hono-mcp-demo.vercel.app/mcp

You can also visit https://hono-mcp-demo.vercel.app in your browser.

What is MCP?

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). This example shows how to create an MCP server that exposes tools as HTTP endpoints.

Features

  • Math Operations: Four basic calculator tools (add, subtract, multiply, divide)
  • MCP Handler: Uses mcp-handler library for easy MCP server creation
  • Type Safety: Built with TypeScript and Zod for runtime validation
  • Vercel Deployment: Optimized for serverless deployment on Vercel

Prerequisites

Development

To develop locally:

npm install
vc dev
open http://localhost:3000

Build

To build locally:

npm install
vc build

Deployment

To deploy:

npm install
vc deploy

API Endpoints

  • GET / - Welcome endpoint with server information
  • POST /mcp/* - MCP protocol endpoint for tool execution

Available Tools

The server exposes the following MCP tools:

  • add - Add two numbers
  • subtract - Subtract two numbers
  • multiply - Multiply two numbers
  • divide - Divide two numbers (with zero-division protection)

Using the MCP Server

Once deployed, you can connect to this MCP server from any MCP-compatible client by pointing to the /mcp endpoint. The server handles the MCP protocol transport and tool execution automatically.

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联系我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联系我们,我们将尽快回复。

Hono MCP remote server | BoilerApp