run402-mcp 1.4.0 → 1.5.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.
@@ -9,7 +9,7 @@ export async function handleArchiveProject(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest(`/v1/projects/${args.project_id}`, {
12
+ const res = await apiRequest(`/projects/v1/${args.project_id}`, {
13
13
  method: "DELETE",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -7,7 +7,7 @@ export const billingHistorySchema = {
7
7
  };
8
8
  export async function handleBillingHistory(args) {
9
9
  const wallet = args.wallet.toLowerCase();
10
- let path = `/v1/billing/accounts/${wallet}/history`;
10
+ let path = `/billing/v1/accounts/${wallet}/history`;
11
11
  if (args.limit)
12
12
  path += `?limit=${args.limit}`;
13
13
  const res = await apiRequest(path, { method: "GET" });
@@ -8,10 +8,10 @@ export const browseAppsSchema = {
8
8
  .describe("Optional tags to filter by (e.g. ['auth', 'rls'])"),
9
9
  };
10
10
  export async function handleBrowseApps(args) {
11
- let path = "/v1/apps";
11
+ let path = "/apps/v1";
12
12
  if (args.tags && args.tags.length > 0) {
13
13
  const params = args.tags.map((t) => `tag=${encodeURIComponent(t)}`).join("&");
14
- path = `/v1/apps?${params}`;
14
+ path = `/apps/v1?${params}`;
15
15
  }
16
16
  const res = await apiRequest(path, { method: "GET" });
17
17
  if (!res.ok)
@@ -54,7 +54,7 @@ export const bundleDeploySchema = {
54
54
  };
55
55
  export async function handleBundleDeploy(args) {
56
56
  const tier = args.tier || "prototype";
57
- const res = await apiRequest(`/v1/deploy/${tier}`, {
57
+ const res = await apiRequest(`/deploy/v1/${tier}`, {
58
58
  method: "POST",
59
59
  body: {
60
60
  name: args.name,
@@ -8,7 +8,7 @@ export const checkBalanceSchema = {
8
8
  };
9
9
  export async function handleCheckBalance(args) {
10
10
  const wallet = args.wallet.toLowerCase();
11
- const res = await apiRequest(`/v1/billing/accounts/${wallet}`, {
11
+ const res = await apiRequest(`/billing/v1/accounts/${wallet}`, {
12
12
  method: "GET",
13
13
  });
14
14
  if (!res.ok)
@@ -6,7 +6,7 @@ export const createCheckoutSchema = {
6
6
  amount_usd_micros: z.number().describe("Amount in micro-USD (e.g. 5000000 = $5.00)"),
7
7
  };
8
8
  export async function handleCreateCheckout(args) {
9
- const res = await apiRequest("/v1/billing/checkouts", {
9
+ const res = await apiRequest("/billing/v1/checkouts", {
10
10
  method: "POST",
11
11
  body: { wallet: args.wallet.toLowerCase(), amount_usd_micros: args.amount_usd_micros },
12
12
  });
@@ -10,7 +10,7 @@ export async function handleDeleteFunction(args) {
10
10
  const project = getProject(args.project_id);
11
11
  if (!project)
12
12
  return projectNotFound(args.project_id);
13
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/functions/${encodeURIComponent(args.name)}`, {
13
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/functions/${encodeURIComponent(args.name)}`, {
14
14
  method: "DELETE",
15
15
  headers: {
16
16
  Authorization: `Bearer ${project.service_key}`,
@@ -10,7 +10,7 @@ export async function handleDeleteSecret(args) {
10
10
  const project = getProject(args.project_id);
11
11
  if (!project)
12
12
  return projectNotFound(args.project_id);
13
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/secrets/${encodeURIComponent(args.key)}`, {
13
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/secrets/${encodeURIComponent(args.key)}`, {
14
14
  method: "DELETE",
15
15
  headers: {
16
16
  Authorization: `Bearer ${project.service_key}`,
@@ -10,7 +10,7 @@ export async function handleDeleteVersion(args) {
10
10
  const project = getProject(args.project_id);
11
11
  if (!project)
12
12
  return projectNotFound(args.project_id);
13
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/versions/${args.version_id}`, {
13
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/versions/${args.version_id}`, {
14
14
  method: "DELETE",
15
15
  headers: { Authorization: `Bearer ${project.service_key}` },
16
16
  });
@@ -26,7 +26,7 @@ export async function handleDeployFunction(args) {
26
26
  const project = getProject(args.project_id);
27
27
  if (!project)
28
28
  return projectNotFound(args.project_id);
29
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/functions`, {
29
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/functions`, {
30
30
  method: "POST",
31
31
  headers: {
32
32
  Authorization: `Bearer ${project.service_key}`,
@@ -25,7 +25,7 @@ export const deploySiteSchema = {
25
25
  .describe("Array of files to deploy. Must include at least index.html."),
26
26
  };
27
27
  export async function handleDeploySite(args) {
28
- const res = await apiRequest("/v1/deployments", {
28
+ const res = await apiRequest("/deployments/v1", {
29
29
  method: "POST",
30
30
  body: {
31
31
  name: args.name,
@@ -16,7 +16,7 @@ export const forkAppSchema = {
16
16
  };
17
17
  export async function handleForkApp(args) {
18
18
  const tier = args.tier || "prototype";
19
- const res = await apiRequest(`/v1/fork/${tier}`, {
19
+ const res = await apiRequest(`/fork/v1/${tier}`, {
20
20
  method: "POST",
21
21
  body: {
22
22
  version_id: args.version_id,
@@ -12,7 +12,7 @@ export const generateImageSchema = {
12
12
  };
13
13
  export async function handleGenerateImage(args) {
14
14
  const aspect = args.aspect || "square";
15
- const res = await apiRequest("/v1/generate-image", {
15
+ const res = await apiRequest("/generate-image/v1", {
16
16
  method: "POST",
17
17
  body: { prompt: args.prompt, aspect },
18
18
  });
@@ -5,7 +5,7 @@ export const getAppSchema = {
5
5
  version_id: z.string().describe("The version ID of the app to inspect"),
6
6
  };
7
7
  export async function handleGetApp(args) {
8
- const res = await apiRequest(`/v1/apps/${args.version_id}`, {
8
+ const res = await apiRequest(`/apps/v1/${args.version_id}`, {
9
9
  method: "GET",
10
10
  });
11
11
  if (!res.ok)
@@ -5,7 +5,7 @@ export const getDeploymentSchema = {
5
5
  deployment_id: z.string().describe("Deployment ID (e.g. dpl_1709337600000_a1b2c3)"),
6
6
  };
7
7
  export async function handleGetDeployment(args) {
8
- const res = await apiRequest(`/v1/deployments/${args.deployment_id}`, {
8
+ const res = await apiRequest(`/deployments/v1/${args.deployment_id}`, {
9
9
  method: "GET",
10
10
  });
11
11
  if (!res.ok)
@@ -15,7 +15,7 @@ export async function handleGetFunctionLogs(args) {
15
15
  if (!project)
16
16
  return projectNotFound(args.project_id);
17
17
  const tail = args.tail || 50;
18
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/functions/${encodeURIComponent(args.name)}/logs?tail=${tail}`, {
18
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/functions/${encodeURIComponent(args.name)}/logs?tail=${tail}`, {
19
19
  method: "GET",
20
20
  headers: {
21
21
  Authorization: `Bearer ${project.service_key}`,
@@ -2,7 +2,7 @@ import { apiRequest } from "../client.js";
2
2
  import { formatApiError } from "../errors.js";
3
3
  export const getQuoteSchema = {};
4
4
  export async function handleGetQuote(_args) {
5
- const res = await apiRequest("/v1/projects", { method: "GET" });
5
+ const res = await apiRequest("/projects/v1", { method: "GET" });
6
6
  if (!res.ok)
7
7
  return formatApiError(res, "getting quote");
8
8
  const body = res.body;
@@ -9,7 +9,7 @@ export async function handleGetSchema(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/schema`, {
12
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/schema`, {
13
13
  method: "GET",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -9,7 +9,7 @@ export async function handleGetUsage(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/usage`, {
12
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/usage`, {
13
13
  method: "GET",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -9,7 +9,7 @@ export async function handleListFunctions(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/functions`, {
12
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/functions`, {
13
13
  method: "GET",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -8,7 +8,7 @@ export const listProjectsSchema = {
8
8
  };
9
9
  export async function handleListProjects(args) {
10
10
  const wallet = args.wallet.toLowerCase();
11
- const res = await apiRequest(`/v1/wallets/${wallet}/projects`, {
11
+ const res = await apiRequest(`/wallets/v1/${wallet}/projects`, {
12
12
  method: "GET",
13
13
  });
14
14
  if (!res.ok)
@@ -9,7 +9,7 @@ export async function handleListSecrets(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/secrets`, {
12
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/secrets`, {
13
13
  method: "GET",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -9,7 +9,7 @@ export async function handleListSubdomains(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest("/v1/subdomains", {
12
+ const res = await apiRequest("/subdomains/v1", {
13
13
  method: "GET",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -9,7 +9,7 @@ export async function handleListVersions(args) {
9
9
  const project = getProject(args.project_id);
10
10
  if (!project)
11
11
  return projectNotFound(args.project_id);
12
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/versions`, {
12
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/versions`, {
13
13
  method: "GET",
14
14
  headers: {
15
15
  Authorization: `Bearer ${project.service_key}`,
@@ -15,7 +15,7 @@ export const provisionSchema = {
15
15
  export async function handleProvision(args) {
16
16
  const tier = args.tier || "prototype";
17
17
  const name = args.name;
18
- const res = await apiRequest("/v1/projects", {
18
+ const res = await apiRequest("/projects/v1", {
19
19
  method: "POST",
20
20
  body: { tier, name },
21
21
  });
@@ -19,7 +19,7 @@ export async function handlePublishApp(args) {
19
19
  const project = getProject(args.project_id);
20
20
  if (!project)
21
21
  return projectNotFound(args.project_id);
22
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/publish`, {
22
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/publish`, {
23
23
  method: "POST",
24
24
  headers: {
25
25
  Authorization: `Bearer ${project.service_key}`,
@@ -14,7 +14,7 @@ export async function handleRenew(args) {
14
14
  if (!project)
15
15
  return projectNotFound(args.project_id);
16
16
  const tier = args.tier || project.tier;
17
- const res = await apiRequest(`/v1/projects/${args.project_id}/renew`, {
17
+ const res = await apiRequest(`/projects/v1/${args.project_id}/renew`, {
18
18
  method: "POST",
19
19
  body: { tier },
20
20
  });
@@ -30,7 +30,7 @@ export async function handleRequestFaucet(args) {
30
30
  };
31
31
  }
32
32
  }
33
- const res = await apiRequest("/v1/faucet", {
33
+ const res = await apiRequest("/faucet/v1", {
34
34
  method: "POST",
35
35
  body: { address },
36
36
  });
@@ -19,7 +19,7 @@ export async function handleRunSql(args) {
19
19
  const project = getProject(args.project_id);
20
20
  if (!project)
21
21
  return projectNotFound(args.project_id);
22
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/sql`, {
22
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/sql`, {
23
23
  method: "POST",
24
24
  rawBody: args.sql,
25
25
  headers: {
@@ -5,7 +5,7 @@ export const sendMessageSchema = {
5
5
  message: z.string().describe("Message to send to the Run402 developers"),
6
6
  };
7
7
  export async function handleSendMessage(args) {
8
- const res = await apiRequest("/v1/message", {
8
+ const res = await apiRequest("/message/v1", {
9
9
  method: "POST",
10
10
  body: { message: args.message },
11
11
  });
@@ -12,7 +12,7 @@ export async function handleSetAgentContact(args) {
12
12
  body.email = args.email;
13
13
  if (args.webhook)
14
14
  body.webhook = args.webhook;
15
- const res = await apiRequest("/v1/agent/contact", {
15
+ const res = await apiRequest("/agent/v1/contact", {
16
16
  method: "PUT",
17
17
  body,
18
18
  });
@@ -15,7 +15,7 @@ export async function handleSetSecret(args) {
15
15
  const project = getProject(args.project_id);
16
16
  if (!project)
17
17
  return projectNotFound(args.project_id);
18
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/secrets`, {
18
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/secrets`, {
19
19
  method: "POST",
20
20
  headers: {
21
21
  Authorization: `Bearer ${project.service_key}`,
@@ -23,7 +23,7 @@ export async function handleSetupRls(args) {
23
23
  const project = getProject(args.project_id);
24
24
  if (!project)
25
25
  return projectNotFound(args.project_id);
26
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/rls`, {
26
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/rls`, {
27
27
  method: "POST",
28
28
  headers: {
29
29
  Authorization: `Bearer ${project.service_key}`,
@@ -22,7 +22,7 @@ export async function handleClaimSubdomain(args) {
22
22
  return projectNotFound(args.project_id);
23
23
  authHeader = { Authorization: `Bearer ${project.service_key}` };
24
24
  }
25
- const res = await apiRequest("/v1/subdomains", {
25
+ const res = await apiRequest("/subdomains/v1", {
26
26
  method: "POST",
27
27
  headers: authHeader,
28
28
  body: { name: args.name, deployment_id: args.deployment_id },
@@ -61,7 +61,7 @@ export async function handleDeleteSubdomain(args) {
61
61
  return projectNotFound(args.project_id);
62
62
  authHeader = { Authorization: `Bearer ${project.service_key}` };
63
63
  }
64
- const res = await apiRequest(`/v1/subdomains/${encodeURIComponent(args.name)}`, {
64
+ const res = await apiRequest(`/subdomains/v1/${encodeURIComponent(args.name)}`, {
65
65
  method: "DELETE",
66
66
  headers: authHeader,
67
67
  });
@@ -23,7 +23,7 @@ export async function handleUpdateVersion(args) {
23
23
  body.visibility = args.visibility;
24
24
  if (args.fork_allowed !== undefined)
25
25
  body.fork_allowed = args.fork_allowed;
26
- const res = await apiRequest(`/admin/v1/projects/${args.project_id}/versions/${args.version_id}`, {
26
+ const res = await apiRequest(`/projects/v1/admin/${args.project_id}/versions/${args.version_id}`, {
27
27
  method: "PATCH",
28
28
  headers: { Authorization: `Bearer ${project.service_key}` },
29
29
  body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",