Certainly! Here’s how you can connect Laravel/Boost’s MCP server to PhpStorm, and how Ollama fits into the setup:
1. Understanding the Components
- Laravel/Boost MCP Server: This is the server process started by
php artisan boost:mcp(or similar), which listens for IDE connections. - PhpStorm: Needs to be configured to connect to the MCP server for features like code intelligence, AI completions, etc.
- Ollama: This is your local LLM backend. Laravel/Boost will connect to Ollama as needed; PhpStorm does not connect to Ollama directly.
2. Steps to Connect PhpStorm to Laravel/Boost MCP Server
a. Start the MCP Server in Homestead
SSH into your Homestead box and run:
php artisan boost:mcp
By default, this starts the MCP server on 127.0.0.1:8080 inside the VM.
b. Expose the MCP Server to Your Mac
Since Homestead runs in a VM, you need to forward the MCP port (8080) to your Mac. You can do this by editing your Homestead.yaml file:
ports:
- send: 8080
to: 8080
After editing, run vagrant reload to apply changes.
c. Configure PhpStorm to Connect
- In PhpStorm, go to Settings > Tools > Laravel Boost (or similar, depending on the plugin).
- Set the MCP server address to
localhost:8080(since port 8080 is now forwarded from Homestead to your Mac). - Test the connection.
d. Ollama Connection
Laravel/Boost (inside Homestead) should be configured to connect to your Ollama instance. If Ollama is running on your Mac, ensure that the Homestead VM can reach your Mac’s IP and the port Ollama is listening on (default is 11434).
In your .env or Boost config, set:
BOOST_OLLAMA_URL=http://<your-mac-ip>:11434
You may need to allow connections from the VM to your Mac’s Ollama port (check firewall settings).
3. Summary
- PhpStorm connects to the MCP server (in Homestead, port-forwarded).
- Laravel/Boost (in Homestead) connects to Ollama (on your Mac or elsewhere).
- You do not connect PhpStorm directly to Ollama.
Example Workflow:
- Start Ollama on your Mac.
- Start Homestead, ensure port 8080 is forwarded.
- SSH into Homestead, run
php artisan boost:mcp. - Configure Boost to point to Ollama on your Mac.
- In PhpStorm, connect to MCP at
localhost:8080.
Let me know if you need more specifics for any step!