@reproapp/mcp 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -0
- package/package.json +42 -0
- package/src/index.js +3728 -0
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# @reproapp/mcp
|
|
2
|
+
|
|
3
|
+
Repro MCP server for AI-assisted debugging and privacy policy workflows.
|
|
4
|
+
|
|
5
|
+
`@reproapp/mcp` runs over stdio for local AI clients and forwards MCP tool calls to Repro services. It can also run as an HTTP MCP server in a container when `PORT` is set or `REPRO_MCP_TRANSPORT=http`.
|
|
6
|
+
|
|
7
|
+
## AI Client Setup
|
|
8
|
+
|
|
9
|
+
Default hosted Repro setup:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"repro": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "@reproapp/mcp@latest"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Custom Repro deployment:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"repro": {
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["-y", "@reproapp/mcp@latest"],
|
|
30
|
+
"env": {
|
|
31
|
+
"REPRO_AI_BASE_URL": "https://your-repro-ai-url/",
|
|
32
|
+
"REPRO_API_BASE_URL": "https://your-repro-api-url/api/",
|
|
33
|
+
"REPRO_WEB_BASE_URL": "https://your-repro-web-url/"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The installed binary is `repro-mcp`.
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
Built-in defaults:
|
|
45
|
+
|
|
46
|
+
- `REPRO_AI_BASE_URL=http://10.116.0.4`
|
|
47
|
+
- `REPRO_API_BASE_URL=http://10.116.0.5/api`
|
|
48
|
+
- `REPRO_WEB_BASE_URL=https://getrepro.io`
|
|
49
|
+
|
|
50
|
+
Optional:
|
|
51
|
+
|
|
52
|
+
- `REPRO_MCP_TRANSPORT` (`stdio` or `http`; default `http` when `PORT` is set, otherwise `stdio`)
|
|
53
|
+
- `REPRO_MCP_HTTP_HOST`
|
|
54
|
+
- `REPRO_MCP_HTTP_PORT`
|
|
55
|
+
- `REPRO_MCP_HTTP_PATH`
|
|
56
|
+
- `REPRO_MCP_CORS_ORIGIN`
|
|
57
|
+
- `REPRO_API_BASE_URL`
|
|
58
|
+
- `REPRO_API_PUBLIC_BASE_URL`
|
|
59
|
+
- `REPRO_WEB_BASE_URL`
|
|
60
|
+
- `REPRO_AI_TOKEN`
|
|
61
|
+
- `REPRO_API_TOKEN`
|
|
62
|
+
- `REPRO_DEFAULT_TENANT_ID`
|
|
63
|
+
- `REPRO_APP_ID`
|
|
64
|
+
- `REPRO_REQUEST_TIMEOUT_MS`
|
|
65
|
+
- `REPRO_INVESTIGATE_TIMEOUT_MS`
|
|
66
|
+
- `REPRO_MCP_ENV_FILE`
|
|
67
|
+
- `REPRO_MCP_AUTH_FILE`
|
|
68
|
+
- `REPRO_MCP_AUTH_TIMEOUT_MS`
|
|
69
|
+
- `REPRO_MCP_AUTO_AUTH`
|
|
70
|
+
- `REPRO_MCP_AUTH_MODE` (`wait` or `prompt`; default `prompt` for HTTP and `wait` for stdio)
|
|
71
|
+
- `REPRO_MCP_OPEN_BROWSER`
|
|
72
|
+
- `REPRO_MCP_DEBUG_LOG`
|
|
73
|
+
- `REPRO_MCP_LAUNCH_LOG`
|
|
74
|
+
- `REPRO_PATH_MAPPINGS`
|
|
75
|
+
|
|
76
|
+
Hosted HTTP example:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
export REPRO_MCP_HTTP_HOST="0.0.0.0"
|
|
80
|
+
export REPRO_MCP_HTTP_PORT="8080"
|
|
81
|
+
export REPRO_MCP_HTTP_PATH="/mcp"
|
|
82
|
+
export REPRO_AI_BASE_URL="http://repro-ai:4011/"
|
|
83
|
+
export REPRO_API_BASE_URL="http://api:4010/api/"
|
|
84
|
+
export REPRO_API_PUBLIC_BASE_URL="https://api.example.com/api/"
|
|
85
|
+
export REPRO_WEB_BASE_URL="https://app.example.com/"
|
|
86
|
+
export REPRO_DEFAULT_TENANT_ID="TENANT_123"
|
|
87
|
+
export REPRO_INVESTIGATE_TIMEOUT_MS="90000"
|
|
88
|
+
export REPRO_MCP_AUTO_AUTH="true"
|
|
89
|
+
export REPRO_MCP_AUTH_MODE="prompt"
|
|
90
|
+
export REPRO_MCP_OPEN_BROWSER="false"
|
|
91
|
+
export REPRO_PATH_MAPPINGS='[
|
|
92
|
+
{
|
|
93
|
+
"remotePrefix": "/srv/repro-demo",
|
|
94
|
+
"localPrefix": "/Users/alice/work/repro-demo"
|
|
95
|
+
}
|
|
96
|
+
]'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`run-repro-mcp.sh` loads `repro-mcp/.env`, then `repro-mcp/.env.local`, then the file pointed to by `REPRO_MCP_ENV_FILE` when provided. Environment variables already set by the process take precedence in `src/index.js`; for DigitalOcean App Platform, prefer setting values in the app's environment configuration instead of committing an env file.
|
|
100
|
+
|
|
101
|
+
`REPRO_API_BASE_URL` is used for privacy policy inspection/update tools and browser authentication. `REPRO_WEB_BASE_URL` is used for Privacy Studio links.
|
|
102
|
+
|
|
103
|
+
For hosted MCP, point `REPRO_API_BASE_URL` at the private/internal API address used by the MCP container. Set `REPRO_API_PUBLIC_BASE_URL` to the public API origin users can open in a browser. The MCP server sends that public origin to the API when it creates browser-auth sessions, so the returned authorize URL is browser-accessible even when MCP talks to the API over VPC.
|
|
104
|
+
|
|
105
|
+
`REPRO_PATH_MAPPINGS` is optional. Use it only when telemetry contains deployed code paths that should map to a checkout available inside the MCP runtime. For a hosted container without a mounted checkout, keep it as `[]`.
|
|
106
|
+
|
|
107
|
+
For local development, copy `.env.local.example` to `.env.local`. It contains the old localhost defaults:
|
|
108
|
+
|
|
109
|
+
- `REPRO_AI_BASE_URL=http://127.0.0.1:4011`
|
|
110
|
+
- `REPRO_API_BASE_URL=http://127.0.0.1:4010/api`
|
|
111
|
+
- `REPRO_WEB_BASE_URL=http://127.0.0.1:3000`
|
|
112
|
+
- local `REPRO_PATH_MAPPINGS` for the demo checkout
|
|
113
|
+
|
|
114
|
+
If `REPRO_AI_TOKEN` and `REPRO_API_TOKEN` are not set, `repro-mcp` starts a browser login flow against `REPRO_API_BASE_URL`, caches the resulting app-user bearer token, and reuses it on future requests. Stdio uses `REPRO_MCP_AUTH_MODE=wait`: it prints the authorize URL and waits for approval. HTTP uses `REPRO_MCP_AUTH_MODE=prompt`: the first protected MCP request returns a JSON-RPC error with `error.data.authorizeUrl`; open that URL, approve access, then retry the same MCP request.
|
|
115
|
+
|
|
116
|
+
For the cached app-user token to work with `repro-ai`, configure `repro-ai` with the same `APP_USER_JWT_SECRET` as `repro-api`. Static `REPRO_AI_TOKEN` / `REPRO_API_TOKEN` values are optional overrides, not the normal hosted browser-auth path.
|
|
117
|
+
|
|
118
|
+
`investigate` can legitimately take longer than the lower-level telemetry tools because it may retrieve scope context and run planner/answerer model calls. `REPRO_REQUEST_TIMEOUT_MS` controls the base timeout for all backend calls; `REPRO_INVESTIGATE_TIMEOUT_MS` overrides it just for `investigate` and defaults to at least 90 seconds.
|
|
119
|
+
|
|
120
|
+
## DigitalOcean
|
|
121
|
+
|
|
122
|
+
Container build:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
docker build -t repro-mcp ./repro-mcp
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Minimum production environment:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
REPRO_MCP_HTTP_HOST=0.0.0.0
|
|
132
|
+
PORT=8080
|
|
133
|
+
REPRO_MCP_HTTP_PATH=/mcp
|
|
134
|
+
REPRO_AI_BASE_URL=http://repro-ai:4011/
|
|
135
|
+
REPRO_API_BASE_URL=http://api:4010/api/
|
|
136
|
+
REPRO_API_PUBLIC_BASE_URL=https://your-public-api-host/api/
|
|
137
|
+
REPRO_WEB_BASE_URL=https://your-repro-web-host/
|
|
138
|
+
REPRO_MCP_AUTO_AUTH=true
|
|
139
|
+
REPRO_MCP_AUTH_MODE=prompt
|
|
140
|
+
REPRO_MCP_OPEN_BROWSER=false
|
|
141
|
+
REPRO_PATH_MAPPINGS=[]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
DigitalOcean service requirements:
|
|
145
|
+
|
|
146
|
+
- `repro-mcp` runs as a Web Service from `repro-mcp/Dockerfile` on port `8080`.
|
|
147
|
+
- `repro-mcp` reaches `repro-api` and `repro-ai` through VPC/internal routing.
|
|
148
|
+
- `REPRO_API_PUBLIC_BASE_URL` points to the public API URL used only for the browser authorize page.
|
|
149
|
+
- `repro-api` and `repro-ai` share the same `APP_USER_JWT_SECRET`, so the browser-auth app-user JWT can authorize both services.
|
|
150
|
+
|
|
151
|
+
HTTP endpoints:
|
|
152
|
+
|
|
153
|
+
- `GET /health` and `GET /healthz`: health checks
|
|
154
|
+
- `POST /mcp`: JSON-RPC MCP requests
|
|
155
|
+
- `GET /mcp`: event-stream placeholder for clients that open a stream
|
|
156
|
+
|
|
157
|
+
The same tool handler backs stdio and HTTP transports.
|
|
158
|
+
|
|
159
|
+
## Run
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm start
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`npm start` runs the HTTP server. Local stdio MCP clients should use:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm run start:stdio
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Tools
|
|
172
|
+
|
|
173
|
+
- `investigate`
|
|
174
|
+
- `resolve_scope`
|
|
175
|
+
- `list_actions`
|
|
176
|
+
- `list_requests`
|
|
177
|
+
- `get_request`
|
|
178
|
+
- `get_captured_value`
|
|
179
|
+
- `get_requests_relative_to_anchor`
|
|
180
|
+
- `get_db_changes`
|
|
181
|
+
- `get_trace`
|
|
182
|
+
- `get_action_path`
|
|
183
|
+
- `get_function_candidates`
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reproapp/mcp",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Repro MCP server for AI-assisted debugging and privacy policy workflows",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"bin": {
|
|
8
|
+
"repro-mcp": "src/index.js"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/getrepro/repro-mcp.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/getrepro/repro-mcp/issues"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/getrepro/repro-mcp#readme",
|
|
18
|
+
"keywords": [
|
|
19
|
+
"repro",
|
|
20
|
+
"mcp",
|
|
21
|
+
"debugging",
|
|
22
|
+
"privacy",
|
|
23
|
+
"ai"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"src",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"start": "REPRO_MCP_TRANSPORT=http node src/index.js",
|
|
37
|
+
"start:stdio": "REPRO_MCP_TRANSPORT=stdio node src/index.js",
|
|
38
|
+
"start:http": "REPRO_MCP_TRANSPORT=http node src/index.js",
|
|
39
|
+
"check": "node --check src/index.js",
|
|
40
|
+
"test": "node --test"
|
|
41
|
+
}
|
|
42
|
+
}
|