Skip to content

boost:install --mcp reports success without installing when the server key appears in a comment #932

Description

@sulimanbenhalim

if laravel-boost appears in a comment inside mcpServers, install does nothing and still reports ✓.

.mcp.json:

{
    "mcpServers": {
        // "laravel-boost": { "command": "php", "args": ["artisan","boost:mcp"] }
    }
}

php artisan boost:install --mcp prints Claude Code.. ✓ and exits 0. file comes back byte identical, nothing registered.

cause: FileWriter::serverExistsInContent() (src/Install/Mcp/FileWriter.php:176) regexes the raw slice between the mcpServers braces, comments included. so filterExistingServers() comes back empty and injectIntoExistingConfigKey() hits the return true at :126.

what does and doesn't trigger it, inside mcpServers:

comment installed
// "laravel-boost": {...} no
// laravel-boost: disabled no
// re-enable laravel-boost later yes

json5 path only. plain json goes through json_decode and is fine, and codex/toml is fine too since that check anchors ^\[. it isn't specific to boost's own key either, I got the same result driving FileWriter directly with a nightwatch key.

commenting a server out and later running install to bring it back seems normal enough, that's where it bit me.

if anyone picks this up, one thing to watch: stripping // before the check would also eat // inside string values like "url": "https://x", which flips it into a duplicate insert instead. needs to be string aware.

happy to PR it, just wasn't sure which way you'd want the check done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions