Skip to content

“Unauthorized. Please check your API key.” regardless of API key validity #716

@evanjcosgrove

Description

@evanjcosgrove

Summary

Repeated resolve-library-id calls to the Context7 MCP server return “Unauthorized. Please check your API key.” even after multiple fresh integrations (Cursor one-click, Claude Code remote, Claude Code local) and regenerating API keys each time.

Steps to Reproduce

  1. Install the Context7 MCP server via any supported method (Cursor one-click, Claude Code remote server, or Claude Code local server).
  2. Configure a newly generated Context7 API key for the code block.
  3. Connect the MCP client (Cursor/Claude Code) to the Context7 server.
  4. Invoke the resolve-library-id tool with any library name, e.g. {"libraryName": "expo 54"}.

Expected Behavior

The call should return a valid library ID (or a not-found response) when a correct API key is provided.

Actual Behavior

Every call fails with Unauthorized. Please check your API key. despite the API key being freshly generated, live, and recognized by the install steps.

Error Log Excerpt (from mcp.log)

[Context7] Message from server: {"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":true}},"serverInfo":{"name":"Context7","version":"1.0.13"},"instructions":"Use this server to retrieve up-to-date documentation and code examples for any library."},"jsonrpc":"2.0","id":0}
2025-09-25T02:50:30.285Z [info] [Context7] Message from client: {"method":"notifications/initialized","jsonrpc":"2.0"}
2025-09-25T02:50:30.285Z [info] [Context7] Message from client: {"method":"tools/list","params":{},"jsonrpc":"2.0","id":1}
2025-09-25T02:50:30.285Z [info] [Context7] Message from client: {"method":"prompts/list","params":{},"jsonrpc":"2.0","id":2}
2025-09-25T02:50:30.285Z [info] [Context7] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":3}
2025-09-25T02:50:30.287Z [info] [Context7] Message from server: {"result":{"tools":[{"name":"resolve-library-id", ... }]}}
2025-09-25T02:50:30.287Z [info] [Context7] Message from server: {"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"Method not found"}}
2025-09-25T02:50:30.287Z [info] [Context7] Message from server: {"jsonrpc":"2.0","id":3,"error":{"code":-32601,"message":"Method not found"}}

Environment

  • Context7 MCP server v1.0.13
  • MCP clients tried: Cursor one-click install, Claude Code remote server, Claude Code local server
  • OS: Linux (Docker Desktop environment), but same issue occurs locally (macOS Tahoe 26.0).
  • API key: newly generated for each attempt (confirmed saved in client config)

Workarounds Attempted

  • Deleted old keys and generated new ones before each install.
  • Reinstalled the MCP server via each method listed above.
  • Restarted clients and reloaded configurations.
  • Verified the API key was being read by each client.
    None of these resolved the authorization failure.

Additional Notes

This issue blocks access to get-library-docs because resolve-library-id must succeed first. Any guidance or a fix would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to context7 APIcritical

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions