executable-stories-mcp
v0.3.12
Published
Read-only MCP server for executable-stories StoryReport JSON behavior catalogs.
Maintainers
Readme
executable-stories-mcp
MCP server for executable-stories behavior catalogs.
It consumes story-report-json output from executable-stories-formatters and exposes scenario discovery and focused test-run tools for coding agents.
Create the Report
First run your test suite so the adapter writes a raw run (JS/TS reporters write
reports/raw-run.json; the non-JS adapters write .executable-stories/raw-run.json).
Then turn it into the StoryReport the server reads:
executable-stories format .executable-stories/raw-run.json \
--format story-report-json,scenario-index-json,behavior-manifest-json \
--output-dir reports \
--output-name indexDefault StoryReport path used by the MCP server:
reports/index.story-report.jsonRun
npx executable-stories-mcpThe binary speaks the MCP stdio transport. To register it with an MCP client
(Claude Code, Claude Desktop, Cursor), add it to the client's mcpServers config:
{
"mcpServers": {
"executable-stories": {
"command": "npx",
"args": ["executable-stories-mcp"]
}
}
}For an HTTP interface, see HTTP API below.
Tools
Read-only (StoryReport query)
list_scenarios— scenario index items with status, source, tags, tickets, covers, steps, doc kinds, errors. Optionalstatuses/tags/sourceFilesfiltersget_scenario— one scenario by id or exact titleget_failing_scenarios— failed scenarios onlyget_scenarios_for_paths— code→scenario: scenarios whose declaredcoversglobs match given product-code pathsget_feature_summary— per-feature pass/fail countsget_scenario_index— Storybook-likescenario-indexv1 artifactget_behavior_manifest— tags, source files, doc coverage, debugger warnings (incl.missing-covers)get_behavior_diff— compare two StoryReports by scenario id (regressed / fixed / added / removed)get_deployment_status— latest recorded deployment per environment (from the deployment ledger)get_environment_drift— scenario drift between two environments (what's in one but not the other)
Execution
run_scenario— run one scenario via the host framework (vitest,jest,playwright, orcypress). Executes real tests.
Each tool accepts optional reportPath to point at a specific StoryReport JSON file.
Contract
StoryReport v1 JSON remains the canonical artifact:
executable-stories format <raw-run.json> --format story-report-jsonMCP is a query and optional execution layer over that artifact.
HTTP API (optional)
For non-MCP clients or local debugging, start the HTTP server programmatically (the executable-stories-mcp binary itself only speaks stdio):
import { startHttpServer } from "executable-stories-mcp/http";
await startHttpServer({ reportPath: "reports/index.story-report.json", port: 7357 });Endpoints (each maps to the matching MCP tool):
GET /healthGET /scenarios(optional?status=&tag=&sourceFile=) →list_scenariosGET /scenarios/failing→get_failing_scenariosGET /scenarios/covering?path=…→get_scenarios_for_pathsGET /scenarios/:id→get_scenarioGET /scenarios-index→get_scenario_indexGET /features→get_feature_summaryGET /manifest→get_behavior_manifestGET /diff?baseline=¤t=→get_behavior_diffPOST /run-scenarios→run_scenario
Every GET accepts a ?reportPath= query parameter.
