Skip to content

fix(mcp): filter disabled actions#5168

Merged
kaposke merged 2 commits intomasterfrom
gui/2025-12-17/fix-mcp-filter-disabled-actions
Dec 18, 2025
Merged

fix(mcp): filter disabled actions#5168
kaposke merged 2 commits intomasterfrom
gui/2025-12-17/fix-mcp-filter-disabled-actions

Conversation

@kaposke
Copy link
Contributor

@kaposke kaposke commented Dec 17, 2025

https://nangohq.slack.com/archives/C09TCKP2XFB/p1765916367791799


Filter out disabled MCP actions from tool listings

Updates the MCP server ListTools handler to stop returning disabled actions. The handler now short-circuits within the existing flatMap so that only actions where action.enabled is truthy proceed to actionToTool conversion.

Key Changes

• Short-circuited the actions.flatMap logic in packages/server/lib/controllers/mcp/server.ts to return an empty array when action.enabled is falsy.
• Preserved the existing actionToTool conversion flow for enabled actions.

Affected Areas

packages/server/lib/controllers/mcp/server.ts


This summary was automatically generated by @propel-code-bot

@kaposke kaposke requested a review from a team December 17, 2025 18:39
@my-senior-dev-pr-review
Copy link

my-senior-dev-pr-review bot commented Dec 17, 2025

🤖 My Senior Dev

1 file reviewed • 3 need attention

⚠️ Needs Attention:

  • packages/server/lib/controllers/mcp/server.ts — Changes impact action processing logic requiring attention to correctness and clarity.

View full analysis →


💬 Try: @my-senior-dev explain this change or summon @chaos-monkey 🐵 @security-auditor 🔒 @optimizer ⚡ for different perspectives

📖 All commands & personas

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

.flatMap((action) => {
const tool = actionToTool(action);
return tool ? [tool] : [];
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can avoid the filter and extra iterations.

tools: actions
                .flatMap((action) => {
                    if(!action.enabled) return [];
                    const tool = actionToTool(action);
                    return tool ? [tool] : [];
Comment view
                })

@kaposke kaposke enabled auto-merge December 18, 2025 13:05
@kaposke kaposke added this pull request to the merge queue Dec 18, 2025
Merged via the queue into master with commit f28546d Dec 18, 2025
24 checks passed
@kaposke kaposke deleted the gui/2025-12-17/fix-mcp-filter-disabled-actions branch December 18, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants