Skip to content
Back to the catalog
Project mcp-serverNetworkingIntermediateBeta

Build your own MCP server

Build an MCP server from scratch. Implement Model Context Protocol with JSON-RPC, tools and resources to connect AI clients to your programs.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

MCP lets applications and agents discover capabilities through a common protocol. In this project you will implement the server rather than integrate an SDK.

You will process one JSON message per stdin line and emit compact JSON responses on stdout. You will progress from the handshake to tools, resources, and reproducible protocol errors.

Roadmap

5 stages across 3 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 12 stages

    Protocol core

    Establish NDJSON transport, JSON-RPC, and the initial MCP negotiation.

    1. 01Speak JSON-RPC
    2. 02Negotiate the MCP session
  2. Phase 22 stages

    Useful capabilities

    Publish tools and resources a client can discover and use.

    1. 01Publish and invoke tools
    2. 02Expose resources
  3. Phase 31 stage

    Robust server

    Complete the server with validation, notifications, and standard errors.

    1. 01Harden the protocol

Before you start

A local MCP server that negotiates its version, advertises capabilities, lists and invokes tools, exposes text resources, and returns well-formed JSON-RPC errors.

  • bittorrent
    Coming soon

    Build your own BitTorrent client

    Build a BitTorrent client from scratch. Decode bencode, contact trackers and download a real file through the peer-to-peer protocol.

    Advanced12 stages~20 hNetworking
    bencodeP2Pprotocols+1

    Go · Python · Java

  • dns-resolver
    Coming soon

    Build your own DNS resolver

    Build a DNS resolver from scratch. Encode and parse UDP packets, then resolve domain names by walking the hierarchy from root servers.

    Intermediate8 stages~9 hNetworking
    UDPbinaryprotocols

    Go · Rust · Python

  • http-server
    Coming soon

    Build your own HTTP server

    Build an HTTP server from scratch. Parse requests from socket bytes, manage connections and serve concurrent traffic with real HTTP responses.

    Intermediate10 stages~12 hNetworking
    socketsTCPHTTP+1

    Go · Python · C · Rust