Skip to content

Commit 3f9b339

Browse files
committed
Add Replay MCP stdio bridge
1 parent 490dab1 commit 3f9b339

6 files changed

Lines changed: 1164 additions & 14 deletions

File tree

packages/replayio/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,31 @@ This CLI will automatically prompt you to log into your Replay account (or to re
2626

2727
The CLI will also prompt you to download the Replay runtime if you have not already done so.
2828

29+
## MCP
30+
31+
The CLI can run Replay's MCP server over stdio using your existing Replay CLI authentication:
32+
33+
```json
34+
{
35+
"mcpServers": {
36+
"replay": {
37+
"type": "stdio",
38+
"command": "npx",
39+
"args": ["-y", "replayio", "mcp"]
40+
}
41+
}
42+
}
43+
```
44+
45+
The command tries existing Replay CLI authentication first, using `replayio login` or
46+
`REPLAY_API_KEY`. If no CLI token is available, it falls back to MCP OAuth using a
47+
stable pre-registered client ID and PKCE.
48+
49+
The HTTP endpoint can be overridden with `REPLAY_MCP_SERVER` or `replayio mcp --url <url>`.
50+
The OAuth client can be overridden with `REPLAY_MCP_OAUTH_CLIENT_ID`, and the loopback
51+
callback can be overridden with `REPLAY_MCP_OAUTH_REDIRECT_URL`. The default OAuth
52+
callback is `http://127.0.0.1:42813/callback` and must be registered for the client.
53+
2954
## Contributing
3055

3156
Contributing guide can be found [here](contributing.md).

packages/replayio/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
],
3030
"homepage": "https://github.com/replayio/replay-cli/blob/main/packages/replayio/README.md",
3131
"dependencies": {
32+
"@modelcontextprotocol/sdk": "^1.25.3",
3233
"@replayio/protocol": "^0.71.0",
3334
"@replayio/sourcemap-upload": "workspace:^",
3435
"@types/semver": "^7.5.6",

packages/replayio/src/bin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import "./commands/info";
1111
import "./commands/list";
1212
import "./commands/login";
1313
import "./commands/logout";
14+
import "./commands/mcp";
1415
import "./commands/open";
1516
import "./commands/record";
1617
import "./commands/remove";

0 commit comments

Comments
 (0)