@sodiumhq/mcp-pm 0.1.0-beta.5669 → 0.1.0-beta.5826

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.
Files changed (2) hide show
  1. package/dist/http.js +4 -6
  2. package/package.json +1 -1
package/dist/http.js CHANGED
@@ -197,10 +197,9 @@ function metadataUrl(config) {
197
197
  const suffix = url.pathname === "/" ? "" : url.pathname;
198
198
  return `${url.origin}/.well-known/oauth-protected-resource${suffix}`;
199
199
  }
200
- function buildChallenge(config, scope) {
201
- const parts = [`Bearer resource_metadata="${metadataUrl(config)}"`];
202
- if (scope) parts.push(`scope="${scope}"`);
203
- return parts.join(", ");
200
+ function buildChallenge(config) {
201
+ const scope = `${config.scopes.read} ${config.scopes.write}`;
202
+ return `Bearer resource_metadata="${metadataUrl(config)}", scope="${scope}"`;
204
203
  }
205
204
  const jwksCache = /* @__PURE__ */ new Map();
206
205
  function getJwks(issuer) {
@@ -415,8 +414,7 @@ const httpServer = createServer((req, res) => {
415
414
  console.error(`[sodium-pm-mcp-http] ${req.method} ${req.url} failed: ${message}`);
416
415
  if (res.headersSent) return;
417
416
  if (AUTH && error instanceof AuthError) {
418
- const scope = error.code === "insufficient_scope" ? AUTH.scopes.write : void 0;
419
- res.setHeader("WWW-Authenticate", buildChallenge(AUTH, scope));
417
+ res.setHeader("WWW-Authenticate", buildChallenge(AUTH));
420
418
  sendJsonError(res, error.status, message);
421
419
  return;
422
420
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sodiumhq/mcp-pm",
3
- "version": "0.1.0-beta.5669",
3
+ "version": "0.1.0-beta.5826",
4
4
  "description": "Sodium Practice Management MCP server — lets AI assistants interact with your Sodium tenant",
5
5
  "type": "module",
6
6
  "bin": {