Skip to content

Commit 82f613f

Browse files
committed
Add Replay MCP stdio bridge
1 parent 490dab1 commit 82f613f

7 files changed

Lines changed: 2209 additions & 14 deletions

File tree

packages/replayio/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,32 @@ 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 starts without contacting Replay, so MCP clients can install and enumerate
46+
tools without logging in. The first tool call tries existing Replay CLI authentication,
47+
using `replayio login` or `REPLAY_API_KEY`. If no CLI token is available, it falls back
48+
to MCP OAuth using a stable pre-registered client ID and PKCE.
49+
50+
The HTTP endpoint can be overridden with `REPLAY_MCP_SERVER` or `replayio mcp --url <url>`.
51+
The OAuth client can be overridden with `REPLAY_MCP_OAUTH_CLIENT_ID`, and the loopback
52+
callback can be overridden with `REPLAY_MCP_OAUTH_REDIRECT_URL`. The default OAuth
53+
callback is `http://127.0.0.1:42813/callback` and must be registered for the client.
54+
2955
## Contributing
3056

3157
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)