mcp-mock-sim
v1.0.2
Published
CLI tool for running, recording and replaying MCP tool-call scenarios
Readme
mcp-mock-sim (repository: fury-r/mcp-sim)
CLI for running, recording, replaying, and validating MCP tool-call scenarios.
Install
npm install
npm run build
npm linkRun locally from source:
npm run start -- --helpOr run the built CLI:
node dist/cli.js --helpCommands
run <scenario>
Run a scenario file against a live MCP server.
mcp-mock-sim run examples/scenario.yaml --server stdio --cmd "node server.js"Options:
--server <type>:stdioorhttp(default:stdio)--cmd <command>: command used to launch the server instdiomode--url <url>: MCP server URL inhttpmode--format <format>:prettyorjson(default:pretty)
record
Record tool calls from a live server into fixtures.
mcp-mock-sim record \
--server http \
--url http://localhost:3000 \
--out fixtures \
--tools 'github_get_issue:{"repo":"my-org/my-repo","issue_number":1}'Options:
--server <type>(required):stdioorhttp--cmd <command>: command used to launch the server instdiomode--url <url>: MCP server URL inhttpmode--out <dir>(required): output fixture directory--tools <tools>: comma-separatedtool:jsonArgscalls to record
replay <scenario>
Replay a scenario using fixture files (no network calls).
mcp-mock-sim replay examples/scenario.yaml --fixtures fixtures --mode strictOptions:
--fixtures <dir>(required): fixture directory--mode <mode>:strictorlenient(default:strict)--format <format>:prettyorjson(default:pretty)
validate <scenario>
Validate scenario YAML syntax/schema.
mcp-mock-sim validate examples/scenario.yamlScenario file basics
See /examples/scenario.yaml for a complete example. A scenario supports:
- top-level metadata:
version,name, optionaldescription varsand${vars.*}interpolation- runtime environment interpolation with
${env.*} - per-step MCP calls with
tool,input, optionalexpect,save_as,retries,timeout_ms - optional
redactrules (patternand/orpointer) for sanitized logs and fixtures
Release and Publish Flow
Flow diagram:
- Code is pushed to
master(including merged PRs). Release Tagworkflow runs.- Version is bumped and committed.
- A Git tag
vX.Y.Zis created and pushed. Publish to npmworkflow runs.- Package is published to npm registry.
Mermaid workflow:
flowchart TD
A[Push or Merge to master] --> B[GitHub Action: Release Tag]
B --> C[Determine Next Version]
C --> D[Commit package.json and package-lock.json]
D --> E[Create and Push Tag vX.Y.Z]
E --> F[GitHub Action: Publish to npm]
F --> G[Verify Version and Install Dependencies]
G --> H[npm publish --access public --provenance]Development
npm run lint
npm run build
npm test