@sota-io/mcp 1.4.1 → 1.6.0
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 +8 -2
- package/dist/auth/token-bridge.d.ts +16 -0
- package/dist/auth/token-bridge.d.ts.map +1 -1
- package/dist/auth/token-bridge.js +49 -9
- package/dist/auth/token-bridge.js.map +1 -1
- package/dist/auth/verify-jwt.js +6 -6
- package/dist/auth/verify-jwt.js.map +1 -1
- package/dist/http-app.d.ts +27 -0
- package/dist/http-app.d.ts.map +1 -0
- package/dist/http-app.js +310 -0
- package/dist/http-app.js.map +1 -0
- package/dist/http.d.ts +3 -15
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +13 -251
- package/dist/http.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/archive-builder.d.ts +79 -0
- package/dist/lib/archive-builder.d.ts.map +1 -0
- package/dist/lib/archive-builder.js +292 -0
- package/dist/lib/archive-builder.js.map +1 -0
- package/dist/lib/auth-config.d.ts +37 -0
- package/dist/lib/auth-config.d.ts.map +1 -0
- package/dist/lib/auth-config.js +95 -0
- package/dist/lib/auth-config.js.map +1 -0
- package/dist/lib/hosted-guard.d.ts +26 -0
- package/dist/lib/hosted-guard.d.ts.map +1 -0
- package/dist/lib/hosted-guard.js +48 -0
- package/dist/lib/hosted-guard.js.map +1 -0
- package/dist/lib/log.d.ts +17 -0
- package/dist/lib/log.d.ts.map +1 -0
- package/dist/lib/log.js +41 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/version.d.ts +22 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +36 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/oauth-proxy.d.ts +31 -0
- package/dist/oauth-proxy.d.ts.map +1 -0
- package/dist/oauth-proxy.js +212 -0
- package/dist/oauth-proxy.js.map +1 -0
- package/dist/tools/create-account.d.ts.map +1 -1
- package/dist/tools/create-account.js +23 -1
- package/dist/tools/create-account.js.map +1 -1
- package/dist/tools/deploy.d.ts +11 -1
- package/dist/tools/deploy.d.ts.map +1 -1
- package/dist/tools/deploy.js +135 -47
- package/dist/tools/deploy.js.map +1 -1
- package/dist/tools/env.js +1 -1
- package/dist/tools/env.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +13 -4
- package/dist/tools/projects.js.map +1 -1
- package/package.json +11 -10
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package version, read from package.json at runtime.
|
|
3
|
+
*
|
|
4
|
+
* Both entry points (stdio `index.ts` and hosted `http.ts`) report this
|
|
5
|
+
* version, so /health and the MCP `initialize` handshake always match the
|
|
6
|
+
* code that is actually running. The compiled file lives at
|
|
7
|
+
* dist/lib/version.js, so ../../package.json is the package root in the
|
|
8
|
+
* npm tarball, in a local checkout and in the Docker image (/app).
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
export function readPackageVersion() {
|
|
12
|
+
try {
|
|
13
|
+
const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
|
|
14
|
+
if (typeof pkg.version === 'string' && pkg.version !== '')
|
|
15
|
+
return pkg.version;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// fall through: a missing package.json is a packaging bug, not a crash
|
|
19
|
+
}
|
|
20
|
+
return '0.0.0-unknown';
|
|
21
|
+
}
|
|
22
|
+
export const PACKAGE_VERSION = readPackageVersion();
|
|
23
|
+
/**
|
|
24
|
+
* Commit and build time of the hosted image (DEVX-4). The Dockerfile turns
|
|
25
|
+
* the GIT_SHA and BUILD_TIME build args into environment variables of the
|
|
26
|
+
* runtime stage. Anything built without them (npm package, local checkout,
|
|
27
|
+
* a plain `docker compose build`) reports "unknown".
|
|
28
|
+
*/
|
|
29
|
+
export const UNKNOWN_BUILD = 'unknown';
|
|
30
|
+
export function readBuildValue(name, env = process.env) {
|
|
31
|
+
const value = (env[name] ?? '').trim();
|
|
32
|
+
return value === '' ? UNKNOWN_BUILD : value;
|
|
33
|
+
}
|
|
34
|
+
export const GIT_SHA = readBuildValue('GIT_SHA');
|
|
35
|
+
export const BUILD_TIME = readBuildValue('BUILD_TIME');
|
|
36
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/lib/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAE1F,CAAC;QACF,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,KAAK,EAAE;YAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IAChF,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;IACzE,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC,MAAM,UAAU,cAAc,CAAC,IAA8B,EAAE,MAAyB,OAAO,CAAC,GAAG;IACjG,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvC,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oauth-proxy.ts — Phase 65/Pattern-A precursor. Transparent reverse proxy
|
|
3
|
+
* in front of Supabase OAuth Server that strips `openid` from the scope
|
|
4
|
+
* parameter on /authorize requests, working around the Supabase OIDC bug
|
|
5
|
+
* (HTTP 500 "Error generating ID token" — error_id 019e41f7-…).
|
|
6
|
+
*
|
|
7
|
+
* Why this exists: removing `openid` from our /.well-known/oauth-protected-
|
|
8
|
+
* resource metadata's `scopes_supported` only works if the client
|
|
9
|
+
* (Claude.ai) actually respects the advertised list. RFC 9728 says it
|
|
10
|
+
* SHOULD, but if the client hardcodes openid it'll still trigger the bug.
|
|
11
|
+
* This proxy is a hard safety net — no matter what scope the client sends,
|
|
12
|
+
* Supabase never sees `openid` in the request.
|
|
13
|
+
*
|
|
14
|
+
* What the proxy does:
|
|
15
|
+
* GET /auth/v1/.well-known/oauth-authorization-server → rewritten metadata
|
|
16
|
+
* POST /auth/v1/oauth/clients/register → transparent forward
|
|
17
|
+
* GET /auth/v1/oauth/authorize?scope=… → strip openid → forward
|
|
18
|
+
* POST /auth/v1/oauth/token → transparent forward
|
|
19
|
+
* GET /auth/v1/oauth/userinfo → transparent forward
|
|
20
|
+
* GET /auth/v1/.well-known/jwks.json → transparent forward
|
|
21
|
+
* any other GET/POST under /auth/v1/ → transparent forward
|
|
22
|
+
*
|
|
23
|
+
* Redirects are followed by curl/SDK clients themselves; our proxy passes
|
|
24
|
+
* the Location header through unchanged (Supabase emits redirects to
|
|
25
|
+
* sota.io/oauth/authorize which is our consent UI and stays valid).
|
|
26
|
+
*
|
|
27
|
+
* Activation: registered on the same Express app as /mcp via mountOAuthProxy().
|
|
28
|
+
*/
|
|
29
|
+
import type { Express } from 'express';
|
|
30
|
+
export declare function mountOAuthProxy(app: Express, publicOrigin: string): void;
|
|
31
|
+
//# sourceMappingURL=oauth-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-proxy.d.ts","sourceRoot":"","sources":["../src/oauth-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAqB,OAAO,EAAE,MAAM,SAAS,CAAC;AAmI1D,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAyExE"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oauth-proxy.ts — Phase 65/Pattern-A precursor. Transparent reverse proxy
|
|
3
|
+
* in front of Supabase OAuth Server that strips `openid` from the scope
|
|
4
|
+
* parameter on /authorize requests, working around the Supabase OIDC bug
|
|
5
|
+
* (HTTP 500 "Error generating ID token" — error_id 019e41f7-…).
|
|
6
|
+
*
|
|
7
|
+
* Why this exists: removing `openid` from our /.well-known/oauth-protected-
|
|
8
|
+
* resource metadata's `scopes_supported` only works if the client
|
|
9
|
+
* (Claude.ai) actually respects the advertised list. RFC 9728 says it
|
|
10
|
+
* SHOULD, but if the client hardcodes openid it'll still trigger the bug.
|
|
11
|
+
* This proxy is a hard safety net — no matter what scope the client sends,
|
|
12
|
+
* Supabase never sees `openid` in the request.
|
|
13
|
+
*
|
|
14
|
+
* What the proxy does:
|
|
15
|
+
* GET /auth/v1/.well-known/oauth-authorization-server → rewritten metadata
|
|
16
|
+
* POST /auth/v1/oauth/clients/register → transparent forward
|
|
17
|
+
* GET /auth/v1/oauth/authorize?scope=… → strip openid → forward
|
|
18
|
+
* POST /auth/v1/oauth/token → transparent forward
|
|
19
|
+
* GET /auth/v1/oauth/userinfo → transparent forward
|
|
20
|
+
* GET /auth/v1/.well-known/jwks.json → transparent forward
|
|
21
|
+
* any other GET/POST under /auth/v1/ → transparent forward
|
|
22
|
+
*
|
|
23
|
+
* Redirects are followed by curl/SDK clients themselves; our proxy passes
|
|
24
|
+
* the Location header through unchanged (Supabase emits redirects to
|
|
25
|
+
* sota.io/oauth/authorize which is our consent UI and stays valid).
|
|
26
|
+
*
|
|
27
|
+
* Activation: registered on the same Express app as /mcp via mountOAuthProxy().
|
|
28
|
+
*/
|
|
29
|
+
import { resolveAuthUpstream } from './lib/auth-config.js';
|
|
30
|
+
// AUTH_SERVER (compose: ${SUPABASE_URL}/auth/v1); default = prod
|
|
31
|
+
// https://auth.sota.io/auth/v1. Invalid values throw here = fail at startup.
|
|
32
|
+
const UPSTREAM = resolveAuthUpstream();
|
|
33
|
+
/**
|
|
34
|
+
* Strip `openid` from a space-separated scope string. Returns the cleaned
|
|
35
|
+
* value, or undefined when nothing remains (caller should omit the param).
|
|
36
|
+
*/
|
|
37
|
+
function stripOpenidScope(raw) {
|
|
38
|
+
if (!raw)
|
|
39
|
+
return raw;
|
|
40
|
+
const cleaned = raw
|
|
41
|
+
.split(/\s+/)
|
|
42
|
+
.filter((s) => s.length > 0 && s.toLowerCase() !== 'openid')
|
|
43
|
+
.join(' ');
|
|
44
|
+
return cleaned.length === 0 ? undefined : cleaned;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Build a rewritten OIDC discovery document that points all endpoints at
|
|
48
|
+
* mcp.sota.io's proxy rather than auth.sota.io directly. This is the entry
|
|
49
|
+
* point that makes the proxy actually do anything — Claude.ai reads this
|
|
50
|
+
* once and uses these URLs for the rest of the flow.
|
|
51
|
+
*/
|
|
52
|
+
function rewriteMetadata(upstreamMetadata, publicOrigin) {
|
|
53
|
+
const base = `${publicOrigin}/auth/v1`;
|
|
54
|
+
return {
|
|
55
|
+
...upstreamMetadata,
|
|
56
|
+
issuer: upstreamMetadata.issuer, // keep Supabase's issuer so JWT validation still works
|
|
57
|
+
authorization_endpoint: `${base}/oauth/authorize`,
|
|
58
|
+
token_endpoint: `${base}/oauth/token`,
|
|
59
|
+
userinfo_endpoint: `${base}/oauth/userinfo`,
|
|
60
|
+
jwks_uri: `${base}/.well-known/jwks.json`,
|
|
61
|
+
registration_endpoint: `${base}/oauth/clients/register`,
|
|
62
|
+
// Crucially: drop openid from advertised scopes so well-behaved clients
|
|
63
|
+
// skip it. The /authorize strip-pass is the belt-and-braces backup.
|
|
64
|
+
scopes_supported: Array.isArray(upstreamMetadata.scopes_supported)
|
|
65
|
+
? upstreamMetadata.scopes_supported.filter((s) => typeof s === 'string' && s.toLowerCase() !== 'openid')
|
|
66
|
+
: ['profile', 'email'],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Forward an HTTP request to Supabase OAuth Server transparently. Preserves
|
|
71
|
+
* method, headers (except Host), query string, and body. Returns the
|
|
72
|
+
* upstream response untouched.
|
|
73
|
+
*
|
|
74
|
+
* Express has already body-parsed POST JSON for us when content-type was
|
|
75
|
+
* application/json (set up at top of http.ts). For x-www-form-urlencoded
|
|
76
|
+
* we need to re-serialise from req.body. Other content types pass through
|
|
77
|
+
* as best we can — DCR and token endpoints use JSON / form-encoded only.
|
|
78
|
+
*/
|
|
79
|
+
async function forward(req, targetPath, targetQuery) {
|
|
80
|
+
const url = `${UPSTREAM}${targetPath}${targetQuery ?? ''}`;
|
|
81
|
+
const isForm = typeof req.headers['content-type'] === 'string' &&
|
|
82
|
+
req.headers['content-type'].includes('application/x-www-form-urlencoded');
|
|
83
|
+
// Reconstruct body — express.json() leaves it as a parsed object, so we
|
|
84
|
+
// re-serialise based on the original content-type.
|
|
85
|
+
let body;
|
|
86
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
87
|
+
if (isForm) {
|
|
88
|
+
const params = new URLSearchParams();
|
|
89
|
+
for (const [k, v] of Object.entries(req.body ?? {})) {
|
|
90
|
+
if (typeof v === 'string')
|
|
91
|
+
params.append(k, v);
|
|
92
|
+
else if (Array.isArray(v))
|
|
93
|
+
v.forEach((x) => params.append(k, String(x)));
|
|
94
|
+
}
|
|
95
|
+
body = params.toString();
|
|
96
|
+
}
|
|
97
|
+
else if (req.body && typeof req.body === 'object') {
|
|
98
|
+
body = JSON.stringify(req.body);
|
|
99
|
+
}
|
|
100
|
+
else if (typeof req.body === 'string') {
|
|
101
|
+
body = req.body;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const headers = {};
|
|
105
|
+
for (const [k, v] of Object.entries(req.headers)) {
|
|
106
|
+
if (typeof v !== 'string')
|
|
107
|
+
continue;
|
|
108
|
+
// Strip hop-by-hop and host headers; the host gets recomputed by fetch.
|
|
109
|
+
if (['host', 'connection', 'content-length', 'accept-encoding'].includes(k.toLowerCase())) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
headers[k] = v;
|
|
113
|
+
}
|
|
114
|
+
const upstreamRes = await fetch(url, {
|
|
115
|
+
method: req.method,
|
|
116
|
+
headers,
|
|
117
|
+
body,
|
|
118
|
+
redirect: 'manual',
|
|
119
|
+
});
|
|
120
|
+
return upstreamRes;
|
|
121
|
+
}
|
|
122
|
+
async function streamUpstreamResponse(upstream, res) {
|
|
123
|
+
const r = upstream;
|
|
124
|
+
// Mirror headers EXCEPT hop-by-hop ones.
|
|
125
|
+
r.headers.forEach((value, key) => {
|
|
126
|
+
if (['content-encoding', 'transfer-encoding', 'connection'].includes(key.toLowerCase())) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
res.setHeader(key, value);
|
|
130
|
+
});
|
|
131
|
+
res.status(r.status);
|
|
132
|
+
const buf = Buffer.from(await r.arrayBuffer());
|
|
133
|
+
res.end(buf);
|
|
134
|
+
}
|
|
135
|
+
export function mountOAuthProxy(app, publicOrigin) {
|
|
136
|
+
// 1) Rewritten metadata document.
|
|
137
|
+
app.get('/auth/v1/.well-known/oauth-authorization-server', async (_req, res) => {
|
|
138
|
+
try {
|
|
139
|
+
const upstream = await fetch(`${UPSTREAM}/.well-known/oauth-authorization-server`);
|
|
140
|
+
const json = (await upstream.json());
|
|
141
|
+
const rewritten = rewriteMetadata(json, publicOrigin);
|
|
142
|
+
res.json(rewritten);
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
res.status(502).json({
|
|
146
|
+
error: 'metadata_fetch_failed',
|
|
147
|
+
message: err instanceof Error ? err.message : String(err),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
// 2) /authorize — strip openid from the scope before forwarding.
|
|
152
|
+
app.get('/auth/v1/oauth/authorize', async (req, res) => {
|
|
153
|
+
try {
|
|
154
|
+
const params = new URLSearchParams();
|
|
155
|
+
for (const [k, v] of Object.entries(req.query)) {
|
|
156
|
+
if (typeof v === 'string')
|
|
157
|
+
params.set(k, v);
|
|
158
|
+
else if (Array.isArray(v) && typeof v[0] === 'string')
|
|
159
|
+
params.set(k, v[0]);
|
|
160
|
+
}
|
|
161
|
+
const cleanedScope = stripOpenidScope(params.get('scope') ?? undefined);
|
|
162
|
+
if (cleanedScope === undefined) {
|
|
163
|
+
params.delete('scope');
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
params.set('scope', cleanedScope);
|
|
167
|
+
}
|
|
168
|
+
const upstream = await forward(req, '/oauth/authorize', '?' + params.toString());
|
|
169
|
+
if (!upstream) {
|
|
170
|
+
res.status(502).end();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
await streamUpstreamResponse(upstream, res);
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
res.status(502).json({
|
|
177
|
+
error: 'proxy_error',
|
|
178
|
+
message: err instanceof Error ? err.message : String(err),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
// 3) All other /auth/v1/* paths — transparent forward.
|
|
183
|
+
app.all('/auth/v1/*', async (req, res) => {
|
|
184
|
+
try {
|
|
185
|
+
// Some clients (and SDKs) send scope to other endpoints too; strip it
|
|
186
|
+
// defensively wherever it appears in a query string.
|
|
187
|
+
const url = new URL(`http://x${req.originalUrl}`);
|
|
188
|
+
if (url.searchParams.has('scope')) {
|
|
189
|
+
const cleaned = stripOpenidScope(url.searchParams.get('scope') ?? undefined);
|
|
190
|
+
if (cleaned === undefined)
|
|
191
|
+
url.searchParams.delete('scope');
|
|
192
|
+
else
|
|
193
|
+
url.searchParams.set('scope', cleaned);
|
|
194
|
+
}
|
|
195
|
+
const path = url.pathname.replace(/^\/auth\/v1/, '');
|
|
196
|
+
const query = url.search;
|
|
197
|
+
const upstream = await forward(req, path, query || undefined);
|
|
198
|
+
if (!upstream) {
|
|
199
|
+
res.status(502).end();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
await streamUpstreamResponse(upstream, res);
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
res.status(502).json({
|
|
206
|
+
error: 'proxy_error',
|
|
207
|
+
message: err instanceof Error ? err.message : String(err),
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=oauth-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-proxy.js","sourceRoot":"","sources":["../src/oauth-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,iEAAiE;AACjE,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;AAEvC;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAAuB;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC;IACrB,MAAM,OAAO,GAAG,GAAG;SAChB,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO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CAAC,CAAC;YAC9C,CAAC;YACD,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;YACrD,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;YACzB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,SAAS,CAAC,CAAC;YAC9D,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;gBACtB,OAAO;YACT,CAAC;YACD,MAAM,sBAAsB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,KAAK,EAAE,aAAa;gBACpB,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aAC1D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-account.d.ts","sourceRoot":"","sources":["../../src/tools/create-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAcpE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"create-account.d.ts","sourceRoot":"","sources":["../../src/tools/create-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAcpE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,QAqM1D"}
|
|
@@ -146,13 +146,35 @@ sota.io is an EU-native PaaS hosted in Germany — GDPR-compliant by default, no
|
|
|
146
146
|
}
|
|
147
147
|
// Provision: user_plans (Free tier) + sota_xxx key tagged source=claude
|
|
148
148
|
const result = await provisionPlanAndKey(session.user.id);
|
|
149
|
+
// Deliberately neutral, descriptive content with no instructions
|
|
150
|
+
// directing the LLM or the user to modify any client configuration.
|
|
151
|
+
// Tool responses that prescribe config changes look like prompt-
|
|
152
|
+
// injection attempts and are (correctly) flagged by Claude.ai's
|
|
153
|
+
// safety layer. The user-facing setup guide lives at the docs URL.
|
|
149
154
|
return {
|
|
150
155
|
content: [
|
|
151
156
|
{
|
|
152
157
|
type: "text",
|
|
153
|
-
text:
|
|
158
|
+
text: `Account created on sota.io.
|
|
159
|
+
|
|
160
|
+
- Email: ${session.user.email}
|
|
161
|
+
- Plan: Free tier (3 projects, EU-hosted, no credit card)
|
|
162
|
+
- Region: Germany (Hetzner Cloud)
|
|
163
|
+
- API key (save this — shown once): \`${result.apiKey}\`
|
|
164
|
+
|
|
165
|
+
The API key authenticates the sota.io REST API (api.sota.io) and the sota CLI directly.
|
|
166
|
+
|
|
167
|
+
For Claude connector usage and tool activation, see https://sota.io/docs/integrations/claude .`,
|
|
154
168
|
},
|
|
155
169
|
],
|
|
170
|
+
_meta: {
|
|
171
|
+
// Forward-looking hint per MCP spec — Claude.ai doesn't render
|
|
172
|
+
// a UI for this yet, but if/when it does, sota.io users will
|
|
173
|
+
// get a "Reconnect" affordance automatically. Carries no
|
|
174
|
+
// imperative content directed at the LLM.
|
|
175
|
+
"anthropic.com/connector_reauthentication_suggested": true,
|
|
176
|
+
"anthropic.com/reauth_email": session.user.email,
|
|
177
|
+
},
|
|
156
178
|
};
|
|
157
179
|
}
|
|
158
180
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-account.js","sourceRoot":"","sources":["../../src/tools/create-account.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC,EAAE,MAAM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,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;gBAC9C,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,oFAAoF;yBAC3F;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,wEAAwE;YACxE,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAE1D,iEAAiE;YACjE,oEAAoE;YACpE,iEAAiE;YACjE,gEAAgE;YAChE,mEAAmE;YACnE,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE;;WAET,OAAO,CAAC,IAAI,CAAC,KAAK;;;wCAGW,MAAM,CAAC,MAAM;;;;+FAI0C;qBAClF;iBACF;gBACD,KAAK,EAAE;oBACL,+DAA+D;oBAC/D,6DAA6D;oBAC7D,yDAAyD;oBACzD,0CAA0C;oBAC1C,oDAAoD,EAAE,IAAI;oBAC1D,4BAA4B,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;iBACjD;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,uBAAuB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,2CAA2C;qBACzH;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/deploy.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { SotaClient } from '@sota-io/sdk';
|
|
3
|
-
export
|
|
3
|
+
export interface DeployToolOptions {
|
|
4
|
+
/**
|
|
5
|
+
* true for the hosted server (mcp.sota.io): only inline `files` are
|
|
6
|
+
* advertised and accepted. A directory deploy there would pack the
|
|
7
|
+
* sota-mcp container's own filesystem into the caller's project, and a
|
|
8
|
+
* server-side git clone would fetch arbitrary URLs from our network.
|
|
9
|
+
* false (default) for the local stdio server: files, git_url, directory.
|
|
10
|
+
*/
|
|
11
|
+
hosted?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function registerDeployTool(server: McpServer, client: SotaClient, options?: DeployToolOptions): void;
|
|
4
14
|
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/tools/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/tools/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY1C,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAgDD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,iBAAsB,QAMxG"}
|
package/dist/tools/deploy.js
CHANGED
|
@@ -1,67 +1,155 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export function registerDeployTool(server, client) {
|
|
6
|
-
server.registerTool('deploy', {
|
|
7
|
-
description: `Deploy an application to sota.io. Creates a tar.gz archive of the specified directory and uploads it (max 50 MB). The platform auto-detects your framework and builds a Docker image automatically:
|
|
2
|
+
import { archiveFromDirectory, archiveFromFiles, archiveFromGitUrl, ArchiveBuilderError, MAX_INLINE_FILES, MAX_INLINE_TOTAL_BYTES, MAX_CLONE_BYTES, } from '../lib/archive-builder.js';
|
|
3
|
+
import { HOSTED_FILES_ONLY_HINT } from '../lib/hosted-guard.js';
|
|
4
|
+
const INTRO = `Deploy an application to sota.io. The platform auto-detects your framework and builds a Docker image automatically:
|
|
8
5
|
|
|
9
6
|
- Next.js: Detected via next.config.js/ts. Add output: 'standalone' to next.config for optimal builds.
|
|
10
7
|
- Node.js: Detected via package.json with a "start" script. Works with Express, Fastify, Koa, Hapi, etc.
|
|
11
8
|
- Python: Detected via requirements.txt or pyproject.toml. Works with Flask, FastAPI, Django.
|
|
12
|
-
- Custom Dockerfile: If a Dockerfile exists in the project root, it takes priority over auto-detection. Use this for Go, Rust, Java, or any other language. The EXPOSE directive in the Dockerfile is used to detect the app port automatically
|
|
9
|
+
- Custom Dockerfile: If a Dockerfile exists in the project root, it takes priority over auto-detection. Use this for Go, Rust, Java, or any other language. The EXPOSE directive in the Dockerfile is used to detect the app port automatically.`;
|
|
10
|
+
const FILES_MODE = `Pass a map of relative paths to UTF-8 text content. Best when you've just
|
|
11
|
+
generated a small app in this conversation and want to deploy it without
|
|
12
|
+
any filesystem step. Up to ${MAX_INLINE_FILES} files, ${MAX_INLINE_TOTAL_BYTES / 1024 / 1024} MB total. Include
|
|
13
|
+
the framework manifest (package.json, requirements.txt, or Dockerfile)
|
|
14
|
+
so auto-detection works.`;
|
|
15
|
+
const LOCAL_MODES = `THREE WAYS to supply the source code — pick EXACTLY ONE:
|
|
16
|
+
|
|
17
|
+
1. **files** (inline source from AI):
|
|
18
|
+
${FILES_MODE}
|
|
19
|
+
|
|
20
|
+
2. **git_url** (clone a public repo):
|
|
21
|
+
Pass an https://, git://, ssh://, or git@host:path URL. It is shallow-cloned
|
|
22
|
+
(--depth=1 --single-branch) with the local git and deployed. Optional
|
|
23
|
+
git_branch picks a non-default branch. Only public repos are supported in
|
|
24
|
+
v1. Max ${MAX_CLONE_BYTES / 1024 / 1024} MB after clone.
|
|
13
25
|
|
|
14
|
-
|
|
26
|
+
3. **directory** (local filesystem):
|
|
27
|
+
Pass an absolute path. Defaults to the current working directory when
|
|
28
|
+
no other mode is given.`;
|
|
29
|
+
const HOSTED_MODES = `Supply the source code as **files** (inline source from AI):
|
|
30
|
+
${FILES_MODE}
|
|
31
|
+
|
|
32
|
+
This hosted server only accepts inline files. ${HOSTED_FILES_ONLY_HINT}`;
|
|
33
|
+
const OUTRO = `IMPORTANT: Your app MUST listen on the PORT environment variable. For auto-detected frameworks (Next.js, Node.js, Python) PORT is 8080. For custom Dockerfiles, the port is auto-detected from the EXPOSE directive (e.g. EXPOSE 3000 sets PORT=3000). If no EXPOSE is found, it defaults to 8080.
|
|
15
34
|
|
|
16
35
|
Every project includes a managed PostgreSQL 17 database. Six environment variables are auto-injected into your container — no manual database configuration needed: DATABASE_URL (full connection string), PGHOST, PGPORT, PGUSER, PGPASSWORD, and PGDATABASE. Libraries that follow libpq conventions (node-postgres, pgx, psycopg2, Django) pick up the PG* variables automatically with no configuration. If your app needs database migrations, run them on startup.
|
|
17
36
|
|
|
18
|
-
Deployments use blue-green strategy for zero downtime. The old container keeps running until the new one passes health checks (60s timeout). Use get-logs to monitor build progress.
|
|
37
|
+
Deployments use blue-green strategy for zero downtime. The old container keeps running until the new one passes health checks (60s timeout). Use get-logs to monitor build progress. .git/, node_modules/, .DS_Store and the local/secret env files .env, .env.local, .env.*.local and .envrc (any directory, any case) are excluded from the archive; set runtime secrets with set-env instead. Committed variants such as .env.production are kept (set-env values are not available at build time).`;
|
|
38
|
+
const FILES_DESCRIPTION = 'Map of relative file paths to UTF-8 text content. Use when generating an app inline (e.g. from a Claude.ai web conversation). Include a framework manifest so auto-detection works.';
|
|
39
|
+
function errorResult(text) {
|
|
40
|
+
return { content: [{ type: 'text', text }], isError: true };
|
|
41
|
+
}
|
|
42
|
+
export function registerDeployTool(server, client, options = {}) {
|
|
43
|
+
if (options.hosted === true) {
|
|
44
|
+
registerHostedDeployTool(server, client);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
registerLocalDeployTool(server, client);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function uploadArchive(client, projectId, archive, modeDescription) {
|
|
51
|
+
try {
|
|
52
|
+
const deployment = await client.deploy(projectId, archive);
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: 'text',
|
|
57
|
+
text: `Deployment started (${modeDescription}):\n ID: ${deployment.id}\n Status: ${deployment.status}\n URL: ${deployment.url || 'pending'}\n\nUse get-logs to check build progress.`,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return errorResult(`Deploy failed during upload: ${error instanceof Error ? error.message : String(error)}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function archiveError(error) {
|
|
67
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
68
|
+
const code = error instanceof ArchiveBuilderError ? ` [${error.code}]` : '';
|
|
69
|
+
return errorResult(`Deploy failed during archive construction${code}: ${detail}`);
|
|
70
|
+
}
|
|
71
|
+
/** Hosted (mcp.sota.io): inline files only. */
|
|
72
|
+
function registerHostedDeployTool(server, client) {
|
|
73
|
+
server.registerTool('deploy', {
|
|
74
|
+
description: `${INTRO}\n\n${HOSTED_MODES}\n\n${OUTRO}`,
|
|
19
75
|
inputSchema: {
|
|
20
|
-
project_id: z.string().describe('Project ID (UUID) to deploy to. Use list-projects to find the ID'),
|
|
21
|
-
|
|
76
|
+
project_id: z.string().describe('Project ID (UUID) to deploy to. Use list-projects to find the ID.'),
|
|
77
|
+
files: z.record(z.string(), z.string()).describe(FILES_DESCRIPTION),
|
|
22
78
|
},
|
|
23
79
|
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
24
|
-
}, async (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
80
|
+
}, async (args) => {
|
|
81
|
+
// Defence in depth: http.ts already rejects directory/git_url before the
|
|
82
|
+
// tool runs, and the schema requires files. Never fall back to a
|
|
83
|
+
// directory (process.cwd() is the sota-mcp container itself).
|
|
84
|
+
const { project_id, files } = args;
|
|
85
|
+
if (files === undefined || files === null || typeof files !== 'object') {
|
|
86
|
+
return errorResult(`Error: the hosted server needs \`files\`. ${HOSTED_FILES_ONLY_HINT}`);
|
|
87
|
+
}
|
|
88
|
+
let archive;
|
|
89
|
+
try {
|
|
90
|
+
archive = archiveFromFiles(files);
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return archiveError(error);
|
|
94
|
+
}
|
|
95
|
+
return uploadArchive(client, project_id, archive, `inline files (${Object.keys(files).length} entries)`);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/** Local stdio server (npx @sota-io/mcp): files, git_url or directory. */
|
|
99
|
+
function registerLocalDeployTool(server, client) {
|
|
100
|
+
server.registerTool('deploy', {
|
|
101
|
+
description: `${INTRO}\n\n${LOCAL_MODES}\n\n${OUTRO}`,
|
|
102
|
+
inputSchema: {
|
|
103
|
+
project_id: z.string().describe('Project ID (UUID) to deploy to. Use list-projects to find the ID.'),
|
|
104
|
+
files: z
|
|
105
|
+
.record(z.string(), z.string())
|
|
106
|
+
.optional()
|
|
107
|
+
.describe(`${FILES_DESCRIPTION} Mutually exclusive with git_url and directory.`),
|
|
108
|
+
git_url: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('Public git repository URL to clone (https://, git://, ssh://, or git@host:path). Mutually exclusive with files and directory.'),
|
|
112
|
+
git_branch: z
|
|
113
|
+
.string()
|
|
114
|
+
.optional()
|
|
115
|
+
.describe('Optional branch name when using git_url. Defaults to the repository default branch.'),
|
|
116
|
+
directory: z
|
|
117
|
+
.string()
|
|
118
|
+
.optional()
|
|
119
|
+
.describe('Absolute path to a local directory. Defaults to the current working directory when no other mode is given. Mutually exclusive with files and git_url.'),
|
|
120
|
+
},
|
|
121
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
|
|
122
|
+
}, async ({ project_id, files, git_url, git_branch, directory }) => {
|
|
123
|
+
// Mutual-exclusivity check: at most one mode set. When zero are set we
|
|
124
|
+
// fall back to directory mode with cwd (legacy CLI behaviour).
|
|
125
|
+
const modesSet = [files !== undefined, git_url !== undefined, directory !== undefined].filter(Boolean).length;
|
|
126
|
+
if (modesSet > 1) {
|
|
127
|
+
return errorResult('Error: deploy accepts exactly one of `files`, `git_url`, or `directory`. Pick the mode that matches your environment (files for inline AI-generated code, git_url for a public repo, directory for a local path).');
|
|
128
|
+
}
|
|
129
|
+
if (git_branch && !git_url) {
|
|
130
|
+
return errorResult('Error: `git_branch` only makes sense together with `git_url`.');
|
|
36
131
|
}
|
|
132
|
+
let archive;
|
|
133
|
+
let modeDescription;
|
|
37
134
|
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
],
|
|
52
|
-
};
|
|
135
|
+
if (files !== undefined) {
|
|
136
|
+
archive = archiveFromFiles(files);
|
|
137
|
+
modeDescription = `inline files (${Object.keys(files).length} entries)`;
|
|
138
|
+
}
|
|
139
|
+
else if (git_url !== undefined) {
|
|
140
|
+
archive = archiveFromGitUrl(git_url, git_branch);
|
|
141
|
+
modeDescription = `git clone (${git_url}${git_branch ? ` @ ${git_branch}` : ''})`;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
const dir = directory || process.cwd();
|
|
145
|
+
archive = archiveFromDirectory(dir);
|
|
146
|
+
modeDescription = `directory (${dir})`;
|
|
147
|
+
}
|
|
53
148
|
}
|
|
54
149
|
catch (error) {
|
|
55
|
-
return
|
|
56
|
-
content: [
|
|
57
|
-
{
|
|
58
|
-
type: 'text',
|
|
59
|
-
text: `Deploy failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
isError: true,
|
|
63
|
-
};
|
|
150
|
+
return archiveError(error);
|
|
64
151
|
}
|
|
152
|
+
return uploadArchive(client, project_id, archive, modeDescription);
|
|
65
153
|
});
|
|
66
154
|
}
|
|
67
155
|
//# sourceMappingURL=deploy.js.map
|
package/dist/tools/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/tools/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/tools/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAahE,MAAM,KAAK,GAAG;;;;;iPAKmO,CAAC;AAElP,MAAM,UAAU,GAAG;;gCAEa,gBAAgB,WAAW,sBAAsB,GAAG,IAAI,GAAG,IAAI;;4BAEnE,CAAC;AAE7B,MAAM,WAAW,GAAG;;;KAGf,UAAU;;;;;;aAMF,eAAe,GAAG,IAAI,GAAG,IAAI;;;;2BAIf,CAAC;AAE5B,MAAM,YAAY,GAAG;KAChB,UAAU;;gDAEiC,sBAAsB,EAAE,CAAC;AAEzE,MAAM,KAAK,GAAG;;;;ueAIyd,CAAC;AAExe,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: 'Set an environment variable for a project. Variables are encrypted at rest (AES-256-GCM) and injected at container runtime. NOTE: DATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD, and PGDATABASE are all auto-injected for the managed PostgreSQL database — you do NOT need to set any of them manually. The PORT variable is auto-managed: 8080 for auto-detected frameworks (Next.js, Node.js, Python), or auto-detected from the Dockerfile EXPOSE directive for custom Dockerfile builds. IMPORTANT: Changing env vars does NOT auto-redeploy. You must call deploy or use the redeploy API endpoint to apply changes. For Next.js apps, NEXT_PUBLIC_* variables must be set BEFORE deploying since they are embedded at build time.',
|
|
5
5
|
inputSchema: {
|
|
6
6
|
project_id: z.string().describe('Project ID (UUID)'),
|
|
7
|
-
key: z.string().describe('Environment variable name (e.g.,
|
|
7
|
+
key: z.string().describe('Environment variable name (e.g., REDIS_URL, API_SECRET). Do NOT set DATABASE_URL — it is auto-managed'),
|
|
8
8
|
value: z.string().describe('Environment variable value. Will be encrypted at rest'),
|
|
9
9
|
},
|
|
10
10
|
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|