MCP SDK Comparison
Every major MCP SDK across 8 languages, ranked by real signals from the AgentRank index. Updated daily. Compare official and community implementations side by side.
| SDK | Language | Type | Score | Stars | Contrib | Deps | Last Commit | Maturity | Install |
|---|---|---|---|---|---|---|---|---|---|
| mcp-go mark3labs/mcp-go | Go | community | 96.3 | 8.4k | 170 | 2,938 | 2026-03-11 | stable | go get github.com/mark3labs/mcp-go |
| fastmcp PrefectHQ/fastmcp | Python | community | 94.7 | 24k | 208 | 7,718 | 2026-03-14 | stable | pip install fastmcp |
| go-sdk modelcontextprotocol/go-sdk | Go | official | 92.8 | 4.1k | 96 | 1,009 | 2026-03-13 | stable | go get github.com/modelcontextprotocol/go-sdk |
| fastmcp (TS) punkpeye/fastmcp | TypeScript | community | 88.5 | 3.0k | 56 | 1,296 | 2026-03-06 | stable | npm install fastmcp |
| rust-mcp-sdk rust-mcp-stack/rust-mcp-sdk | Rust | community | 87.9 | 159 | 8 | 56 | 2026-03-13 | beta | cargo add rust-mcp-sdk |
| csharp-sdk modelcontextprotocol/csharp-sdk | C# | official | 87.7 | 4.1k | 66 | — | 2026-03-11 | stable | dotnet add package ModelContextProtocol |
| python-sdk modelcontextprotocol/python-sdk | Python | official | 87.5 | 22k | 181 | — | 2026-03-13 | stable | pip install mcp |
| java-sdk modelcontextprotocol/java-sdk | Java | official | 81.7 | 3.3k | 65 | — | 2026-03-13 | stable | implementation("io.modelcontextprotocol:mcp") |
| swift-sdk modelcontextprotocol/swift-sdk | Swift | official | 77.9 | 1.3k | 18 | — | 2026-03-13 | beta | .package(url: "https://github.com/modelcontextprotocol/swift-sdk") |
| kotlin-sdk modelcontextprotocol/kotlin-sdk | Kotlin | official | 76.5 | 1.3k | 47 | — | 2026-03-13 | beta | implementation("io.modelcontextprotocol:kotlin-sdk") |
| rust-sdk modelcontextprotocol/rust-sdk | Rust | official | 74.8 | 3.2k | 143 | 2 | 2026-03-13 | beta | cargo add modelcontextprotocol |
| typescript-sdk modelcontextprotocol/typescript-sdk | TypeScript | official | 70.7 | 12k | 152 | — | 2026-03-13 | stable | npm install @modelcontextprotocol/sdk |
Quickstart Code Examples
Build your first MCP tool in each language. All examples create a simple "add" tool that sums two numbers.
from fastmcp import FastMCP
mcp = FastMCP("My Server")
@mcp.tool()
def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b
if __name__ == "__main__":
mcp.run() from mcp.server.fastmcp import FastMCP
mcp = FastMCP("My Server")
@mcp.tool()
async def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b import { FastMCP } from "fastmcp";
const mcp = new FastMCP({ name: "My Server" });
mcp.addTool({
name: "add",
description: "Add two numbers",
parameters: z.object({ a: z.number(), b: z.number() }),
execute: async ({ a, b }) => String(a + b),
});
mcp.start({ transportType: "stdio" }); import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "My Server", version: "1.0.0" });
server.tool("add", { a: z.number(), b: z.number() },
async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }] })
);
const transport = new StdioServerTransport();
await server.connect(transport); package main
import (
"github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
)
func main() {
s := server.NewMCPServer("My Server", "1.0.0")
tool := mcp.NewTool("add",
mcp.WithDescription("Add two numbers"),
mcp.WithNumber("a", mcp.Required()),
mcp.WithNumber("b", mcp.Required()),
)
s.AddTool(tool, func(args mcp.CallToolRequest) (*mcp.CallToolResult, error) {
a := args.Params.Arguments["a"].(float64)
b := args.Params.Arguments["b"].(float64)
return mcp.NewToolResultText(fmt.Sprintf("%v", a+b)), nil
})
server.ServeStdio(s)
} package main
import (
"github.com/modelcontextprotocol/go-sdk/mcp"
)
func main() {
s := mcp.NewServer("My Server", "1.0.0", nil)
mcp.AddTool(s, &mcp.Tool{
Name: "add",
Description: "Add two numbers",
}, func(ctx context.Context, ss *mcp.ServerSession,
params *mcp.CallToolParamsFor[AddParams]) (*mcp.CallToolResult, error) {
result := params.Arguments.A + params.Arguments.B
return mcp.NewToolResultText(fmt.Sprint(result)), nil
})
mcp.RunStdioServer(s)
} use rust_mcp_sdk::prelude::*;
#[mcp_tool(description = "Add two numbers")]
async fn add(a: f64, b: f64) -> McpResult<f64> {
Ok(a + b)
}
#[tokio::main]
async fn main() {
McpServer::builder()
.name("My Server")
.version("1.0.0")
.tool(add)
.build()
.run_stdio()
.await
.unwrap();
} @SpringBootApplication
public class MyMcpServer {
public static void main(String[] args) {
SpringApplication.run(MyMcpServer.class, args);
}
@Bean
public McpServerFeatures.SyncToolSpecification addTool() {
return new McpServerFeatures.SyncToolSpecification(
new Tool("add", "Add two numbers",
schema(Map.of("a", "number", "b", "number"))),
(exchange, args) -> {
double result = (Double)args.get("a") + (Double)args.get("b");
return new CallToolResult(result);
}
);
}
} import io.modelcontextprotocol.kotlin.sdk.*
fun main() {
val server = Server(
Implementation(name = "My Server", version = "1.0.0")
)
server.addTool(
name = "add",
description = "Add two numbers",
inputSchema = Tool.Input(properties = buildJsonObject {
put("a", buildJsonObject { put("type", "number") })
put("b", buildJsonObject { put("type", "number") })
})
) { request ->
val a = request.arguments["a"]!!.jsonPrimitive.double
val b = request.arguments["b"]!!.jsonPrimitive.double
CallToolResult(content = listOf(TextContent("${a + b}")))
}
server.connect(StdioServerTransport())
} How to Choose
Best for data science workflows, AI/ML pipelines, and rapid prototyping. FastMCP's decorator pattern is the fastest path from idea to working server. Use the official SDK when you need strict spec compliance.
Best for Node.js backends and full-stack teams. The official SDK has more stars and full spec coverage. fastmcp (TS) offers faster DX with less boilerplate for simple use cases.
Best for high-performance servers, CLI tools, and infrastructure. mcp-go is #5 overall on AgentRank and battle-tested with 2,938 dependents. The official go-sdk is newer but maintained with Google.
Best for performance-critical servers and embedded environments. Both SDKs are in beta. The official rust-sdk has more contributors; rust-mcp-sdk has cleaner ergonomics and near-zero open issues.
Best for enterprise Spring Boot applications and JVM-based services. Only one production-grade option — the official SDK maintained with Spring AI. Integrates naturally with existing Spring ecosystem.
Best for Android, JVM, and Kotlin Multiplatform projects. The official SDK maintained with JetBrains supports coroutines natively and includes KMP support. Still in beta — expect API changes.