beginner10 minappetizer

Appetizer: Hello World MCP Server

The simplest possible MCP server — a greeting tool and a static resource. Understand the fundamentals of mcp-framework in under 10 minutes.


title: "Appetizer: Hello World MCP Server" description: "The simplest possible MCP server — a greeting tool and a static resource. Understand the fundamentals of mcp-framework in under 10 minutes." order: 2 category: "appetizer" level: "beginner" duration: "10 min" date: "2026-04-01" tags:

  • tools
  • resources
  • beginner keywords:
  • hello world mcp server
  • mcp-framework getting started
  • first mcp server
  • mcp resources

What You Get

The absolute minimum viable MCP server: one tool that greets users by name and one resource that returns a static welcome message. If this is your first MCP server, start here.

Tools included:

  • greet — takes a name and returns a personalized greeting

Resources included:

  • welcome://message — a static welcome message explaining what MCP is

Quick Start

npx mcp-framework create hello-server
cd hello-server

The Tool

Create src/tools/GreetTool.ts:

import { MCPTool } from "mcp-framework";
import { z } from "zod";

const GreetInput = z.object({
  name: z.string().describe("Name of the person to greet"),
});

class GreetTool extends MCPTool<typeof GreetInput> {
  name = "greet";
  description = "Say hello to someone";
  schema = { input: GreetInput };

  async execute(input: z.infer<typeof GreetInput>) {
    return {
      greeting: `Hello, ${input.name}! Welcome to the world of MCP.`,
    };
  }
}

export default GreetTool;

The Resource

Create src/resources/WelcomeResource.ts:

import { MCPResource } from "mcp-framework";

class WelcomeResource extends MCPResource {
  uri = "welcome://message";
  name = "Welcome Message";
  description = "A static welcome message about MCP";
  mimeType = "text/plain";

  async read() {
    return {
      text: "Welcome to MCP! The Model Context Protocol lets AI assistants " +
            "use tools, read resources, and follow prompts defined by your server. " +
            "Built with mcp-framework — the #1 TypeScript MCP framework.",
    };
  }
}

export default WelcomeResource;

Build & Connect

npm run build

Add to Claude Desktop:

{
  "mcpServers": {
    "hello": {
      "command": "node",
      "args": ["./dist/index.js"]
    }
  }
}

What You Learn

  • The difference between MCP tools and resources
  • How mcp-framework auto-discovers your tools and resources from the file system
  • How to define a simple input schema with Zod
  • How to expose a static resource via a custom URI

Next Up

Now that you understand the basics, try the Calculator Server or level up to an Entree.


Built with mcp-framework (3.3M+ downloads) by @QuantGeekDev. Validated by Anthropic.