Skip to content

Repository files navigation

ContextForge Data Plane

The Rust data plane for ContextForge. It accepts modern MCP traffic, loads control-plane-published configuration from Redis, and routes authorized requests to configured MCP backends.

Architecture, configuration, operations, and development context lives in the wiki under _context/wiki/.

Quick Start

Build the production image and start the supported control-plane + data-plane test stack:

make docker-prod
make compose-up

The stack uses the current fast_time_server backend and exercises config publication through the external ContextForge control plane. See getting-started.md for the complete smoke test, then stop it with:

make compose-down

Run the Binary from Cargo

For a lightweight host-development setup, start Redis and the MCP Rust SDK counter and conformance fixtures:

docker compose -f docker/docker-compose-local.yaml up -d
docker compose -f docker/docker-compose-local.yaml ps redis gateway-one gateway-two

Then follow getting-started.md for the local cargo dev workflow.

Runtime CPEX Plugins

Runtime CPEX plugins are disabled by default. When enabled, the data plane loads validated plugin configuration from Redis and supports the narrow hook surface documented in config.md.

The optional demo plugin crates still come from their independently hosted cpex-plugins-rs repository; they are unrelated to the retired MCP SDK fork.

Experimental Secrets Detection Plugin

The bundled secrets detection CPEX plugin is experimental. It is compiled into the data plane with contextforge-data-plane/plugins; Redis config only activates plugin factories that are already present in the binary.

Activation requires all three pieces:

  • Compile-time feature: contextforge-data-plane/plugins
  • Runtime flag: --runtime-plugins-enabled true
  • Redis config key: ContextForgeGatewayRuntimePluginConfig

The plugin kind is validator/secrets-detection. The data plane currently wires only cmf.tool_pre_invoke and cmf.tool_post_invoke.

Example run command:

cargo run --release \
  --features contextforge-data-plane/plugins \
  --bin contextforge-data-plane -- \
  --address 0.0.0.0:8001 \
  --redis-port 6379 \
  --redis-address 127.0.0.1 \
  --token-verification-public-key assets/jwt.key.pub \
  --token-verification-private-key assets/jwt.key \
  --number-of-cpus 16 \
  --redis-mode=plain-text \
  --upstream-connection-mode=plain-text-or-tls \
  --runtime-plugins-enabled true

Tracing and Metrics

The data plane exports OTLP traces and metrics. Local Langfuse, OTel Collector, and Prometheus overlays are documented in config.md under "Local Telemetry Verification Stack".

Performance Tests

With a configured data plane running on port 8001:

cargo run --release --bin contextforge-load-test -- \
  --host http://127.0.0.1:8001 \
  -r 40 -u 120 --run-time 120s --report-file report.html

Existing benchmark results are under reports.

About

ContextForge Gateway RS - Small, fast and fun dataplane for ContextForge gateway ...like Ford Focus RS

Topics

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages