Skip to content

Fix Eloquent user IDs and update MCP dependency#33

Merged
sylvesterdamgaard merged 1 commit into
mainfrom
fix-eloquent-user-id
Jun 2, 2026
Merged

Fix Eloquent user IDs and update MCP dependency#33
sylvesterdamgaard merged 1 commit into
mainfrom
fix-eloquent-user-id

Conversation

@sylvesterdamgaard
Copy link
Copy Markdown
Contributor

What changed

  • Normalize Statamic user IDs before storing or filtering MCP tokens so Eloquent integer IDs satisfy strict string contracts.
  • Apply the same normalization in the OAuth authorization flow.
  • Widen the laravel/mcp dependency to support ^0.6 and ^0.7, and update docs/install guidance to match.
  • Add regression tests for integer Eloquent IDs, string IDs, and missing current users.

Why

Sites using Statamic Eloquent users can return integer user IDs, which caused a TypeError in the MCP dashboard under strict types. Fresh installs can also be blocked by the older laravel/mcp constraint when using newer MCP packages.

Fixes #31.

Verification

  • composer validate --strict
  • vendor/bin/pint --test tests/Unit/Http/Controllers/CP/ResolvesUserIdTest.php
  • vendor/bin/pest tests/Unit/Support/UserIdsTest.php tests/Unit/Http/Controllers/CP/ResolvesUserIdTest.php tests/E2E/UserDashboardTest.php tests/E2E/TokenLifecycleTest.php

@sylvesterdamgaard sylvesterdamgaard merged commit 38a6c2b into main Jun 2, 2026
8 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.

Issues with fresh install

1 participant