Skip to content

[docs] Remove config call from app/bootstrap.php #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

barryvdh
Copy link
Contributor

@barryvdh barryvdh commented Jun 9, 2025

I don't think it's safe to call this config() helper inside app/bootstrap.php. It gave me errors at least.

Also, why not add the integrated route to the API middleware by default, instead of web? I think you don't want sessions etc.

@CodeWithKyrian
Copy link
Contributor

Good point on both. Using config() there can be an issue and I'm not sure the providers are booted up to that point. Thanks for flagging that!

As for web vs. api middleware for http_integrated, api middleware definitely makes more sense to avoid web session stuff. The main reason I defaulted to web was for a quick way to grab Laravel's session ID as a default clientId for the SSE connection. It was just a convenience (since if that ID isn't available, it just uses a new UUID).

The next version of the base php-mcp/server package actually overhauls session management completely based on the newer MCP spec(the 2025-03-26 revision), so it won't need Laravel's session for that anymore. Once that's done, I'll fully switch the default middleware for http_integrated to api. That's definitely the cleaner way to go.

@CodeWithKyrian CodeWithKyrian merged commit 8373bbe into php-mcp:main Jun 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants