@holin-work/holin-cli 1.3.5 → 1.3.6
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/bin/holin-cli.js +11 -3
- package/package.json +1 -1
package/bin/holin-cli.js
CHANGED
|
@@ -218,10 +218,18 @@ function createProxyServer() {
|
|
|
218
218
|
|
|
219
219
|
log(`[proxy] → ${req.method} ${req.url} body=${bodyPreview}`);
|
|
220
220
|
|
|
221
|
-
//
|
|
221
|
+
// OAuth discovery probes — return standard protected-resource metadata
|
|
222
|
+
// so the host knows this MCP server requires authentication even when connected.
|
|
223
|
+
// RFC 9728: /.well-known/oauth-protected-resource must return 200 + JSON describing the auth requirement.
|
|
224
|
+
// Returning 401 here causes some hosts to show "does not require authentication".
|
|
222
225
|
if (req.url.startsWith("/.well-known/")) {
|
|
223
|
-
const body = JSON.stringify({
|
|
224
|
-
|
|
226
|
+
const body = JSON.stringify({
|
|
227
|
+
resource: `http://${PROXY_HOST}:${PROXY_PORT}`,
|
|
228
|
+
authorization_servers: [],
|
|
229
|
+
bearer_methods_supported: ["header"],
|
|
230
|
+
resource_documentation: "https://holin.work/docs/api",
|
|
231
|
+
});
|
|
232
|
+
res.writeHead(200, { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body) });
|
|
225
233
|
res.end(body);
|
|
226
234
|
return;
|
|
227
235
|
}
|