Skip to content

HTTP 405 Method Not Allowed Error When Connecting to Laravel MCP Server #22

@clablancherie-exo

Description

@clablancherie-exo

Laravel Package Version

0.1.1

Laravel Version

12.11.1

PHP Version

8.3.24

Database Driver & Version

HTTP 405 Method Not Allowed Error When Connecting to Laravel MCP Server

Description

I'm encountering a persistent HTTP 405 error when trying to connect to my Laravel MCP server, even when explicitly using POST requests. The error message suggests a mismatch between the expected and actual HTTP methods.

Error Details

Error from MCP server: Error: Error POSTing to endpoint (HTTP 405): {
    "message": "The GET method is not supported for route mcp/demo. Supported methods: POST.",
    "exception": "Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException",
    "file": "/path/to/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php",
    "line": 123,
}

Steps To Reproduce

  1. Set up a Laravel MCP server with a POST route defined as: Route::post('/mcp/demo', [Controller::class, 'method']);
  2. Attempt to connect using the MCP client
  3. Alternatively, test directly with Postman using an explicit POST request
  4. Receive the same 405 error in both cases

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions