stoa / stoa-gateway
CLAUDE.md9 starsChanged 7 months agoApache-2.0View on GitHub
Optional Cargo features for community/enterprise image split: Note: OpenTelemetry is always compiled in (CAB-1831). No-op when STOA_OTEL_ENDPOINT is absent. Default features: none (community image — lean, no optional deps). Note: cargo test --all-features requires cmake (for rdkafka). Use cargo test locally. Détail on-demand: .claude/docs/code-style-rust.md, gateway-arena.md, gateway-adapters.md, mcp-oauth.md.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- control-plane-api/CLAUDE.mdCLAUDE.md
- control-plane-ui/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- portal/CLAUDE.mdCLAUDE.md
- analyticsSkill
- cartoSkill
- ci-debugSkill
- ci-fixSkill
- competitive-watchSkill
- councilSkill
- decomposeSkill
- extractSkill
- fill-cycleSkill
- generate-backlogSkill
- impactSkill
- memory-consolidateSkill
- monitor-cdSkill
- parallel-reviewSkill
- pr-guardianSkill
- rewriteSkill
- roadmapSkill
- spec-drivenSkill
- sync-planSkill
- verify-megaSkill
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
Default features: none (community image — lean, no optional deps).
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
STOA Gateway (Rust)
Overview
Emerging Rust implementation of the unified STOA gateway. Will replace the Python mcp-gateway by Q4 2026. Implements the 4-mode architecture (ADR-024): edge-mcp, sidecar, proxy, shadow.
Status: Work In Progress (Phase 12)
Currently implements: MCP discovery, tool proxy, JWT/OAuth2 auth, SSE transport, Prometheus metrics.
Tech Stack
- Rust 2021 edition, Tokio 1 (async runtime), Axum 0.7 (web framework)
- serde/serde_json (serialization), Figment (layered config: YAML + env)
- jsonwebtoken 10 (JWT), reqwest 0.12 (HTTP client)
- moka 0.12 (in-memory cache for API keys + JWKS)
- prometheus 0.13, tracing/tracing-subscriber (structured JSON logging)
- tokio-stream, futures (SSE streams)
Directory Structure
src/
├── main.rs # Entry point + Axum router setup
├── main_wiring.rs # Dependency injection / AppState construction
├── state.rs # AppState (shared application state)
├── config.rs # Figment-based layered configuration
├── metrics.rs # Prometheus metrics registry
├── rate_limit.rs # Rate limiting
├── auth/ # API key auth (api_key.rs), OAuth2, Keycloak OIDC
├── control_plane/ # Client for control-plane-api, tool proxy
├── handlers/ # Admin handlers
├── mcp/ # MCP protocol implementation
│ ├── discovery.rs # Capabilities, health, discovery
│ ├── session.rs # Session management
│ ├── sse.rs # Server-Sent Events transport
│ ├── handlers.rs # Tool call, tool list
│ └── tools/ # proxy_tool, stoa_tools
├── proxy/ # Dynamic proxy, webmethods integration
├── routes/ # Route definitions
└── uac/ # Universal API ContractFeature Flags (ADR-041 Phase 3)
Optional Cargo features for community/enterprise image split:
| Feature | Crate | Purpose | Build Dep |
kafka | rdkafka | Kafka metering | cmake, libsasl2-dev |
k8s | kube, k8s-openapi, schemars | K8s CRD watcher | None |
Note: OpenTelemetry is always compiled in (CAB-1831). No-op when STOA_OTEL_ENDPOINT is absent.
Default features: none (community image — lean, no optional deps).
# Community build (default)
cargo build --release
# Enterprise build (all features)
cargo build --release --features "kafka,k8s"
# Docker: community
docker build -t stoa-gateway:community .
# Docker: enterprise
docker build --build-arg FEATURES="kafka,k8s" -t stoa-gateway:enterprise .Development
cargo check # Fast compile check
cargo test # Run tests (default features)
cargo test --features k8s # Run tests with K8s feature
cargo clippy # Lint
cargo fmt --check # Format check
cargo run # Run serverNote: cargo test --all-features requires cmake (for rdkafka). Use cargo test locally.
Dependencies
- Depends on: control-plane-api (config/tool sync), Keycloak (JWT verification)
- Depended on by: nothing yet (will replace mcp-gateway)
Règles
Détail on-demand: .claude/docs/code-style-rust.md, gateway-arena.md, gateway-adapters.md, mcp-oauth.md.
- Zero tolerance clippy: tout warning = CI fail. Pas de
#[allow(...)]sans justification. - CI exact:
RUSTFLAGS=-Dwarnings cargo clippy --all-targets --all-features -- -D warnings+cargo fmt --check. - SAST strict:
-D clippy::todo,-D clippy::unimplemented,-D clippy::dbg_macro. - Toolchain: pinned via
rust-toolchain.toml. Jamaiscargo fmtavec une autre version. - Erreurs:
anyhowpour app,thiserrorpour lib.?préféré au match. - Tests inline
#[cfg(test)] mod tests.#[tokio::test]pour async. cargo test --all-featuresrequiertlibrdkafka(brew/apt). Local:cargo testsuffit.- OAuth:
authorization_serverspointe sur gateway (pas Keycloak). DCR stripscopefield. mTLS bypass/.well-known/*,/oauth/*,/mcp/*. - Arena benchmarks: L0 (k6 30min), L1 (AI readiness), L2 (CUJs 15min). Echo backend local pour fairness.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

