@sodiumhq/mcp-pm 0.1.0-beta.4457 → 0.1.0-beta.4465
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/dist/http.js +4 -3
- package/package.json +1 -1
package/dist/http.js
CHANGED
|
@@ -171,11 +171,11 @@ var AuthError = class extends Error {
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
function loadAuthConfig() {
|
|
174
|
-
const resourceUrl = process.env.MCP_RESOURCE_URL;
|
|
174
|
+
const resourceUrl = process.env.MCP_RESOURCE_URL?.trim();
|
|
175
175
|
const issuer = process.env.AUTH0_ISSUER;
|
|
176
176
|
if (!resourceUrl || !issuer) return null;
|
|
177
177
|
return {
|
|
178
|
-
resourceUrl
|
|
178
|
+
resourceUrl,
|
|
179
179
|
issuer: issuer.endsWith("/") ? issuer : `${issuer}/`,
|
|
180
180
|
scopes: {
|
|
181
181
|
read: process.env.MCP_SCOPE_READ ?? "mcp:read",
|
|
@@ -239,7 +239,8 @@ const writesRaw = (process.env.SODIUM_ENABLE_WRITES ?? "").trim().toLowerCase();
|
|
|
239
239
|
const WRITES_ENABLED = writesRaw === "true" || writesRaw === "1";
|
|
240
240
|
const AUTH = loadAuthConfig();
|
|
241
241
|
const OBO = AUTH ? loadOboConfig(AUTH.issuer) : null;
|
|
242
|
-
const
|
|
242
|
+
const RESOURCE_PATH = AUTH ? new URL(AUTH.resourceUrl).pathname : process.env.MCP_ENDPOINT_PATH ?? "/mcp";
|
|
243
|
+
const ENDPOINT_PATH = RESOURCE_PATH.length > 1 ? RESOURCE_PATH.replace(/\/+$/, "") : RESOURCE_PATH;
|
|
243
244
|
const TELEMETRY_CONFIG = loadTelemetryConfig({
|
|
244
245
|
roleName: "sodium-pm-mcp",
|
|
245
246
|
applicationVersion: VERSION
|