Skip to main content
Mythos

How to Build Your First MCP Server

How to build your first MCP server is a practitioner's guide to creating a 📝Model Context Protocol server that connects any data source or tool to 📝Claude Code, Claude.ai, or any MCP-compatible AI client. MCP servers are the connective tissue of the 📝Augmentation Stack — they turn isolated tools into AI-accessible infrastructure.

What an MCP Server Does

An MCP server is a lightweight program that exposes tools (actions the AI can take), resources (data the AI can read), and prompts (reusable instruction templates) to AI clients through a standardized protocol. The AI client discovers what the server offers and calls it as needed. See: 📝MCP vs RAG.

Examples of what MCP servers connect:

  • A database → the AI can query and write data
  • A file system → the AI can read and manage files
  • A browser → the AI can navigate, click, and extract information
  • A knowledge base like 📝MythOS → the AI can search, read, create, and update memos
  • An API → the AI can call any external service

The Quickest Path: TypeScript SDK

The official TypeScript SDK's v2 server package is @modelcontextprotocol/server; tool schemas use Zod. This example follows the SDK's first-server tutorial.

npm init -y
npm pkg set type=module
npm install @modelcontextprotocol/server zod tsx

Create server.ts:

import { McpServer } from '@modelcontextprotocol/server';
import { serveStdio } from '@modelcontextprotocol/server/stdio';
import * as z from 'zod/v4';

function createServer(): McpServer {
    const server = new McpServer({ name: 'my-first-server', version: '1.0.0' });

    // Define a tool
    server.registerTool(
        'hello',
        {
            description: 'Say hello to someone',
            inputSchema: z.object({ name: z.string().describe('Name to greet') })
        },
        async ({ name }) => ({
            content: [{ type: 'text', text: `Hello, ${name}! This is your first MCP tool.` }]
        })
    );

    return server;
}

// Serve it over stdio
void serveStdio(createServer);

Register it with Claude Code from the project folder; everything after -- is the command that starts your server:

claude mcp add my-first-server -- npx tsx server.ts

That's it. Claude Code can now call your hello tool.

From Hello World to Useful

The jump from a demo to something valuable follows a pattern:

  1. Pick a data source you query manually. A project database, a spreadsheet, an API you check daily. The best first MCP server automates a lookup you do repeatedly
  2. Expose read-only tools first. search, get, list. Let the AI query your data without modifying it. Build trust before adding writes
  3. Add write tools when the reads are reliable. create, update, delete. Gate destructive operations with confirmation patterns or safety annotations (destructiveHint: true)
  4. Add resources for static context. Configuration, schemas, documentation. Resources load into context without the AI needing to call a tool
  5. Add prompts for complex workflows. Reusable instruction templates that combine multiple tools into a coherent sequence

Transport Options

  • stdio — for local servers running on your machine. Claude Code, Claude Desktop, and Cursor use this. The server runs as a child process of the AI client
  • Streamable HTTP — for remote servers accessible over the network. Claude.ai connectors and cross-device access use this. Requires hosting the server somewhere accessible

📝MythOS MCP supports both: stdio via the mythos-mcp npm package, Streamable HTTP via mythos.one/api/mcp.

What Makes a Good MCP Server

From building and using MCP servers across 📝Brian Bot's 57-agent ecosystem (as of April 2026):

  • Safety annotations on every tool. readOnlyHint, destructiveHint, idempotentHint. These tell the AI client how to handle permissions
  • Descriptive tool names and descriptions. The AI decides which tool to call based on the name and description. Vague names produce wrong tool calls
  • Error messages that help the AI recover. "Not found: memo ID abc123 does not exist" is better than "Error 404." The AI can retry with a different approach if it understands what went wrong
  • Scoped access. Don't expose everything. Expose what the AI needs for the workflows you're building. You can always add more tools later

The Ecosystem

As of November 10, 2026, PulseMCP lists 21,561 MCP servers. Before building your own, check if someone's already built what you need. Common servers: filesystem, PostgreSQL, GitHub, Slack, Google Drive, Playwright (browser automation), and knowledge platforms like MythOS.

📝Anthropic donated 📝MCP to the Agentic AI Foundation, a directed fund under the Linux Foundation, in December 2025 (announcement). Official SDKs are available for TypeScript, Python, C#, Go, Rust, Ruby, Java, Swift, PHP, and Kotlin.

My first MCP server was a filesystem reader. It took 20 minutes and felt like a party trick. My second was a MythOS connector that gave Claude Code access to my entire knowledge library. That one changed how I work. The jump from "AI can read my files" to "AI can search, read, and write to my knowledge system" is the jump from a demo to 📝human-AI augmentation.

Build the hello world. Then build the thing that connects your AI to the data you actually care about. That's where the value is.

Contexts

MythOS is a product of Cooperating Citizens of One, Inc.

TermsPrivacyRefundsSub-processorsContact

© 2026 Cooperating Citizens of One, Inc. · MythOS since 2017 · Not affiliated with Anthropic.