fix(mcp): add seasons parameter to request_create tool#95
Merged
Conversation
X-Api-Key on the MCP endpoint is for client authentication (checked against --auth-token), not for forwarding the Seerr API key. The Seerr API key is always read from the application config (seerr.api_key). Remove SeerrAPIKeyMiddleware, which incorrectly extracted X-Api-Key from incoming requests and injected it as the Seerr API key. Replace the bearer-only auth middleware with MCPAuthMiddleware, which accepts the configured auth token via Authorization: Bearer, X-Api-Key header, or ?api_key= query parameter (when --allow-api-key-query-param is set). Clients configured with no auth token no longer receive spurious 401s.
Overseerr requires a seasons field for tv requests. The MCP tool was missing this parameter, causing a server-side crash when the API tried to filter an undefined seasons array.
Cover movie requests (no seasons), tv with "all", tv with specific season numbers, and invalid season input producing a tool error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
request_createMCP tool was missing theseasonsparameter, causing a server-side crash when requesting TV media. Overseerr's/api/v1/requestendpoint requires aseasonsfield fortvtype requests, and without it the API tries to.filter()an undefined value.Changes
seasonsstring parameter to therequest_createtool schema with description clarifying it is required for TV and accepts"all"or comma-separated numbers (e.g."1,2,3")RequestCreateHandlerto parse the value and callSetSeasonson the request body, using the same logic already present in the CLIrequest createcommandTest plan
go test -v ./...passesgo fmt ./...produces no diffgo buildsucceedsManual verification:
Checklist
--help, comments)