cd /news/developer-tools/how-to-build-your-first-mcp-server-i… · home topics developer-tools article
[ARTICLE · art-3529] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

How to build your first MCP server in 10 minutes

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.

read1 min views11 publishedMay 20, 2026

I built my first MCP server last week and it was way simpler than I expected. Here is exactly how, no fluff.

Prerequisites #

  • Node.js 20+
  • 10 minutes

Step 1: Scaffold #

npx create-mcp-server my-first-server
cd my-first-server
npm install

This generates a complete TypeScript project with one example tool.

Step 2: Add your tool #

Open src/index.ts

. Replace the hello tool with whatever you want:

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  const { name, arguments: args } = request.params;

  if (name === 'current_time') {
    return {
      content: [{ type: 'text', text: new Date().toISOString() }]
    };
  }

  throw new Error(`Unknown tool: ${name}`);
});

Step 3: Build and connect #

npm run build
npm start

Add to Claude Desktop config and you are done.

The whole thing took me 8 minutes. Most of that was reading the docs.

What I learned #

  • The MCP SDK handles all the transport layer — you just define tools

StdioServerTransport

means your server runs as a subprocess. No HTTP, no port conflicts - Error handling is important. If your tool crashes, the whole MCP connection breaks

Want to try it? #

npm install -g mcp-hub
mcp-hub search mcp

Built with mcp-hub. If this helps, buy me a coffee.

── more in #developer-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-build-your-fi…] indexed:0 read:1min 2026-05-20 ·