Project 02
rustybin
A single-binary mock upstream for API, AI and agent gateway demos: mock LLMs, MCP servers, A2A agents, OAuth, and failures on demand.
- Status
- Live
- Stack
- Rust · Axum · gRPC · MCP · Docker
- Website
- docs.rustybin.dev/
What it is
A single binary, also shipped as a signed container image, that sits behind an API gateway, AI gateway or agent gateway as its upstream. It answers like the backends, model providers, MCP servers and identity providers a gateway normally fronts. It can fail when you ask it to, and it shows exactly what arrived.
Why it exists
Gateway demos need an upstream that is predictable, observable and able to fail on cue. Public echo services cannot be reached from inside a customer’s network. Real model providers cost money and answer differently every time. Building a fake OAuth server, MCP server or agent for each demo takes days. Rustybin is all of those in one container.
What it does
- Mock LLMs. The native APIs of seven providers: OpenAI, Azure OpenAI, Anthropic, Gemini, AWS Bedrock, Ollama and Cohere. The official SDKs accept it. Streaming, tool calls, structured output, realtime and batch APIs, deterministic token counts, and errors such as rate limits and content filters on request.
- Gateway features made visible. An echo mode returns the exact prompt the upstream received. Scripted replies contain fake PII or unsafe text for testing guards. Embeddings keep similarity, so semantic caching can be shown working. A response header shows which credential the gateway injected.
- Agent protocols. An MCP server over current and older transports with OAuth 2.1 and API key variants, deliberately hostile MCP servers for security demos, A2A agents, and an MCP inspector that runs a set of checks against any server.
- OpenAPI and AsyncAPI mocks. Upload a spec, or describe the API and let your own AI model write one. The mock validates requests, generates examples and enforces the spec’s security. A mock can also be recorded from a real API and checked against it later for drift.
- The gateway basics. Echo, any status code, delays, caching and redirects. Real Basic, API key, JWT, HMAC and mTLS checks, a built-in OAuth 2.0 and OpenID Connect provider, and GraphQL, SOAP, gRPC, WebSocket and server-sent events.
- Testing. Gateway scenarios prove that a gateway retried, rate limited, cached or fell back by comparing what the client got with what reached the upstream. Saved tests and multi-step tests can run in CI as Hurl or as Arazzo workflows. A harness mode turns Rustybin into the load client as well.
- Five ways to manage it. Use the web console, the
rustybincommand line, the HTTP API, an AI agent over MCP, or arustybin.yamlkept in git, with signed commits and verified pulls. A dev portal lets testers find published mocks without needing the console. It is locked by default, with a sign-in, sealed secrets and one allowlist for outbound calls.
Status
Released and in active development, with signed container images and binaries for Linux and macOS. It is open source under the AGPL-3.0, and a commercial licence covers uses the AGPL does not fit. Start with the documentation or browse the source on GitHub.
Rustybin Cloud, the hosted platform, is being developed separately with customer and admin portals, an API and instance orchestration. Its source is private. The public site is rustybin.dev.