Skip to content

Conditionally render MCP guideline sections#722

Merged
pushpak1300 merged 3 commits intolaravel:mainfrom
Xiol:721-mcp-tool-info-conditional
Apr 1, 2026
Merged

Conditionally render MCP guideline sections#722
pushpak1300 merged 3 commits intolaravel:mainfrom
Xiol:721-mcp-tool-info-conditional

Conversation

@Xiol
Copy link
Copy Markdown
Contributor

@Xiol Xiol commented Mar 26, 2026

Before this change, the Tools and Searching Documentation sections were always emitted into the generated AI guidelines, even when users chose not to enable MCP during installation. This meant AI agents were instructed to use database-query, search-docs, and other MCP tools that simply weren't available in their environment, leading to failed tool calls or confusing behaviour.

After this change, those sections are only included when MCP was actually selected at install time. Users who run a guidelines-only setup get a leaner, accurate guideline file that reflects their actual configuration.

Closes #721.

@Xiol Xiol force-pushed the 721-mcp-tool-info-conditional branch from 083a46f to 27c5167 Compare March 26, 2026 17:17
Copy link
Copy Markdown
Member

@pushpak1300 pushpak1300 left a comment

Choose a reason for hiding this comment

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

Hey! Nice PR, clean and follows the existing patterns well.

One thing I noticed, when boost:update regenerates guidelines, it calls InstallCommand with --guidelines and --skills but never passes --mcp. Since selectBoostFeatures() only returns explicitly passed flags, hasMcp will always be false during updates. This means existing MCP users who run boost:update would silently lose the ## Tools and ## Searching Documentation sections even though their MCP server is still configured.

@pushpak1300 pushpak1300 marked this pull request as draft March 28, 2026 07:59
@Xiol Xiol force-pushed the 721-mcp-tool-info-conditional branch from 27c5167 to 262d8d8 Compare March 28, 2026 10:19
@Xiol
Copy link
Copy Markdown
Contributor Author

Xiol commented Mar 28, 2026

Thanks for your review, good catch there! I'm now passing the --mcp flag from UpdateCommand to InstallCommand during boost:update, so the MCP sections are retained.

@pushpak1300
Copy link
Copy Markdown
Member

But MCP config once published isn't supposed to change. it will be kind of breaking change,

@Xiol Xiol force-pushed the 721-mcp-tool-info-conditional branch from 262d8d8 to c18b942 Compare March 28, 2026 22:32
@Xiol Xiol force-pushed the 721-mcp-tool-info-conditional branch from c18b942 to b409692 Compare March 28, 2026 22:40
@Xiol
Copy link
Copy Markdown
Contributor Author

Xiol commented Mar 28, 2026

How about this? I've updated buildGuidelineConfig() to fall back to the stored config value when MCP isn't in the selected features. This way the guideline sections are preserved during updates without re-triggering MCP installation.

@pushpak1300 pushpak1300 self-assigned this Apr 1, 2026
@pushpak1300 pushpak1300 marked this pull request as ready for review April 1, 2026 07:15
@pushpak1300 pushpak1300 merged commit dc958ea into laravel:main Apr 1, 2026
21 checks passed
@Xiol Xiol deleted the 721-mcp-tool-info-conditional branch April 1, 2026 08:58
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.

MCP references exist when MCP server is not installed

2 participants