MCP Chaos Rig logo

MCP Chaos Rig

Organization
Typewise

A local MCP server that breaks on demand. Test your client against auth failures, disappearing tools, flaky responses, and token expiry, all from a web UI.

PublisherTypewise
Repositorymcp-chaos-rig
LanguageTypeScript
Forks
1
Stars
10
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Chaos Rig exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    10 stars and 1 forks from the linked repository.


The problem

You're building an MCP client. You need to test OAuth flows, token refresh, tool discovery, error handling, and session lifecycle. Production servers don't fail on command. You need a server that does.

What Chaos Rig does

Run a local MCP server where you control everything:

  • Break authentication: force 401s and 500s mid-session, expire tokens on demand, reject refresh tokens
  • Break tools: disable tools to trigger tools/changed, switch schema versions live
  • Break reliability: add random latency, make tool calls fail at configurable rates
  • See everything: live request log shows inbound JSON-RPC calls and outbound SSE responses, with click-to-expand bodies

Server tab

Test scenarios

ScenarioHow to test it
OAuth 2.1 consent flowUse the interactive consent page: approve, decline, invalid code, tampered state
Fixed header authSwitch to Headers mode, configure key-value pairs, verify client sends them
Missing/wrong headersSend requests with missing or mismatched headers — 401 with details
Token rejection mid-sessionToggle "Reject OAuth" to 401 or 500 while client is connected
Token expiry and refreshSet access token TTL to a short value, watch the client refresh
Reject refresh tokensToggle "Reject refresh tokens" to force re-authentication
Wrong client refreshingEnable "Enforce refresh token ownership" — catches clients that lose credentials and re-register
No dynamic registrationSwitch to "Pre-registered client only" — /register 404s, only your client_id works
Rotated client credentialsChange the pre-registered client_id mid-session — the old one now fails with invalid_client
Scope discovery conflictSet different scopes in metadata vs WWW-Authenticate header, test which the client trusts
Tool disappearingDisable a tool in the Tools tab. Clients receive tools/changed
Tool schema changingSwitch echo or add between v1 and v2 schemas
Flaky tool callsSet failure rate 0-100%. Failed calls return isError: true
Slow responsesEnable slow mode with configurable latency range
PKCE code exchangeOAuth consent page offers "Wrong Code" and "Wrong State" options
Database-backed toolsCRUD operations on a real SQLite contact database

Quick start

bash
npx mcp-chaos-rig

Control panel at localhost:4100/ui, MCP endpoint at http://localhost:4100/mcp. Requires Node 20+.

If you prefer a global install:

bash
npm install -g mcp-chaos-rig
mcp-chaos-rig

Or run from source:

bash
git clone https://github.com/Typewise/mcp-chaos-rig.git
cd mcp-chaos-rig
npm install
npm run dev

Remote access

If your production environment needs to reach Chaos Rig, expose it via a tunnel (ngrok, Cloudflare Tunnel, etc.) and set BASE_URL so OAuth redirects resolve correctly:

bash
BASE_URL=https://your-tunnel.example.dev npx mcp-chaos-rig

Auth mode starts at Bearer, so a tunnel-facing rig usually wants AUTH_MODE too (none, bearer, headers, oauth). For OAuth with pre-registered credentials, see Client registration.

Auth state

All state is in-memory and resets on restart, back to whatever the environment seeds (AUTH_MODE, OAUTH_CLIENT_MODE, STATIC_*) or to the built-in defaults. Bearer starts with token test-token-123 (valid until changed). OAuth tokens expire per TTL. Refresh tokens track ownership per client when enabled. After restart, do one refresh with ownership off to re-seed, then turn it on.


Control panel tabs

Server

Configure auth mode, slow mode (random latency), and flaky tools (% failure rate).

Auth modeBehavior
NoneAll requests pass through
BearerRequires Authorization: Bearer test-token-123
Fixed HeadersRequires configured key-value header pairs on every request
OAuth 2.1Full authorization flow with interactive consent page

Bearer, Fixed Headers and OAuth modes support fault injection: force 401 or 500 responses to test error handling. The mode starts at Bearer unless AUTH_MODE says otherwise.

OAuth mode adds controls for client registration, access token TTL, refresh token rejection, and refresh token ownership enforcement. OAuth endpoints are listed in a collapsible section.

Client registration

ModeBehavior
Dynamic registrationClients register themselves at /oauth/register and get fresh credentials (RFC 7591)
Pre-registered client onlyOnly the configured client_id / client_secret is accepted; registration is turned off

Static mode reproduces authorization servers that issue credentials out of band (Google, Atlassian, most enterprise IdPs):

  • registration_endpoint disappears from the well-known metadata
  • POST /oauth/register and POST /register return 404 registration_not_supported
  • any other client_id gets invalid_client at /authorize and /token
  • an empty client_secret makes it a public client, so the token endpoint accepts auth method none
  • redirect URIs must match a configured one exactly, except the port on loopback hosts (RFC 8252)

The shipped default redirect URI points at a local client. Testing against a deployed client means registering that client's callback instead, or /authorize returns 400 invalid_request — the response lists the URIs that are registered, since the port relaxation only applies to loopback hosts and https:// callbacks must match exactly.

Set the client at boot so a tunnel-facing rig starts ready:

bash
AUTH_MODE=oauth \
OAUTH_CLIENT_MODE=static \
STATIC_CLIENT_ID=acme-client \
STATIC_CLIENT_SECRET=acme-secret \
STATIC_REDIRECT_URIS=https://platform-api.example.app/api/mcp/oauth/callback \
BASE_URL=https://your-tunnel.example.dev npx mcp-chaos-rig

AUTH_MODE is required here: it defaults to bearer, and the OAuth endpoints 404 until it is oauth (none, bearer, headers, oauth; anything else fails at startup). STATIC_REDIRECT_URIS is comma-separated. An empty STATIC_CLIENT_SECRET= boots a public client. Everything stays editable from the Server tab afterwards.

Changing the client_id drops the previous one, so you can test credential rotation against a live client. Set it from the API too:

bash
curl -X POST localhost:4100/api/oauth-client -H 'Content-Type: application/json' \
  -d '{"mode":"static","clientId":"acme-client","clientSecret":"acme-secret","redirectUris":["http://localhost:3000/api/mcp/oauth/callback"]}'

Tools

Tools tab

Toggle tools on/off. Disabling sends tools/changed to connected clients. Some tools (echo, add) support version switching.

Available tools:

  • echo: returns your message (v2 adds format options)
  • add: sums two numbers (v2 accepts an array)
  • get-time: current server time as ISO 8601
  • random-number: random integer in a range
  • reverse: reverses a string
  • typeEcho: echoes one optional parameter per JSON Schema primitive, to check a client round-trips every type
  • dispute-charge: files a billing dispute, returns a JSON receipt
  • list-contacts, get-contact-by-id, get-contact-by-email, search-contacts, create-contact, update-contact, delete-contact: SQLite CRUD

Three large-schema tools start disabled, for testing how a client handles wide inputs: submit-customs-declaration (all fields required), create-product-listing (25 required, 25 optional), search-properties (50 optional filters).

Contacts

Contacts tab

View and reset the SQLite database backing the contact tools. Starts with three seed records.

Log

Log tab

Live request log showing inbound requests and outbound SSE responses. Displays timestamp, source (mcp/auth/sse), method, status, JSON-RPC method, tool name, and arguments. Click any truncated body or args line to expand it. Keeps last 200 entries.


OAuth consent page

OAuth consent page

When auth mode is OAuth, the authorization endpoint shows an interactive consent page:

ButtonResult
ApproveRedirects with valid authorization code
DeclineRedirects with error=access_denied
Wrong CodeRedirects with invalid code (token exchange fails)
Wrong StateRedirects with tampered state parameter

Links

Use MCP Chaos Rig MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Chaos Rig is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Chaos Rig as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Chaos Rig MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-chaos-rig": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Chaos Rig MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Chaos Rig MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Chaos Rig to help me with this task?
MCP Chaos Rig
Sure. I read it.
Here is what I found using MCP Chaos Rig.

Frequently asked questions

What is the MCP Chaos Rig MCP server used for?

MCP Chaos Rig is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Chaos Rig MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Chaos Rig with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Chaos Rig MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Chaos Rig connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Chaos Rig MCP to TypingMind?

MCP Chaos Rig runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Chaos Rig MCP provide in TypingMind?

MCP Chaos Rig exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Chaos Rig MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Chaos Rig requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇