Skip to main content
Get started with one command:
npm create smithery

Overview

In this quickstart, we’ll build a simple MCP server that says hello to users. We’ll use the official TypeScript MCP SDK with the Smithery CLI. By the end, you’ll have a live, deployed server with built-in authentication that you can connect to from any MCP client. For Python, check out our Python quickstart guide.

Prerequisites

1. Initialize the Server

npm create smithery
This retrieves and executes the Create Smithery initializer package, which sets up a TypeScript MCP server scaffold with example code and all necessary dependencies.
The scaffold installs everything you need, including:
  • @smithery/cli as a dev dependency (npm run dev/npm run build use the local CLI)
  • @modelcontextprotocol/sdk and @smithery/sdk as runtime dependencies
If you add the CLI to an existing project manually, run:
npm i -D @smithery/cli
npm i @modelcontextprotocol/sdk @smithery/sdk

2. Edit the Server

In src/index.ts, you’ll see a default server that says hello to a given name. Edit it to add your own tools, resources, and prompts. Here’s the basic structure:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

// Optional: Configuration schema for session
// export const configSchema = z.object({
//   debug: z.boolean().default(false).describe("Enable debug logging"),
// });

export default function createServer({ config }) {
  const server = new McpServer({
    name: "Say Hello",
    version: "1.0.0",
  });

  // Add a tool
  server.registerTool("hello", { 
    title: "Hello Tool", 
    description: "Say hello to someone", 
    inputSchema: { name: z.string().describe("Name to greet") }, 
  }, async ({ name }) => ({ 
    content: [{ type: "text", text: `Hello, ${name}!` }], 
  })); 

  // The scaffold also includes example resources and prompts
  // server.registerResource(...) 
  // server.registerPrompt(...)

  return server.server;
}
Adding config schema (optional)Smithery allows users to customize server behavior for each session by providing API keys, adjusting settings, or modifying operational parameters. Optionally export a configSchema using Zod to define what configuration your server accepts:
export const configSchema = z.object({
  apiKey: z.string().describe("Weather API key"),
  temperatureUnit: z.enum(["celsius", "fahrenheit"]).default("celsius").describe("Temperature unit preference"),
});

3. Testing the Server

npm run dev
This will port-forward your local server to the Smithery Playground via ngrok. You can now test your server by prompting something like “Say hello to Henry”. You can also reference the Smithery CLI for more controls.

4. Deploy the Server

Deployment is a one-click process. Just make a GitHub repo, push your local changes, and then click “Deploy” on the Smithery home page.
I