Skip to content

fix(mcp): add seasons parameter to request_create tool#95

Merged
electather merged 3 commits into
mainfrom
fix/mcp-request-create-seasons
Mar 29, 2026
Merged

fix(mcp): add seasons parameter to request_create tool#95
electather merged 3 commits into
mainfrom
fix/mcp-request-create-seasons

Conversation

@electather
Copy link
Copy Markdown
Owner

@electather electather commented Mar 29, 2026

Summary

The request_create MCP tool was missing the seasons parameter, causing a server-side crash when requesting TV media. Overseerr's /api/v1/request endpoint requires a seasons field for tv type requests, and without it the API tries to .filter() an undefined value.

Changes

  • Added seasons string parameter to the request_create tool schema with description clarifying it is required for TV and accepts "all" or comma-separated numbers (e.g. "1,2,3")
  • Updated RequestCreateHandler to parse the value and call SetSeasons on the request body, using the same logic already present in the CLI request create command

Test plan

  • go test -v ./... passes
  • go fmt ./... produces no diff
  • go build succeeds

Manual verification:

# TV request with specific seasons
request_create mediaType=tv mediaId=<tmdb_id> seasons="1,2"

# TV request for all seasons
request_create mediaType=tv mediaId=<tmdb_id> seasons="all"

# Movie request (seasons omitted — unchanged behaviour)
request_create mediaType=movie mediaId=<tmdb_id>

Checklist

  • New tests added for new behaviour
  • Documentation updated (README, command --help, comments)
  • No unrelated changes included

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.
@electather electather merged commit 12819e4 into main Mar 29, 2026
2 checks passed
@electather electather deleted the fix/mcp-request-create-seasons branch March 29, 2026 11:30
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.

1 participant