chore: remove Dockerfile and .gitignore from calculator-rust example
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 commit is contained in:
parent
cc4aa751b6
commit
a907aead99
5 changed files with 7 additions and 31 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -88,6 +88,8 @@ typings/
|
|||
# Claude files
|
||||
.claude.json
|
||||
.claude/
|
||||
CLAUDE.md
|
||||
PROJECT_STATUS.md
|
||||
|
||||
# Vite
|
||||
.vite/
|
||||
|
|
@ -107,4 +109,8 @@ self-signed-key.pem
|
|||
invalid-json.json
|
||||
**/server/lib/**
|
||||
|
||||
# Rust example build artifacts
|
||||
examples/calculator-rust/target/
|
||||
examples/calculator-rust/server/
|
||||
|
||||
.yarn/install-state.gz
|
||||
3
examples/calculator-rust/.gitignore
vendored
3
examples/calculator-rust/.gitignore
vendored
|
|
@ -1,3 +0,0 @@
|
|||
target/
|
||||
Cargo.lock
|
||||
server/mcp-calculator
|
||||
|
|
@ -2,6 +2,4 @@ Cargo.toml
|
|||
Cargo.lock
|
||||
src/
|
||||
target/
|
||||
Dockerfile
|
||||
README.md
|
||||
.gitignore
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
FROM rust:1.94-bookworm AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY Cargo.toml ./
|
||||
COPY src/ ./src/
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder /app/target/release/mcp-calculator /mcp-calculator
|
||||
ENTRYPOINT ["/mcp-calculator"]
|
||||
|
|
@ -18,9 +18,7 @@ The tradeoff is that binaries are platform-specific — you need a separate buil
|
|||
calculator-rust/
|
||||
├── manifest.json # server.type = "binary"
|
||||
├── Cargo.toml # Rust project
|
||||
├── Dockerfile # Build via Docker
|
||||
├── .mcpbignore # Exclude source from bundle
|
||||
├── .gitignore # Exclude build artifacts
|
||||
└── src/
|
||||
└── main.rs # Calculator MCP server (~80 LOC)
|
||||
```
|
||||
|
|
@ -29,7 +27,7 @@ After building, the `server/` directory is created with the compiled binary.
|
|||
|
||||
## Building
|
||||
|
||||
### Native (requires Rust 1.85+)
|
||||
Requires [Rust](https://rustup.rs/) 1.85+.
|
||||
|
||||
```bash
|
||||
cd examples/calculator-rust
|
||||
|
|
@ -38,18 +36,6 @@ mkdir -p server
|
|||
cp target/release/mcp-calculator server/
|
||||
```
|
||||
|
||||
### Docker (no local Rust required)
|
||||
|
||||
```bash
|
||||
cd examples/calculator-rust
|
||||
docker build -t mcp-calculator .
|
||||
# Extract the binary (linux only)
|
||||
docker create --name calc mcp-calculator
|
||||
docker cp calc:/mcp-calculator server/mcp-calculator
|
||||
docker rm calc
|
||||
chmod +x server/mcp-calculator
|
||||
```
|
||||
|
||||
## Packing
|
||||
|
||||
```bash
|
||||
|
|
|
|||
Loading…
Reference in a new issue