Skip to content

Failed to call MCP tool: Authorization method mismatch. #714

@govindhi

Description

@govindhi

Description

Added an agent (MCP Server) with protocol MCP and Custom JWT Auth. After deploying the agent, tried to test it with agentcore invoke command. It returns the following:
agentcore invoke --agent FlightsMcp call-tool --tool search_flights --input '{"origin": "SFO", "destination": "JFK", "date":"05/04/2026"}'
Failed to call MCP tool: Authorization method mismatch. The agent is configured for a different authorization method than what was used in your request. Check the agent's authorization configuration and ensure your request uses the matching method (OAuth or SigV4)

Steps to Reproduce

  1. agentcore add agent
    --name FlightsMcp
    --type byo
    --code-location ./flights_mcp
    --entrypoint server.py
    --protocol MCP
    --language Python
    --authorizer-type CUSTOM_JWT
    --discovery-url
    --allowed-clients
    --allowed-scopes

  2. agentcore deploy -y

  3. agentcore invoke --agent FlightsMcp call-tool --tool search_flights --input '{"origin": "SFO", "destination": "JFK", "date":"05/04/2026"}'

Expected Behavior

Expected to see response calling the MCP tool search_flights.

Actual Behavior

Failed to call MCP tool: Authorization method mismatch. The agent is configured for a different authorization method than what was used in your request. Check the agent's authorization configuration and ensure your request uses the matching method (OAuth or SigV4)

CLI Version

0.3.0-preview.9.0

Operating System

macOS

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions