Skip to content

Compare the remaining MCP methods with the Method enum - #441

Merged
paulocastellano merged 2 commits into
mainfrom
refactor/mcp-method-enum
Oct 21, 2026
Merged

paulocastellano merged 2 commits into
mainfrom
refactor/mcp-method-enum

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

Closes #438.

#437 added App\Enums\Mcp\Method and used it in LoadMcpWorkspace. This moves the three MCP files that still compared the JSON-RPC method as a string:

  • ChallengeChatGptToolCalls: 'tools/call' → Method::ToolsCall->value
  • ChatGptMcpClient::DISCOVERY_METHODS: built from the enum cases' values
  • TryPostServer::boot(): addMethod(Method::ToolsList->value, ...)

The request body is still compared as a raw value (containsStrict), never through tryFrom(), so a non-scalar method keeps getting laravel/mcp's JSON-RPC error instead of a TypeError (.ai/rules/mcp.md). The rule's note pointing at this issue is removed.

Tests

  • php artisan test --compact tests/Feature/Mcp: 553 passed, ChatGptSignInTest unchanged

@paulocastellano
paulocastellano merged commit 28ed431 into main Oct 21, 2026
24 of 28 checks passed
@paulocastellano
paulocastellano deleted the refactor/mcp-method-enum branch October 21, 2026 15:51
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.

Use App\Enums\Mcp\Method for the remaining MCP method strings

1 participant