You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**`showOnMcp($callback = true)`** - Control whether the field should be visible in MCP requests
435
+
-**`hideFromMcp($callback = true)`** - Hide the field from MCP requests (inverse of showOnMcp)
436
+
437
+
Both methods accept either a boolean value or a callback function that receives the request and repository as parameters.
438
+
439
+
<alerttype="info">
440
+
MCP visibility rules take precedence over regular `showOnIndex`/`showOnShow` rules when processing MCP requests. Fields are visible in MCP by default unless explicitly hidden.
441
+
</alert>
442
+
443
+
#### How It Works
444
+
445
+
The MCP visibility system automatically detects when a request is coming from an MCP tool and applies the appropriate visibility rules:
446
+
447
+
1.**Regular API requests** use `showOnIndex()` and `showOnShow()` rules
448
+
2.**MCP requests** use `showOnMcp()` and `hideFromMcp()` rules
449
+
3.**Default behavior** - fields are visible in MCP unless explicitly hidden
450
+
451
+
This allows you to have different field visibility for your regular API consumers versus AI agents accessing your data through MCP tools.
0 commit comments