new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

MCP · Building servers and clients · all subjects

building servers from scratch

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Decoupled request payload from RPC methods definition SEP-1319

SEP-1319 decouples request payload from RPC methods definition as a developer experience improvement in the November 2025 specification release.

TypeScript: tsconfig.json requirements for MCP server

For a TypeScript MCP server, set tsconfig.json with target: ES2022, module: Node16, moduleResolution: Node16, and other strict mode options. The rootDir should be ./src and outDir should be ./build.

Java MCP server: gradle init for Kotlin projects

In Kotlin, use gradle init to create a new project, selecting Application as the project type and Kotlin as the programming language. Alternatively, use IntelliJ IDEA project wizard.

Rust MCP server basic structure with tool_router macro

In Rust, implement an MCP server by defining a struct with a ToolRouter field, using the #[tool_router] macro on the impl block, marking tool methods with #[tool] attribute, and using the #[tool_handler] macro on the ServerHandler implementation. The main function uses tokio::io stdin/stdout tuple as transport and calls .serve(transport).await on the service created from the server struct.

Rust rmcp crate provides SDK for MCP server implementation

The rmcp crate is the Rust SDK for Model Context Protocol providing ServerHandler, ServiceExt traits, tool_router and tool_handler procedural macros, server handler components, and stdio transport support.

Go MCP server setup with NewServer and AddTool

Create a Go MCP server with mcp.NewServer(&mcp.Implementation{Name: "...", Version: "..."}, nil), then add tools via mcp.AddTool(server, &mcp.Tool{Name: "...", Description: "..."}, handlerFunc). Run the server with server.Run(context.Background(), &mcp.StdioTransport{}).

Rust build command for MCP server release binary

Build a Rust MCP server with `cargo build --release`. The compiled binary is located in target/release/ directory with the project name as the executable filename.

Go build command for MCP server binary

Build a Go MCP server with `go build -o weather .` where 'weather' is the desired output binary name. The binary is created in the current directory.

Give your agent this brain

building servers from scratch — MCP · Building servers and clients