@ogygie/mcp 0.10.1 → 0.10.2

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 (3) hide show
  1. package/dist/mcp.js +17 -11
  2. package/dist/server.js +17 -11
  3. package/package.json +2 -2
package/dist/mcp.js CHANGED
@@ -1527,17 +1527,23 @@ async function startHttpTransport(createServerInstance, options) {
1527
1527
  };
1528
1528
  const httpServer = createServer((request, response) => {
1529
1529
  if (!isAuthorized(request.headers.authorization, token, request.url)) {
1530
- refuse(
1531
- response,
1532
- 401,
1533
- ogygieError({
1534
- code: "UNAUTHORIZED",
1535
- message: "This Ogygie MCP server requires a bearer token.",
1536
- file: null,
1537
- cause: "missing or wrong Authorization header",
1538
- suggestedFix: "Send `Authorization: Bearer <OGYGIE_MCP_TOKEN>`."
1539
- })
1540
- );
1530
+ const announcedCredential = request.headers.authorization !== void 0;
1531
+ if (announcedCredential) {
1532
+ refuse(
1533
+ response,
1534
+ 401,
1535
+ ogygieError({
1536
+ code: "UNAUTHORIZED",
1537
+ message: "This Ogygie MCP server refused the credential it was given.",
1538
+ file: null,
1539
+ cause: "the Authorization header does not carry the expected bearer token",
1540
+ suggestedFix: "Send `Authorization: Bearer <OGYGIE_MCP_TOKEN>`, or address the secret path `/mcp-<OGYGIE_MCP_TOKEN>`."
1541
+ })
1542
+ );
1543
+ return;
1544
+ }
1545
+ response.writeHead(404, { "content-type": "application/json" });
1546
+ response.end(JSON.stringify({ error: "not found" }));
1541
1547
  return;
1542
1548
  }
1543
1549
  const chunks = [];
package/dist/server.js CHANGED
@@ -1522,17 +1522,23 @@ async function startHttpTransport(createServerInstance, options) {
1522
1522
  };
1523
1523
  const httpServer = createServer((request, response) => {
1524
1524
  if (!isAuthorized(request.headers.authorization, token, request.url)) {
1525
- refuse(
1526
- response,
1527
- 401,
1528
- ogygieError({
1529
- code: "UNAUTHORIZED",
1530
- message: "This Ogygie MCP server requires a bearer token.",
1531
- file: null,
1532
- cause: "missing or wrong Authorization header",
1533
- suggestedFix: "Send `Authorization: Bearer <OGYGIE_MCP_TOKEN>`."
1534
- })
1535
- );
1525
+ const announcedCredential = request.headers.authorization !== void 0;
1526
+ if (announcedCredential) {
1527
+ refuse(
1528
+ response,
1529
+ 401,
1530
+ ogygieError({
1531
+ code: "UNAUTHORIZED",
1532
+ message: "This Ogygie MCP server refused the credential it was given.",
1533
+ file: null,
1534
+ cause: "the Authorization header does not carry the expected bearer token",
1535
+ suggestedFix: "Send `Authorization: Bearer <OGYGIE_MCP_TOKEN>`, or address the secret path `/mcp-<OGYGIE_MCP_TOKEN>`."
1536
+ })
1537
+ );
1538
+ return;
1539
+ }
1540
+ response.writeHead(404, { "content-type": "application/json" });
1541
+ response.end(JSON.stringify({ error: "not found" }));
1536
1542
  return;
1537
1543
  }
1538
1544
  const chunks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogygie/mcp",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Ogygie MCP server: read-only access to the governance files and features of any Ogygie repo, the manifest as index. Ships built; runnable standalone or through `ogygie mcp`.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "tsx": "^4.20.0",
29
29
  "typescript": "^5.8.0",
30
30
  "vitest": "^3.2.0",
31
- "@ogygie/core": "0.10.1"
31
+ "@ogygie/core": "0.10.2"
32
32
  },
33
33
  "scripts": {
34
34
  "typecheck": "tsc -p tsconfig.json",