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

server building basics

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

Python MCP server setup: MCPServer initialization

In Python, initialize an MCP server by importing MCPServer from mcp.server and creating an instance with MCPServer(name). The MCPServer class uses Python type hints and docstrings to automatically generate tool definitions.

TypeScript MCP server: McpServer initialization

In TypeScript, initialize an MCP server by importing McpServer from @modelcontextprotocol/server and creating an instance with new McpServer({name: "...", version: "..."}). The server name and version are required.

Java MCP server with Spring AI: @Service annotation

In Java with Spring AI, create a service class with @Service annotation that contains @Tool-annotated methods. The @Tool annotation marks methods as MCP tools, and @ToolParam can be used to add descriptions to parameters.

Java MCP server: Spring Boot application setup

In Java, set up a Spring Boot MCP server with @SpringBootApplication and create a @Bean of MethodToolCallbackProvider that converts @Tool methods into actionable callbacks. The auto-configuration automatically registers tools with the MCP server.

Kotlin MCP server: Server initialization with capabilities

In Kotlin, initialize a server with Server(Implementation(name, version), ServerOptions(capabilities: ServerCapabilities(...))). ServerCapabilities can include tools: ServerCapabilities.Tools(listChanged: true).

C# MCP server: AddMcpServer and WithStdioServerTransport setup

In C#, set up a STDIO MCP server with builder.Services.AddMcpServer().WithStdioServerTransport().WithToolsFromAssembly().

Ruby MCP server: MCP::Server initialization

In Ruby, initialize a server with MCP::Server.new(name: "...", version: "...", tools: [...]). Pass an array of tool classes to the tools parameter.

Python MCP server: minimum SDK version

Python MCP servers must use the Python MCP SDK version 2.0.0 or higher.

Python: Python 3.10 or higher required

Python MCP servers require Python 3.10 or higher installed.

TypeScript: Node.js version 20 or higher required

TypeScript MCP servers require Node.js version 20 or higher.

Java: Java 17 or higher required

Java MCP servers require Java 17 or higher installed.

Java: Spring Boot 3.3.x or higher required

Java MCP servers with Spring AI require Spring Boot 3.3.x or higher.

Kotlin: JDK 11 or higher required

Kotlin MCP servers require JDK 11 or higher installed.

C#: .NET 8 SDK or higher required

C# MCP servers require .NET 8 SDK or higher installed.

Ruby: Ruby 2.7 or higher required

Ruby MCP servers require Ruby 2.7 or higher installed.

Rust: Rust 1.70 or higher required

Rust MCP servers require Rust 1.70 or higher installed.

Rust ServerHandler trait ServerCapabilities setup

In Rust, implement ServerHandler trait and return ServerInfo with ServerCapabilities built via builder pattern: ServerCapabilities::builder().enable_tools().build(). The enable_tools() method declares that the server supports tool capability.

Give your agent this brain