• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
nbbaier

nbbaier

honoMcp

Public
Like
honoMcp
Home
Code
2
README.md
H
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
README.md

MCP Greeting Server for Val Town

A simple Model Context Protocol (MCP) server built with Hono that can be deployed to Val Town. It provides a greeting tool that generates personalized messages in multiple languages.

Features

  • Simple greeting tool that supports English, Spanish, and French
  • Built with Hono web framework for fast performance
  • Uses the official MCP SDK with Streamable HTTP transport
  • Ready to deploy on Val Town

Deployment to Val Town

  1. Create a new val on Val Town
  2. Copy the contents of mcp-server.ts into your val
  3. Save and your MCP server is live!

The server will be available at: https://[your-username]-[val-name].val.run

Usage

Connecting to Claude Desktop

Add this to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "greeting-server": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://[your-username]-[val-name].val.run/mcp"
      ]
    }
  }
}

Connecting with Claude Code

claude mcp add --transport http greeting-server https://[your-username]-[val-name].val.run/mcp

Testing the Server

You can test the server is working by visiting:

https://[your-username]-[val-name].val.run/

This should return a JSON response with server information.

Available Tools

greet

Generates a personalized greeting message.

Parameters:

  • name (string, required): The name of the person to greet
  • language (enum, optional): The language for the greeting
    • Options: "english", "spanish", "french"
    • Default: "english"

Example usage in Claude:

Use the greet tool to say hello to Alice in Spanish

Technical Details

  • Framework: Hono (lightweight web framework)
  • MCP SDK: Official TypeScript SDK from Anthropic
  • Transport: Streamable HTTP using fetch-to-node adapter
  • Runtime: Deno (via Val Town)

Architecture

The server uses:

  • McpServer from the MCP SDK to define tools
  • StreamableHTTPServerTransport for HTTP-based MCP communication
  • fetch-to-node to convert between Hono's fetch API and Node.js streams
  • Zod for input validation

Extending

To add more tools, add additional server.tool() calls in the getServer() function:

server.tool(
  "tool-name",
  "Tool description",
  {
    param1: z.string().describe("Parameter description"),
    // more parameters...
  },
  async ({ param1 }) => {
    // Tool implementation
    return {
      content: [
        {
          type: "text",
          text: "Response text",
        },
      ],
    };
  },
);

Resources

  • Val Town Documentation
  • MCP Documentation
  • Hono Documentation
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.