A Model Context Protocol server deployed as a serverless HTTP endpoint on Val Town.
Uses Streamable HTTP (the modern MCP transport as of spec 2025-03-26), replacing the older SSE transport.
POST https://NK5--beb4815432c311f19d3342dde27851f2.web.val.run/mcp
Health check:
GET https://NK5--beb4815432c311f19d3342dde27851f2.web.val.run/
| Tool | Description |
|---|---|
echo | Returns the exact message you send |
calculate | Evaluates a safe math expression (e.g. 2 + 2 * 3) |
fetch_url | Fetches a URL and returns its text content |
| URI | Description |
|---|---|
info://server | Server info and capability listing |
| Prompt | Description |
|---|---|
summarize | Template to ask a model to summarize text (brief or detailed) |
Add to your MCP config:
{ "mcpServers": { "val-town-mcp": { "transport": "http", "url": "https://NK5--beb4815432c311f19d3342dde27851f2.web.val.run/mcp" } } }
npx @modelcontextprotocol/inspector # Enter the URL above and select "Streamable HTTP"
Rendering mermaid diagram...
Stateless mode: Each request creates a fresh server instance — ideal for serverless. No session state is maintained between calls.
Add your own tools inside buildServer() in main.ts:
server.registerTool("my-tool", {
title: "My Tool",
description: "Does something useful",
inputSchema: { input: z.string() },
}, async ({ input }) => ({
content: [{ type: "text", text: `Result: ${input}` }],
}));