Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mcp-servers/rust/fast-time-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/
.git/
17 changes: 11 additions & 6 deletions mcp-servers/rust/fast-time-server/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

# =============================================================================
# Build stage - Rust compilation against the full Cargo workspace
# Build stage - Rust compilation on the same pinned UBI 10 base as the
# runtime image (UBI 10.2 AppStream ships Rust 1.92, above the crate's 1.88
# rust-version floor; no nightly toolchain required)
# =============================================================================
FROM docker.io/rustlang/rust:nightly-slim AS builder
FROM registry.access.redhat.com/ubi10/ubi-minimal:10.2-1777462752 AS builder

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN microdnf install -y cargo rust gcc \
&& microdnf clean all

# Copy the entire fast-time-server directory (build context is this directory)
COPY . ./

RUN cargo build --release

# =============================================================================
# Runtime stage - Minimal Debian image with just the compiled binary
# Runtime stage - Same pinned UBI 10 minimal image with just the binary
# =============================================================================
FROM registry.access.redhat.com/ubi10/ubi-minimal:10.2-1777462752

Expand All @@ -49,6 +50,10 @@ EXPOSE 9080

ENV BIND_ADDRESS=0.0.0.0:9080
ENV RUST_LOG=info
# Serve both the legacy (2025-11-25) and modern (2026-07-28) MCP revisions
# out of the box; operators can restrict the image to a single era with
# MCP_PROTOCOL_MODE=legacy or =modern.
ENV MCP_PROTOCOL_MODE=dual

LABEL org.opencontainers.image.title="fast-time-server"
LABEL org.opencontainers.image.description="Ultra-fast MCP server in Rust for performance testing"
Expand Down
17 changes: 16 additions & 1 deletion mcp-servers/rust/fast-time-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Ultra-fast MCP server written in Rust for performance testing and benchmarking.

- **Blazing fast**: Native Rust performance with zero-copy where possible
- **Streamable HTTP**: MCP Streamable HTTP transport served by the SDK's `StreamableHttpService`
- **Dual-era MCP**: Legacy `2025-11-25` (initialize handshake + `mcp-session-id` sessions) and modern `2026-07-28` (stateless, per-request `_meta`) are served simultaneously on the same `/mcp` endpoint — no flags, no modes
- **Dual-era MCP**: Legacy `2025-11-25` (initialize handshake + `mcp-session-id` sessions) and modern `2026-07-28` (stateless, per-request `_meta`) are served simultaneously on the same `/mcp` endpoint; `MCP_PROTOCOL_MODE=legacy|modern` restricts the server to a single era
- **Minimal overhead**: No auth, no database, pure compute
- **Tools**:
- `echo` - Echoes back the provided message (with optional delay/jitter)
Expand Down Expand Up @@ -215,10 +215,25 @@ make docker-run

## Environment Variables


| Variable | Default | Description |
|----------|---------|-------------|
| `BIND_ADDRESS` | `0.0.0.0:9080` | Address to bind to |
| `RUST_LOG` | `info` | Log level (trace, debug, info, warn, error) |
| `MCP_PROTOCOL_MODE` | `dual` | MCP era(s) to serve: `legacy` (2025-11-25 only), `modern` (2026-07-28 only), or `dual` (both). Any other value fails startup with an error listing the accepted values |

The `MCP_PROTOCOL_MODE` variable selects which MCP revision(s) the server
speaks, without rebuilding or editing the entrypoint:

| `MCP_PROTOCOL_MODE` | Serves | Behavior |
|---------------------|--------|----------|
| `legacy` | 2025-11-25 only | `initialize` handshake + sessions; modern stateless requests are rejected with `-32022` |
| `modern` | 2026-07-28 only | Stateless per-request era; `initialize` proposing 2025-11-25 is rejected with `-32022` |
| `dual` (default) | both | Legacy and modern served simultaneously, as documented above |

The published container image sets `ENV MCP_PROTOCOL_MODE=dual`, so it serves
both eras out of the box; operators can restrict it with
`docker run -e MCP_PROTOCOL_MODE=modern ...`.

## Supported Timezones

Expand Down
Loading
Loading