Official SDKs for Building MCP Servers: The Complete Developer Guide

The official Model Context Protocol (MCP) SDKs provide type-safe, language-specific implementations for Go, Kotlin, Java (Spring and Quarkus), C#/.NET, Rust, and TypeScript, enabling developers to expose tools through standardized MCP servers with minimal boilerplate.

The punkpeye/awesome-mcp-servers repository indexes these official SDKs as the recommended starting points for implementing conformant MCP servers. Each SDK exposes the same underlying MCP schema while offering idiomatic patterns for tool registration, authentication, and deployment across different runtime environments.

Go SDK (mark3labs/mcp-go)

The Go SDK provides a fully typed implementation with auto-generated JSON Schema support and binary deployment options.

Key features include the NewServer constructor and RegisterTool method, which are defined in github.com/mark3labs/mcp-go/mcp/server.go. This SDK supports both server and client implementations with standard library JSON handling.

package main

import (
	"context"
	"log"

	"github.com/mark3labs/mcp-go/mcp"
)

func main() {
	srv := mcp.NewServer()
	srv.RegisterTool("ping", func(ctx context.Context, args map[string]any) (any, error) {
		return "pong", nil
	})
	if err := srv.Start(":8080"); err != nil {
		log.Fatal(err)
	}
}

Kotlin SDK (http4k MCP)

The Kotlin SDK built on the http4k toolkit offers functional, testable MCP server construction with first-class support for HTTP streaming protocols.

The primary entry point is the mcpApp DSL defined in mcp-http4k/src/main/kotlin/mcp/http4k/App.kt. This functional approach allows developers to compose servers using immutable request/response lenses.

import org.http4k.core.*
import org.http4k.server.SunHttp
import org.http4k.server.asServer
import mcp.http4k.*

fun main() {
    val app = mcpApp {
        tool("ping") { _, _ -> "pong" }
    }
    app.asServer(SunHttp(8080)).start()
}

Java SDKs

Spring Framework (spring-ai-mcp)

The Spring AI MCP integration provides auto-configuration and bean-based dependency injection for enterprise Java applications. The core McpServer class uses a builder pattern defined in org/modelcontextprotocol/mcp/spring/McpServer.java.

This SDK supports pluggable transports and exposes tools as Spring-managed beans.

@SpringBootApplication
public class McpApplication {

    @Bean
    public McpServer mcpServer() {
        return McpServer.builder()
                .tool("ping", (ctx, args) -> "pong")
                .build();
    }

    public static void main(String[] args) {
        SpringApplication.run(McpApplication.class, args);
    }
}

Quarkus Extension (quarkus-mcp-server)

The Quarkus MCP Server extension turns CDI beans into MCP servers with minimal configuration. The McpServer producer is defined in io/quarkus/mcp/runtime/McpServerProducer.java, enabling dependency injection of the server instance.

import io.quarkus.mcp.McpServer;

@ApplicationScoped
public class MyMcpService {

    @Inject
    McpServer mcpServer;

    void onStart(@Observes StartupEvent ev) {
        mcpServer.registerTool("ping", (ctx, args) -> "pong");
        mcpServer.start(8080);
    }
}

C#/.NET SDK (ModelContextProtocol.NET)

The C# SDK targets .NET 9 with Native AOT compatibility, providing strong-typed tool contracts and asynchronous streaming support. The McpServer class in ModelContextProtocol/McpServer.cs exposes RegisterTool and async start/stop methods.

using ModelContextProtocol;

var server = new McpServer(port: 8080);
server.RegisterTool("ping", (ctx, args) => Task.FromResult<object>("pong"));
await server.StartAsync();

Rust SDK (TurboMCP)

TurboMCP delivers zero-cost abstractions for high-throughput Rust applications. The entry point in src/server.rs provides McpServer::new and register_tool methods with built-in authentication hooks.

use turbomcp::{McpServer, Tool};

#[tokio::main]
async fn main() {
    let mut server = McpServer::new("0.0.0.0:8080").await.unwrap();
    server.register_tool("ping", Tool::new(|_ctx, _args| async { Ok("pong") }));
    server.run().await.unwrap();
}

TypeScript/JavaScript SDK (agent-toolbelt)

The TypeScript SDK offers a zero-dependency implementation with LangChain compatibility. The McpServer class in src/server.ts provides a lightweight wrapper around the MCP protocol for Node.js environments.

import { McpServer } from "agent-toolbelt";

const server = new McpServer({ port: 8080 });
server.registerTool("ping", async () => "pong");
await server.start();

Key Source Files and Entry Points

When extending or debugging these SDKs, refer to these canonical source locations:

Summary

  • Seven official SDKs cover Go, Kotlin, Java (Spring and Quarkus), C#/.NET, Rust, and TypeScript.
  • Type-safe bindings in each SDK ensure compile-time validation of tool contracts and MCP schemas.
  • Idiomatic patterns range from Go's functional options to Spring's auto-configuration and Rust's zero-cost abstractions.
  • Consistent entry points across all SDKs follow the NewServer → RegisterTool → Start lifecycle pattern.

Frequently Asked Questions

Spring AI MCP is recommended for existing Spring ecosystems, providing auto-configuration and bean-based dependency injection, while Quarkus MCP Server offers superior startup times and memory efficiency for cloud-native deployments. Both implement the same protocol specification but differ in their CDI versus Spring programming models.

Which official MCP SDK supports Native AOT compilation?

The C#/.NET SDK (ModelContextProtocol.NET) explicitly targets .NET 9 with Native AOT compatibility, enabling single-file deployment and reduced memory footprints. This implementation uses source generators to maintain strong typing without runtime reflection.

How do the Kotlin and Go SDKs differ in their approach to tool registration?

The Go SDK uses imperative registration with RegisterTool accepting a handler function signature, while the Kotlin SDK leverages a functional DSL via mcpApp that composes tools as pure functions. Both support HTTP streaming, but Kotlin's http4k integration emphasizes testability through immutable request/response cycles.

Are these official SDKs interoperable with existing AI frameworks?

Yes, all official SDKs expose the standardized MCP schema, ensuring interoperability. Specifically, the TypeScript SDK includes LangChain wrappers, and the Spring AI MCP integration provides native compatibility with Spring AI's vector store and chat client abstractions.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →