mcp icon indicating copy to clipboard operation
mcp copied to clipboard

MCP Inspector Connection Issues with Claude Desktop

Open bloodykheeng opened this issue 1 month ago • 5 comments

Laravel Package Version

"laravel/mcp": "^0.3.4"

Laravel Version

"laravel/framework": "^12.0",

PHP Version

PHP 8.4.5 (cli) (built: Mar 12 2025 12:17:53) (NTS Visual C++ 2022 x64)

Database Driver & Version

No response

Description

I'm experiencing connection issues when trying to integrate my Laravel MCP server with Claude Desktop. The inspector UI works but Claude Desktop fails to connect using the generated configurations. Environment

Steps To Reproduce

  1. Created a custom MCP server named "documents"
  2. Ran php artisan mcp:inspector documents
  3. Inspector UI spins up in browser successfully
  4. Attempted to connect via the inspector UI - Connection fails
  5. Copied the generated STDIO configuration to Claude Desktop's claude_desktop_config.json
  6. Claude Desktop fails to connect with repeated error messages

Configuration Attempted

STDIO Configuration (from inspector)

{
    "mcpServers": {
        "default-server": {
            "command": "C:\\laragon\\bin\\php\\php-8.4.5-nts-Win32-vs17-x64\\php.exe",
            "args": [
                "D:\\coding\\bloodykheeng",
                "projects\\laravel-ai\\laravel",
                "with",
                "ollama\\docs-injestion\\artisan",
                "mcp:start",
                "documents"
            ],
            "env": {
                "APPDATA": "C:\\Users\\bk\\AppData\\Roaming",
                "HOMEDRIVE": "C:",
                "HOMEPATH": "\\Users\\bk",
                "LOCALAPPDATA": "C:\\Users\\bk\\AppData\\Local",
                "PATH": "...",
                "PROCESSOR_ARCHITECTURE": "AMD64",
                "SYSTEMDRIVE": "C:",
                "SYSTEMROOT": "C:\\WINDOWS",
                "TEMP": "C:\\Users\\bk\\AppData\\Local\\Temp",
                "USERNAME": "bk",
                "USERPROFILE": "C:\\Users\\bk",
                "PROGRAMFILES": "C:\\Program Files"
            }
        }
    }
}

Error Messages

In the terminal, I see repeated messages:

Received POST message for sessionId c9756efb-cbf2-4aed-b314-be2484520569
New STDIO connection request
Query parameters: {"command":"C:\\laragon\\bin\\php\\php-8.4.5-nts-Win32-vs17-x64\\php.exe","args":"D:\\coding\\bloodykheeng projects\\laravel-ai\\laravel with ollama\\docs-injestion\\artisan mcp:start documents","env":"{\"APPDATA\":\"C:\\\\Users\\\\bk\\\\AppData\\\\Roaming\",\"HOMEDRIVE\":\"C:\",\"HOMEPATH\":\"\\\\Users\\\\bk\",\"LOCALAPPDATA\":\"C:\\\\Users\\\\bk\\\\AppData\\\\Local\",\"PATH\":\"C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\npm-cache\\\\_npx\\\\5a9d879542beca3a\\\\node_modules\\\\.bin;D:\\\\coding\\\\bloodykheeng projects\\\\laravel-ai\\\\laravel with ollama\\\\docs-injestion\\\\node_modules\\\\.bin;D:\\\\coding\\\\bloodykheeng projects\\\\laravel-ai\\\\laravel with ollama\\\\node_modules\\\\.bin;D:\\\\coding\\\\bloodykheeng projects\\\\laravel-ai\\\\node_modules\\\\.bin;D:\\\\coding\\\\bloodykheeng projects\\\\node_modules\\\\.bin;D:\\\\coding\\\\node_modules\\\\.bin;D:\\\\node_modules\\\\.bin;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\nvm\\\\v22.19.0\\\\node_modules\\\\npm\\\\node_modules\\\\@npmcli\\\\run-script\\\\lib\\\\node-gyp-bin;c:\\\\Users\\\\bk\\\\AppData\\\\Roaming\\\\Code\\\\User\\\\globalStorage\\\\github.copilot-chat\\\\debugCommand;c:\\\\Users\\\\bk\\\\AppData\\\\Roaming\\\\Code\\\\User\\\\globalStorage\\\\github.copilot-chat\\\\copilotCli;C:\\\\Program Files\\\\ImageMagick-7.1.2-Q16-HDRI;C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\redist\\\\intel64\\\\compiler;C:\\\\WINDOWS\\\\system32;C:\\\\WINDOWS;C:\\\\WINDOWS\\\\System32\\\\Wbem;C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C:\\\\WINDOWS\\\\System32\\\\OpenSSH\\\\;C:\\\\Program Files\\\\Git\\\\cmd;C:\\\\laragon\\\\bin\\\\php\\\\php-8.4.5-nts-Win32-vs17-x64;C:\\\\scrcpy-win64-v3.3.1;C:\\\\ProgramData\\\\ComposerSetup\\\\bin;C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\Windows Performance Toolkit\\\\;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\nvm;C:\\\\nvm4w\\\\nodejs;C:\\\\Program Files\\\\dotnet\\\\;C:\\\\ProgramData\\\\chocolatey\\\\bin;C:\\\\Program Files\\\\gs\\\\gs10.06.0\\\\bin;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python313\\\\Scripts\\\\;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python313\\\\;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\bin;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\GitHubDesktop\\\\bin;C:\\\\Users\\\\bk\\\\AppData\\\\Roaming\\\\Composer\\\\vendor\\\\bin;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\nvm;C:\\\\nvm4w\\\\nodejs;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\PowerToys\\\\DSCModules\\\\;C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\Programs\\\\Ollama;C:\\\\Program Files\\\\Tesseract-OCR\",\"PROCESSOR_ARCHITECTURE\":\"AMD64\",\"SYSTEMDRIVE\":\"C:\",\"SYSTEMROOT\":\"C:\\\\WINDOWS\",\"TEMP\":\"C:\\\\Users\\\\bk\\\\AppData\\\\Local\\\\Temp\",\"USERNAME\":\"bk\",\"USERPROFILE\":\"C:\\\\Users\\\\bk\",\"PROGRAMFILES\":\"C:\\\\Program Files\"}","transportType":"stdio"}
STDIO transport: command=C:\laragon\bin\php\php-8.4.5-nts-Win32-vs17-x64\php.exe, args=D:codingbloodykheeng,projectslaravel-ailaravel,with,ollamadocs-injestionartisan,mcp:start,documents
Created client transport
Created server transport

The connection attempts keep repeating but never succeed.

Observation: Streamable HTTP Works Partially

When I run:

php artisan mcp:inspector mcp/documents

The inspector UI connects successfully in the browser. However, the generated configuration for Claude Desktop doesn't work:

{
    "mcpServers": {
        "default-server": {
            "type": "streamable-http",
            "url": "http://localhost:8000/mcp/documents",
            "note": "For Streamable HTTP connections, add this URL directly in your MCP Client"
        }
    }
}

Issues Identified

  1. STDIO args parsing issue: The args array appears to be splitting the path incorrectly:

    • Generated: ["D:\\coding\\bloodykheeng", "projects\\laravel-ai\\laravel", "with", "ollama\\docs-injestion\\artisan", ...]
    • Should be: ["D:\\coding\\bloodykheeng projects\\laravel-ai\\laravel with ollama\\docs-injestion\\artisan", "mcp:start", "documents"]
  2. Path with spaces handling: My project path contains spaces which may be causing parsing issues

  3. Inspector UI connection: When using php artisan mcp:inspector documents (without route), the inspector UI fails to connect

  4. Streamable HTTP configuration: While the inspector connects with the route-based command, Claude Desktop doesn't accept the streamable-http configuration

Questions

  1. Does the STDIO transport properly handle Windows paths with spaces?
  2. Is the streamable-http transport type supported by Claude Desktop?
  3. Should the args array contain the full artisan path as a single element or split as shown?
  4. Is there a recommended configuration format for Windows + Laragon setups?

Expected Behavior

  • Inspector UI should connect successfully with both command variants
  • Generated STDIO configuration should work with Claude Desktop
  • Proper handling of Windows paths containing spaces

bloodykheeng avatar Dec 01 '25 18:12 bloodykheeng

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

github-actions[bot] avatar Dec 01 '25 18:12 github-actions[bot]

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

pushpak1300 avatar Dec 01 '25 18:12 pushpak1300

@pushpak1300 I think creating a new laravel project is a longer process for me but here is my project already its public u can checkit out

https://github.com/bloodykheeng/laravel-ai-docs-injestion-and-ai-chat

project link

bloodykheeng avatar Dec 01 '25 18:12 bloodykheeng

Claude Desktop only works with streamable transport if you have Claude Pro plan or higher.

With free version you would have to use some wrapper such as mcp-remote npx package.

For the issue I would also advise to test with mcp inspector launched manually first to be sure it is related to the mcp package itself.

alankpax avatar Dec 02 '25 08:12 alankpax

@alankpax yah your right when i serve my app with ngrok and i get the web mcp url with https and i add it under claude desktop connectors claude can see my tools in that mcp

but your forgetting claude desktop also offers an option of local mcp its in settings -> developer so there u can add a config

but when i add the config mcp inspector gives me it fails even when i spin the inspector for the local mcp it spins up in the web but it cant connect only i see erros in terminal

anyway i managed to add my web mcp to claude code using this command event hough i wasnt on https

claude mcp add -s user -t http 'docs-injest-documents-mcp' 'http://localhost:8000/mcp/documents'

but still i need help on why the local mcp fails to work and spin up when i load its inspector and why the inspector config provided dosnt work too

bloodykheeng avatar Dec 02 '25 09:12 bloodykheeng