Skip to main content
Glama

Hono Math MCP Server

by ericbfriday

Hono MCP Server with Bun JS & Vercel

This project demonstrates how to build a Model Context Protocol (MCP) server using Hono web framework, developed with Bun JS, and deployed on 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)

  • ⚡ Bun JS: Fast JavaScript runtime and package manager for development

  • 🔧 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

With Bun (recommended):

bun install vc dev

Alternative with npm:

npm install vc dev

Open http://localhost:3000 in your browser.

Build

With Bun:

bun install bun run build

Alternative:

npm install vc build

Deployment

bun install # or npm install vc deploy

API Endpoints

  • GET - Welcome endpoint with server information

  • POST - 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.

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables LLMs to perform basic mathematical operations (add, subtract, multiply, divide) through a Model Context Protocol server built with Hono and deployed on Vercel. Provides type-safe calculator tools that can be accessed by any MCP-compatible client.

  1. Demo
    1. What is MCP?
      1. Features
        1. Prerequisites
          1. Development
            1. Build
              1. Deployment
                1. API Endpoints
                  1. Available Tools
                    1. Using the MCP Server

                      MCP directory API

                      We provide all the information about MCP servers via our MCP API.

                      curl -X GET 'https://glama.ai/api/mcp/v1/servers/ericbfriday/vercel-hono-mcp-bun'

                      If you have feedback or need assistance with the MCP directory API, please join our Discord server