Allow configuring the MCP server route path via settings
## Problem The MCP endpoint path is hardcoded as `/_mcp`. Adopters migrating from an existing MCP endpoint at a different path (e.g. `/mcp`) cannot change it without writing a `RouteSubscriber` to alter `mcp_server.handle`. The leading underscore in `/_mcp` is also a Drupal convention for internal/admin paths, whereas the MCP endpoint is a client-facing API. ## Proposed solution Use a service container parameter `mcp_server.base_path` (defaulting to `/_mcp`), following the same pattern as `jsonapi.base_path` in Drupal core's JSON:API module. A `RouteSubscriber` shipped with the module reads `%mcp_server.base_path%` and sets the path on the `mcp_server.handle` route. Adopters override the parameter in their own `services.yml`: ```yaml parameters: mcp_server.base_path: '/mcp' ``` No config schema, no migration needed. The path is a deployment-time concern, not runtime configuration — identical to how JSON:API exposes `jsonapi.base_path`. ## Alternatives - Store in `mcp_server.settings` config and apply via RouteSubscriber. Rejected: config is for runtime settings; a deploy-time path belongs in the service container. - Document the RouteSubscriber approach as the supported customisation pattern. Lower effort but leaves boilerplate to every adopter. _This issue was identified with the assistance of Claude (Anthropic) while integrating `drupal/mcp_server` into a Drupal distribution._
issue