feat: add Rust binary calculator example#207
Open
bryan-anthropic wants to merge 2 commits intomainfrom
Open
Conversation
First example of the binary server type — a compiled Rust MCP server packaged as an MCPB. Based on the official Rust SDK calculator example (rmcp 1.2.0, 2 tools: sum/sub, ~80 LOC). Includes Cargo.toml, Dockerfile for Docker-based builds, .mcpbignore to exclude source from the bundle, and README with build/pack/test instructions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align with other examples — no example ships a Dockerfile or its own .gitignore. Rust build artifacts are now covered by the repo-level .gitignore instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
binaryserver type — a compiled Rust MCP server packaged as an MCPBsum/sub, ~80 LOC)Cargo.toml,Dockerfilefor Docker-based builds,.mcpbignoreto exclude source from the bundle, and README with build/pack/test instructionsMotivation
All existing examples use interpreted runtimes (Node.js, Python/UV). This fills the gap for compiled languages (Rust, Go, C++) where a pre-built binary is packaged directly. The calculator is intentionally minimal — zero API keys, no external dependencies, two tools — so it serves as a clear template.
What's included
manifest.jsonserver.type = "binary"Cargo.tomlsrc/main.rsDockerfile.mcpbignoreREADME.mdTest plan
mcpb pack examples/calculator-rustvalidates manifest and produces correct bundle (only manifest.json + server/mcp-calculator)yarn lintandyarn testpass (218 tests)🤖 Generated with Claude Code