@depixapp/mcp
Advanced tools
@@ -1,2 +0,2 @@ | ||
| // Thin, stateless HTTP client for the public DePix API (spec §2.1, §3.2, §4.6). | ||
| // Thin, stateless HTTP client for the public DePix App API (spec §2.1, §3.2, §4.6). | ||
| // It injects the caller's Bearer key VERBATIM, enforces the fail-closed egress | ||
@@ -58,3 +58,3 @@ // rules (origin allowlist + redirect:'error'), captures X-Request-Id, maps the | ||
| // so a misconfigured/malicious DEPIX_API_BASE can never receive the key. | ||
| throw new ToolError("DePix MCP is misconfigured: the API base points to a non-allowlisted origin. The request was refused before any network call.", "config_error", { data: { origin: url.origin } }); | ||
| throw new ToolError("DePix App MCP is misconfigured: the API base points to a non-allowlisted origin. The request was refused before any network call.", "config_error", { data: { origin: url.origin } }); | ||
| } | ||
@@ -111,3 +111,3 @@ return url; | ||
| } | ||
| lastError = new ToolError("Could not reach the DePix API (network error). Please retry.", "network_error", { retryable: true }); | ||
| lastError = new ToolError("Could not reach the DePix App API (network error). Please retry.", "network_error", { retryable: true }); | ||
| logger.warn("api_network_error", { tool: req.tool, method: req.method, path: req.path, attempt }); | ||
@@ -114,0 +114,0 @@ if (retrySafe && attempt < this.maxAttempts) { |
+1
-1
@@ -24,3 +24,3 @@ // Public, zero-secret configuration (spec §2.6). No API key, Eulen token, HMAC | ||
| export const SERVER_NAME = "com.depixapp/gateway"; | ||
| export const SERVER_TITLE = "DePix Gateway"; | ||
| export const SERVER_TITLE = "DePix App Gateway"; | ||
| /** Resolve the API base URL, trimming trailing slashes. */ | ||
@@ -27,0 +27,0 @@ export function resolveApiBase(env = process.env) { |
+10
-10
@@ -1,2 +0,2 @@ | ||
| // Structured-error translation (spec §4.6). The DePix API returns a dual error | ||
| // Structured-error translation (spec §4.6). The DePix App API returns a dual error | ||
| // envelope: `response.errorMessage` (legacy Portuguese, human contract) and | ||
@@ -40,3 +40,3 @@ // `error` (machine contract: { code, message, request_id, retry_after, | ||
| } | ||
| return new ToolError("No DePix API key on this connection. Over HTTP, connect with the header `Authorization: Bearer sk_…`; in local stdio mode set the DEPIX_API_KEY environment variable. Ask the user to reconnect with their key (sk_test_ for sandbox, sk_live_ for production) — tools cannot set it. See https://depixapp.com/docs/en/", "missing_api_key"); | ||
| return new ToolError("No DePix App API key on this connection. Over HTTP, connect with the header `Authorization: Bearer sk_…`; in local stdio mode set the DEPIX_API_KEY environment variable. Ask the user to reconnect with their key (sk_test_ for sandbox, sk_live_ for production) — tools cannot set it. See https://depixapp.com/docs/en/", "missing_api_key"); | ||
| } | ||
@@ -127,5 +127,5 @@ function truncate(value) { | ||
| // The typed dead-end (beco-com-placa): the WorkOS identity is valid but no | ||
| // DePix account is linked to it, so there is nothing to act on behalf of. | ||
| // DePix App account is linked to it, so there is nothing to act on behalf of. | ||
| message = | ||
| "This OAuth login isn't linked to a DePix account yet. Sign in to the DePix dashboard, link this login (Google/GitHub) under your connector settings, then reconnect. See https://depixapp.com/docs/en/"; | ||
| "This OAuth login isn't linked to a DePix App account yet. Sign in to the DePix App dashboard, link this login (Google/GitHub) under your connector settings, then reconnect. See https://depixapp.com/docs/en/"; | ||
| break; | ||
@@ -137,3 +137,3 @@ case "account_blocked": | ||
| message = | ||
| "Your key is valid but has no merchant profile. Create one in the DePix dashboard (this MCP cannot create merchants)."; | ||
| "Your key is valid but has no merchant profile. Create one in the DePix App dashboard (this MCP cannot create merchants)."; | ||
| break; | ||
@@ -205,15 +205,15 @@ case "live_access_required": | ||
| case "platform_shutdown": | ||
| message = `The DePix platform is temporarily shut down. Retry after ${retryAfterPhrase(retryAfter)}.`; | ||
| message = `The DePix App platform is temporarily shut down. Retry after ${retryAfterPhrase(retryAfter)}.`; | ||
| break; | ||
| case "service_unavailable": | ||
| message = `DePix API temporarily unavailable. Retry after ${retryAfterPhrase(retryAfter)}.`; | ||
| message = `DePix App API temporarily unavailable. Retry after ${retryAfterPhrase(retryAfter)}.`; | ||
| break; | ||
| case "upstream_error": | ||
| message = "Upstream provider error at the DePix API. Please retry."; | ||
| message = "Upstream provider error at the DePix App API. Please retry."; | ||
| break; | ||
| case "internal_error": | ||
| message = "Internal error at the DePix API. Quote request_id in a support request."; | ||
| message = "Internal error at the DePix App API. Quote request_id in a support request."; | ||
| break; | ||
| default: | ||
| message = `DePix API error (${code}). See error.data for details.`; | ||
| message = `DePix App API error (${code}). See error.data for details.`; | ||
| break; | ||
@@ -220,0 +220,0 @@ } |
+1
-1
@@ -64,3 +64,3 @@ // Streamable HTTP glue (spec §2.2, §2.4). A FRESH McpServer + transport is built | ||
| // Forward the verified WorkOS JWT to the API as the bearer. The backend | ||
| // accepts it as a third auth method and resolves the DePix account linked | ||
| // accepts it as a third auth method and resolves the DePix App account linked | ||
| // to this operator identity — or answers 403 oauth_account_not_linked when | ||
@@ -67,0 +67,0 @@ // no account is linked yet (the typed dead-end the tools surface). The |
+1
-1
@@ -19,3 +19,3 @@ // Redacting logger (spec §3.2). Hard rule: the caller's bearer credential never | ||
| const JWT_TOKEN_RE = /eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g; | ||
| /** Replace any DePix bearer credential (sk_ key or WorkOS JWT) with a mask. */ | ||
| /** Replace any DePix App bearer credential (sk_ key or WorkOS JWT) with a mask. */ | ||
| export function redact(value) { | ||
@@ -22,0 +22,0 @@ return value.replace(SK_TOKEN_RE, "sk_***").replace(JWT_TOKEN_RE, "eyJ***"); |
+2
-2
@@ -20,4 +20,4 @@ // Server factory (spec §2.8). Registers all 21 tools on a McpServer bound to an | ||
| const INSTRUCTIONS = [ | ||
| "DePix Gateway MCP — receive Pix payments (checkouts/products) and read transaction status via the public DePix API.", | ||
| "Authentication is a DePix API key (sk_test_… for sandbox, sk_live_… for production), configured on the connection itself: over HTTP it is the `Authorization: Bearer sk_…` header; in local stdio mode it is the DEPIX_API_KEY environment variable.", | ||
| "DePix App Gateway MCP — receive Pix payments (checkouts/products) and read transaction status via the public DePix App API.", | ||
| "Authentication is a DePix App API key (sk_test_… for sandbox, sk_live_… for production), configured on the connection itself: over HTTP it is the `Authorization: Bearer sk_…` header; in local stdio mode it is the DEPIX_API_KEY environment variable.", | ||
| "Tools cannot set the key — if a tool reports a missing key, ask the user to reconnect with their key configured.", | ||
@@ -24,0 +24,0 @@ "Always test with an sk_test_ key first. `get_account` is the recommended connection test.", |
+1
-1
@@ -14,3 +14,3 @@ #!/usr/bin/env node | ||
| if (!apiKey || !apiKey.startsWith("sk_")) { | ||
| process.stderr.write("depix-mcp: set DEPIX_API_KEY to your DePix API key (sk_test_… for sandbox, sk_live_… for production).\n"); | ||
| process.stderr.write("depix-mcp: set DEPIX_API_KEY to your DePix App API key (sk_test_… for sandbox, sk_live_… for production).\n"); | ||
| process.exit(1); | ||
@@ -17,0 +17,0 @@ } |
@@ -15,3 +15,3 @@ // Account tool: get_account (GET /api/me) — also the quickstart "connection | ||
| if (err instanceof ToolError && (err.code === "not_found" || err.code === "merchant_required")) { | ||
| throw new ToolError("Your key is valid but has no merchant profile. Create one in the DePix dashboard (this MCP cannot create merchants).", "merchant_required", { data: err.data }); | ||
| throw new ToolError("Your key is valid but has no merchant profile. Create one in the DePix App dashboard (this MCP cannot create merchants).", "merchant_required", { data: err.data }); | ||
| } | ||
@@ -18,0 +18,0 @@ throw err; |
+1
-1
| { | ||
| "name": "@depixapp/mcp", | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "mcpName": "io.github.depixapp/depix-mcp", | ||
@@ -5,0 +5,0 @@ "type": "module", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
121095
0.07%2
-33.33%