Per-Token Tool Filtering
By default, an MCP token sees every tool its permissions allow — that can be 90+ tools and a large tools/list payload. Tool filtering lets you restrict a token to a specific subset of tools.
How it works
- Pass a
toolFiltersarray at token creation. - Stored in the
tool_filtersJSONB column onmcp_tokens. resolveMcpToken()loads the array per request.buildMcpServer()overridesserver.tool()so only allow-listed tools are registered — filtered-out tools do not appear intools/list.
Example: single-purpose token
curl -X POST https://anymrkt.com/api/mcp/tokens \\
-H "Authorization: Bearer PLACEHOLDER" \\
-H "Content-Type: application/json" \\
-d '{
"brandIds": ["brand-uuid"],
"label": "builder-only",
"permissions": ["content"],
"toolFilters": ["builder_patch_page", "builder_publish_page"]
}'Filtering vs. permissions
| Feature | Tool filtering | Permissions |
|---|---|---|
| Scope | Which tools appear in tools/list | What each tool is allowed to do |
| Stored as | tool_filters JSONB array | permissions enum array |
| Granularity | Per-tool-name | Per-product-scope |
Tool filtering is an allow-list; permissions are a scope. A tool must pass both checks to be callable.