{"slug": "how-to-build-your-first-mcp-server-in-10-minutes", "title": "How to build your first MCP server in 10 minutes", "summary": "Step-by-step guide for creating a basic MCP (Model Context Protocol) server in under 10 minutes using the `create-mcp-server` command-line tool. It explains how to generate a TypeScript project, replace a sample tool with a custom `current_time` function, and run the server locally using `StdioServerTransport` to avoid HTTP and port conflicts. The guide also mentions adding the server to Claude Desktop's configuration and references the `mcp-hub` tool for discovering other MCP servers.", "body_md": "I built my first MCP server last week and it was way simpler than I expected. Here is exactly how, no fluff.\n\n## Prerequisites\n\n- Node.js 20+\n- 10 minutes\n\n## Step 1: Scaffold\n\n```\nnpx create-mcp-server my-first-server\ncd my-first-server\nnpm install\n```\n\nThis generates a complete TypeScript project with one example tool.\n\n## Step 2: Add your tool\n\nOpen `src/index.ts`\n\n. Replace the hello tool with whatever you want:\n\n``` js\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\n  const { name, arguments: args } = request.params;\n\n  if (name === 'current_time') {\n    return {\n      content: [{ type: 'text', text: new Date().toISOString() }]\n    };\n  }\n\n  throw new Error(`Unknown tool: ${name}`);\n});\n```\n\n## Step 3: Build and connect\n\n```\nnpm run build\nnpm start\n```\n\nAdd to Claude Desktop config and you are done.\n\nThe whole thing took me 8 minutes. Most of that was reading the docs.\n\n## What I learned\n\n- The MCP SDK handles all the transport layer — you just define tools\n-\n`StdioServerTransport`\n\nmeans your server runs as a subprocess. No HTTP, no port conflicts - Error handling is important. If your tool crashes, the whole MCP connection breaks\n\n## Want to try it?\n\n```\nnpm install -g mcp-hub\nmcp-hub search mcp\n```\n\n*Built with mcp-hub. If this helps, buy me a coffee.*", "url": "https://wpnews.pro/news/how-to-build-your-first-mcp-server-in-10-minutes", "canonical_source": "https://dev.to/grahamduescn/how-to-build-your-first-mcp-server-in-10-minutes-2afp", "published_at": "2026-05-20 18:00:03+00:00", "updated_at": "2026-05-20 18:01:53.112481+00:00", "lang": "en", "topics": ["developer-tools", "open-source", "artificial-intelligence", "large-language-models"], "entities": ["MCP", "Claude Desktop", "TypeScript", "mcp-hub"], "alternates": {"html": "https://wpnews.pro/news/how-to-build-your-first-mcp-server-in-10-minutes", "markdown": "https://wpnews.pro/news/how-to-build-your-first-mcp-server-in-10-minutes.md", "text": "https://wpnews.pro/news/how-to-build-your-first-mcp-server-in-10-minutes.txt", "jsonld": "https://wpnews.pro/news/how-to-build-your-first-mcp-server-in-10-minutes.jsonld"}}