@anyshift/mcp-proxy 0.6.8 → 0.6.9
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/index.js +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -555,8 +555,21 @@ async function main() {
|
|
|
555
555
|
// ------------------------------------------------------------------------
|
|
556
556
|
// 6. HANDLE TOOL LIST REQUESTS
|
|
557
557
|
// ------------------------------------------------------------------------
|
|
558
|
+
const readOnlyMcp = process.env.READ_ONLY_MCP === 'true';
|
|
558
559
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
559
|
-
|
|
560
|
+
if (!readOnlyMcp) {
|
|
561
|
+
return { tools: allTools };
|
|
562
|
+
}
|
|
563
|
+
// Annotate all tools with readOnlyHint: true to enable parallel tool
|
|
564
|
+
// execution in clients that support it (e.g. Claude Code).
|
|
565
|
+
const annotatedTools = allTools.map(tool => ({
|
|
566
|
+
...tool,
|
|
567
|
+
annotations: {
|
|
568
|
+
...tool.annotations,
|
|
569
|
+
readOnlyHint: true,
|
|
570
|
+
},
|
|
571
|
+
}));
|
|
572
|
+
return { tools: annotatedTools };
|
|
560
573
|
});
|
|
561
574
|
// ------------------------------------------------------------------------
|
|
562
575
|
// 7. HANDLE TOOL CALL REQUESTS (WITH UNIFIED RESPONSE FORMAT)
|