{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "modelcontextprotocol-typescript-sdk--build-a-stdio-mcp-tool-server-with-the-typescript-sdk",
 "repo": "modelcontextprotocol/typescript-sdk",
 "repo_url": "https://github.com/modelcontextprotocol/typescript-sdk",
 "repo_slug": "modelcontextprotocol-typescript-sdk",
 "title": "Build your first MCP tool server in TypeScript",
 "page_title": "How to build your first MCP tool server in TypeScript with TypeScript SDK",
 "summary": "Expose a function as an MCP tool over stdio so Claude Code, Cursor or any MCP client can call it.",
 "who": "A developer who wants an AI agent to use one of their own functions.",
 "problem": "Agents cannot call your internal logic until it is wrapped in a protocol they speak.",
 "outcome": "A running stdio MCP server with one registered tool that any MCP client can list and call.",
 "steps": [
  "Install the server package with `npm install @modelcontextprotocol/server`",
  "Create an McpServer with a name and version, as in the README Getting Started example",
  "Register a tool with server.registerTool, giving it a description and a zod inputSchema, like the greet example",
  "Connect a StdioServerTransport with server.connect and add the server to your MCP client"
 ],
 "agent_prompt": "Using modelcontextprotocol/typescript-sdk, install it with `npm install @modelcontextprotocol/server` and build a stdio MCP server that exposes <my function> as a tool with registerTool and a zod inputSchema, following the greet example.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The README points to the docs tutorials for a full weather alert server; the snippet is a minimal greet tool.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Node.js with npm, or Bun or Deno as the README shows",
  "The server package from `npm install @modelcontextprotocol/server`, or the client package from `npm install @modelcontextprotocol/client`",
  "zod for tool input schemas, as in the README example"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "permissions",
   "notice": "Any tool you register can be called by the connected agent, so do not expose functions that delete data or spend money without your own checks."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/modelcontextprotocol-typescript-sdk/build-a-stdio-mcp-tool-server-with-the-typescript-sdk/",
 "md": "https://dedupedai.com/use-cases/modelcontextprotocol-typescript-sdk/build-a-stdio-mcp-tool-server-with-the-typescript-sdk/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/modelcontextprotocol-typescript-sdk--build-a-stdio-mcp-tool-server-with-the-typescript-sdk.json",
 "api_version": "v1"
}
