Cannot start MCP: Laravel Boost
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
I'm trying to use Laravel Boost as an MCP server but I get and error initializing the server.
The config I'm using is:
{
"mcpServers": {
"laravel-boost": {
"command": "php",
"args": ["artisan", "boost:mcp"]
}
}
}
I'm using ECA emacs integration and when I start an ECA chat (M-x eca) the MCP server fails to start.
The output from stderr is:
[async-mixed-3] WARN io.modelcontextprotocol.client.McpAsyncClient - Client is not initialized, ignore sending a roots list changed notification
[boundedElastic-2] INFO io.modelcontextprotocol.client.transport.StdioClientTransport - MCP server starting.
[boundedElastic-2] INFO io.modelcontextprotocol.client.transport.StdioClientTransport - MCP server started
[pool-14-thread-1] ERROR io.modelcontextprotocol.spec.McpClientSession - Error handling request: JSONRPCError[code=-32602, message=Invalid params: "id" must be an integer or null if present., data=null]
[MCP] Could not initialize MCP server laravel-boost. Error: Client failed to initialize by explicit API call
[MCP] Started MCP server laravel-boost
:eca/mcp-start-server 899ms
Is this a Laravel Boost specific problem? Is there a way to get a more verbose error message so as to pinpoint what the problem is? Maybe a log of the messages/response between eca and the server?
@gjm there is a high chance to be a problem on the MCP, but I'm trying to run the command but failing to install php artisian, any thoughts on sample projects I can try? via docker it might be even easier
@ericdallo artisan is the CLI interface for Laravel. It comes with every Laravel project and requires no separate installation.
I think the easiest way would be to simply create an empty Laravel project and then install Laravel Boost and try it out.
I have no problems running the MCP server with other tools and it even comes with an inspector that can be used to test the tools.
Thanks, will try that so
@ericdallo please let me know if there is any way I can help.
Maybe tell me what should the initial message/response sequence should be so I can test it out directly on the MCP server...
@gjm I'm facing issues installing lavarel/php artisian in my OS (NixOS), so if you manage to make a containerized script or something would help a lot, I'm trying to install in otherways meanwhile
Ok @gjm, I managed to install and create a minimal project and run in CLI php artisan boost:mcp , will test with ECA
I can repro the issue of Error handling request: JSONRPCError[code=-32602, message=Invalid params: "id" must be an integer or null if present., data=null], will take a closer look if it's ECA's or MCP fault
@gjm spent a good time and could not find the root cause, seems to be mcp-java-sdk's fault, I opened this issue.
My guess is that laravel:boost does something weird during the initialize request of MCP which some clients handle and others not.
@ericdallo thanks for all your work!
Any news on this issue?
Have you pondered using https://github.com/lizqwerscott/mcp.el for MCP integration? It works for gptel.
@gjm No news from upstream, but it's still weird to me, this is the only MCP server I heard it's not working with ECA, which makes me think we could find some hack to make it work for this MCP.
We can't use mcp.el or whatever because ECA server is a JVM/graal compiled native process where clients (Emacs, Vscode etc) integrate with it. But I'm interesting in solving this, just not sure how
@ericdallo thank for your feedback and effort!
@gjm I just bumped mcp-java-sdk to 0.12.0 which improved some logging, maybe you can test again and see if it mentions a missing thing from the mcp server?
@ericdallo Just tried and I get the same error. Upgraded to the latest version of the MCP server to rule out some already fixed issue.
Laravel boost includes an inspector (php artisan mcp:inspector laravel-boost). Maybe you can try using it and see if you can get any additional information.
Here's the stack trace for the error:
[pool-4-thread-1] ERROR io.modelcontextprotocol.spec.McpClientSession - Error handling request: JSONRPCError[code=-32602, message=Invalid params: "id" must be an integer or null if present., data=null]
[MCP] Could not initialize MCP server laravel-boost. #error {
:cause Invalid params: "id" must be an integer or null if present.
:via
[{:type java.lang.RuntimeException
:message Client failed to initialize by explicit API call
:at [io.modelcontextprotocol.client.LifecycleInitializer lambda$withIntitialization$2 LifecycleInitializer.java 292]}
{:type io.modelcontextprotocol.spec.McpError
:message Invalid params: "id" must be an integer or null if present.
:at [io.modelcontextprotocol.spec.McpClientSession lambda$sendRequest$12 McpClientSession.java 265]}]
:trace
[[io.modelcontextprotocol.spec.McpClientSession lambda$sendRequest$12 McpClientSession.java 265]
[reactor.core.publisher.FluxHandle$HandleSubscriber onNext FluxHandle.java 113]
[reactor.core.publisher.SerializedSubscriber onNext SerializedSubscriber.java 99]
[reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber onNext FluxTimeout.java 181]
[reactor.core.publisher.MonoCreate$DefaultMonoSink success MonoCreate.java 176]
[io.modelcontextprotocol.spec.McpClientSession handle McpClientSession.java 155]
[reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber onNext FluxPeekFuseable.java 489]
[reactor.core.publisher.Operators$ScalarSubscription request Operators.java 2571]
[reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber request FluxPeekFuseable.java 437]
[reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber request FluxContextWrite.java 136]
[reactor.core.publisher.FluxFlatMap$FlatMapInner onSubscribe FluxFlatMap.java 968]
[reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber onSubscribe FluxContextWrite.java 101]
[reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber onSubscribe FluxPeekFuseable.java 471]
[reactor.core.publisher.MonoJust subscribe MonoJust.java 55]
[reactor.core.publisher.Mono subscribe Mono.java 4576]
[reactor.core.publisher.FluxFlatMap$FlatMapMain onNext FluxFlatMap.java 430]
[reactor.core.publisher.SinkManyUnicast drainRegular SinkManyUnicast.java 284]
[reactor.core.publisher.SinkManyUnicast drain SinkManyUnicast.java 365]
[reactor.core.publisher.SinkManyUnicast tryEmitNext SinkManyUnicast.java 239]
[reactor.core.publisher.SinkManySerialized tryEmitNext SinkManySerialized.java 100]
[io.modelcontextprotocol.client.transport.StdioClientTransport lambda$startInboundProcessing$6 StdioClientTransport.java 263]
[reactor.core.scheduler.SchedulerTask call SchedulerTask.java 68]
[reactor.core.scheduler.SchedulerTask call SchedulerTask.java 28]
[java.util.concurrent.FutureTask run FutureTask.java 317]
[java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1144]
[java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 642]
[java.lang.Thread runWith Thread.java 1596]
[java.lang.Thread run Thread.java 1583]
[com.oracle.svm.core.thread.PlatformThreads threadStartRoutine PlatformThreads.java 896]
[com.oracle.svm.core.thread.PlatformThreads threadStartRoutine PlatformThreads.java 872]]}
@gjm Good news, I believe I found the issue
I tested the inspector but it didn't mention the exact payload it was sent, but after testing manually the message, I found that the server doesn't support the id as string following the spec:
It does work if I send as a number:
So, not sure there is anything we can do here, the server should support the spec
@ericdallo great at least you've found the issue. Maybe reporting it to laravel boost?
Yes, could you do that please? the issue is that they should accept id field as stringand not only number.
Will close this one as it's not a ECA or upstream issue