feat(mcp-server): add enabledTools allowlist option#1547
Merged
Conversation
Add enabledTools option as an alternative to disabledTools. enabledTools is an allowlist: only listed tools are exposed. New tools released in future versions will NOT be automatically enabled, making it the recommended option for read-only setups. - enabledTools takes priority over disabledTools if both are set - describeCollection is always forced on - Startup logs show which tools are enabled and disabled - Support FOREST_MCP_ENABLED_TOOLS env var for standalone mode - Updated README with both approaches documented Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (3)
🛟 Help
|
BREAKING CHANGE: `disabledTools` option has been removed. Use `enabledTools` instead. This is an allowlist: only listed tools are exposed. New tools in future releases will NOT be auto-enabled. - Remove disabledTools from ForestMCPServerOptions - Remove FOREST_MCP_DISABLED_TOOLS env var - Rename parse-disabled-tools.ts to parse-tool-list.ts - Simplify resolveEnabledTools (no more blocklist path) - Update agent mountAiMcpServer to only accept enabledTools Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix port conflicts using getAvailablePort() - Replace no-op logging test with empty enabledTools edge case test - Verify enabledTools: [] only exposes describeCollection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Warn when describeCollection is missing from enabledTools (auto-added) - Log available tools not enabled for discoverability on new releases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Warn about unknown tool names in enabledTools (typo protection) - Fix test port conflicts by using buildExpressApp + listen instead of run() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
nbouliol
reviewed
Apr 14, 2026
packages/agent/src/agent.ts
Outdated
| * agent.mountAiMcpServer(); | ||
| * // Or with options: | ||
| * agent.mountAiMcpServer({ disabledTools: ['create', 'update', 'delete'] }); | ||
| * // Or with options (read-only mode): |
Member
There was a problem hiding this comment.
this is not read only mode, it only mounts the enabled tools
ac6c301 to
ba59b79
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ba59b79 to
afac92d
Compare
nbouliol
approved these changes
Apr 14, 2026
forest-bot
added a commit
that referenced
this pull request
Apr 14, 2026
# @forestadmin/mcp-server [2.0.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/mcp-server@1.9.1...@forestadmin/mcp-server@2.0.0) (2026-04-14) ### Features * **mcp-server:** add enabledTools allowlist option ([#1547](#1547)) ([fc5127a](fc5127a)) ### BREAKING CHANGES * **mcp-server:** `disabledTools` option has been removed. Use `enabledTools` instead. This is an allowlist: only listed tools are exposed. New tools in future releases will NOT be auto-enabled. - Remove disabledTools from ForestMCPServerOptions - Remove FOREST_MCP_DISABLED_TOOLS env var - Rename parse-disabled-tools.ts to parse-tool-list.ts - Simplify resolveEnabledTools (no more blocklist path) - Update agent mountAiMcpServer to only accept enabledTools Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(mcp-server): fix enabledTools tests and add empty array edge case - Fix port conflicts using getAvailablePort() - Replace no-op logging test with empty enabledTools edge case test - Verify enabledTools: [] only exposes describeCollection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(mcp-server): add warning and discovery logs for enabledTools - Warn when describeCollection is missing from enabledTools (auto-added) - Log available tools not enabled for discoverability on new releases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(mcp-server): validate enabledTools names and fix test port conflicts - Warn about unknown tool names in enabledTools (typo protection) - Fix test port conflicts by using buildExpressApp + listen instead of run() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(example): revert mountAiMcpServer to default (no options) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(mcp-server): clarify read-only is an example of enabledTools usage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
forest-bot
added a commit
that referenced
this pull request
Apr 14, 2026
# @forestadmin/agent [2.0.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.77.1...@forestadmin/agent@2.0.0) (2026-04-14) ### Features * **mcp-server:** add enabledTools allowlist option ([#1547](#1547)) ([fc5127a](fc5127a)) ### BREAKING CHANGES * **mcp-server:** `disabledTools` option has been removed. Use `enabledTools` instead. This is an allowlist: only listed tools are exposed. New tools in future releases will NOT be auto-enabled. - Remove disabledTools from ForestMCPServerOptions - Remove FOREST_MCP_DISABLED_TOOLS env var - Rename parse-disabled-tools.ts to parse-tool-list.ts - Simplify resolveEnabledTools (no more blocklist path) - Update agent mountAiMcpServer to only accept enabledTools Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(mcp-server): fix enabledTools tests and add empty array edge case - Fix port conflicts using getAvailablePort() - Replace no-op logging test with empty enabledTools edge case test - Verify enabledTools: [] only exposes describeCollection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(mcp-server): add warning and discovery logs for enabledTools - Warn when describeCollection is missing from enabledTools (auto-added) - Log available tools not enabled for discoverability on new releases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(mcp-server): validate enabledTools names and fix test port conflicts - Warn about unknown tool names in enabledTools (typo protection) - Fix test port conflicts by using buildExpressApp + listen instead of run() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(example): revert mountAiMcpServer to default (no options) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(mcp-server): clarify read-only is an example of enabledTools usage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> ### Dependencies * **@forestadmin/mcp-server:** upgraded to 2.0.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
enabledToolsoption (allowlist) as an alternative todisabledTools(blocklist)enabledToolsis recommended for read-only setups: new tools in future releases won't be automatically enabledenabledToolstakes priority if both options are set (with a warning)describeCollectionis always forced on regardless of configurationFOREST_MCP_ENABLED_TOOLSenv var for standalone modeTest plan
enabledToolsonly exposes listed tools +describeCollectionviatools/listenabledToolsanddisabledToolsare setdescribeCollectionwarning preserved when passed todisabledToolsdisabledToolstests still passenabledToolsthrough toForestMCPServer🤖 Generated with Claude Code
Note
Replace
disabledToolsdenylist withenabledToolsallowlist in MCP serverdisabledToolsdenylist with anenabledToolsallowlist across the MCP server, CLI, and agent. Tools must now be explicitly listed to be enabled; unlisted tools are not registered.describeCollectionis always included regardless of the allowlist. Unknown tool names are ignored with a warning.FOREST_MCP_ENABLED_TOOLSinstead ofFOREST_MCP_DISABLED_TOOLS.parseDisabledToolsis renamed toparseToolListin parse-tool-list.ts with no behavior change.disabledToolstomountAiMcpServerorFOREST_MCP_DISABLED_TOOLSin the CLI will have no effect; migration to the new allowlist option is required.Macroscope summarized afac92d.