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.
Advanced samples
The advanced samples go beyond the calculator to show production-ready patterns.| Language | Highlights | Source |
|---|---|---|
| C# / .NET | HTTP/Streamable transport, .NET Aspire, Azure deployment | View |
| Java | Content safety integration, LangChain4j, Azure Content Safety | View |
| JavaScript | Class-based server, resources, event emitters | View |
| Python | Tools + resources + prompts, full client/server pair | View |
| TypeScript | Typed class-based server, ResourceTemplate, event system | View |
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:- C#
- Java
- JavaScript
- Python
- TypeScript
- Rust
- .NET 9 SDK
- (Optional) Docker for the containerized version
- (Optional)
azdCLI for Azure deployment