tiny-http-mcp-server 0.1.5 → 0.1.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/dist/composition.json
CHANGED
|
@@ -40,7 +40,7 @@ export function createProtectedResourceMetadataRouter(options) {
|
|
|
40
40
|
if (path === "/") {
|
|
41
41
|
return [PROTECTED_RESOURCE_METADATA_PATH];
|
|
42
42
|
}
|
|
43
|
-
return [`${PROTECTED_RESOURCE_METADATA_PATH}${path}`];
|
|
43
|
+
return [PROTECTED_RESOURCE_METADATA_PATH, `${PROTECTED_RESOURCE_METADATA_PATH}${path}`];
|
|
44
44
|
})();
|
|
45
45
|
return (req, res, next) => {
|
|
46
46
|
if (req.method !== "GET" || !metadataPaths.includes(req.path)) {
|
package/dist/http-server.js
CHANGED
|
@@ -19,7 +19,7 @@ function getProtectedResourceMetadataPaths(path) {
|
|
|
19
19
|
if (path === "/") {
|
|
20
20
|
return [PROTECTED_RESOURCE_METADATA_PATH];
|
|
21
21
|
}
|
|
22
|
-
return [`${PROTECTED_RESOURCE_METADATA_PATH}${path}`];
|
|
22
|
+
return [PROTECTED_RESOURCE_METADATA_PATH, `${PROTECTED_RESOURCE_METADATA_PATH}${path}`];
|
|
23
23
|
}
|
|
24
24
|
function formatHostnameForUrl(hostname) {
|
|
25
25
|
if (hostname.includes(":") && !hostname.startsWith("[")) {
|
|
@@ -252,6 +252,9 @@ export function createHttpServer(options) {
|
|
|
252
252
|
};
|
|
253
253
|
};
|
|
254
254
|
httpServer.handleRequest = async (req, res) => {
|
|
255
|
+
if (options.requestHandler !== undefined && (await options.requestHandler(req, res))) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
255
258
|
const { baseUrl } = req;
|
|
256
259
|
const protectedResourcePath = typeof baseUrl === "string" && baseUrl.length > 0 ? baseUrl : "/mcp";
|
|
257
260
|
if (!(await authorizeHttpRequest(req, res, protectedResourcePath))) {
|