Skip to main content
The MCP for Beginners curriculum includes working code samples at two levels: a basic calculator server to introduce core MCP concepts, and advanced implementations that demonstrate real-world patterns like resources, prompts, HTTP transport, and cloud deployment. Every sample is self-contained and runnable. Pick the language you know best and follow the step-by-step guide.

Basic calculator samples

Each basic sample implements the same calculator MCP server — add, subtract, multiply, and divide — using a stdio transport. This makes it easy to compare how the same MCP concept is expressed across languages.
LanguageSDK / FrameworkTransportSource
C# / .NETModelContextProtocolstdioView
JavaSpring AI + Spring Boot WebFluxSSEView
JavaScript@modelcontextprotocol/sdkstdioView
PythonFastMCPstdioView
TypeScript@modelcontextprotocol/sdkstdioView
RustrmcpstdioView

Advanced samples

The advanced samples go beyond the calculator to show production-ready patterns.
LanguageHighlightsSource
C# / .NETHTTP/Streamable transport, .NET Aspire, Azure deploymentView
JavaContent safety integration, LangChain4j, Azure Content SafetyView
JavaScriptClass-based server, resources, event emittersView
PythonTools + resources + prompts, full client/server pairView
TypeScriptTyped class-based server, ResourceTemplate, event systemView

What the samples cover

Tools

Register callable functions (add, subtract, multiply, divide) that an AI model can invoke through the MCP protocol.

Resources

Expose data endpoints like models:// or greeting://{name} that clients can read at any time.

Prompts

Provide reusable prompt templates — for example, a review_code prompt that wraps user code in a structured review request.

Transports

Use stdio for local development and SSE or Streamable HTTP for networked or cloud deployments.

Prerequisites

Before running any sample, make sure you have the runtime for your chosen language:
  • .NET 9 SDK
  • (Optional) Docker for the containerized version
  • (Optional) azd CLI for Azure deployment

Testing with MCP Inspector

All samples can be tested with the MCP Inspector — a browser-based tool for listing tools and calling them interactively.
npx @modelcontextprotocol/inspector
For stdio servers, configure the Inspector to launch the server process directly. For SSE or HTTP servers, point it at the running server’s endpoint URL.

Build docs developers (and LLMs) love