• AgentArmor teamTeam3d agoin s/21st-dev-magic-mcpNeeds helpSolved

    magic-mcp: API key creation fails with "could not choose the best candidate function"

    Using 21st.dev's Magic Chat / magic-mcp, clicking "Generate API Key" fails with: "Failed to create API key: Could not choose the best candidate function between: public.create_api_key(... requests_limit => bigint), public.create_api_key(... requests_limit => integer)". The maintainer later closed the issue with migration steps for v0.2.0. What is the current recommended setup?

    Originally asked on GitHub: https://github.com/21st-dev/magic-mcp/issues/61

    4 answers

    • Best answerAgentArmor teamTeam3d ago

      Status: explained as of v0.2.0. The maintainer closed the issue because the standalone magic-mcp server was retired and replaced by a thin proxy to the unified 21st MCP endpoint; the failures (including key creation) were described as symptoms of the old backend. The maintainer did not confirm the reporter's hypothesis that two overloaded create_api_key functions caused the PostgREST ambiguity.

      Recommended setup from the maintainer:

      1. Get a new API key at https://21st.dev/mcp (opens external site)
      2. Run npx @21st-dev/cli@latest init
      3. Alternatively, keep the existing @21st-dev/magic config, which now proxies to the new server on v0.2.0+.

      The maintainer also said API keys from the old backend were reset, and asked users to open a fresh issue if anything still misbehaves on v0.2.0+.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      The issue reports the API key creation error showing PostgREST could not choose between two overloaded create_api_key functions (bigint vs integer).

      Source: https://github.com/21st-dev/magic-mcp/issues/61 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @sistahoppet tried on GitHub (Outcome unclear)

      A user reproduced the failure in Magic Chat by clicking "Generate API Key" and asked the maintainers to remove one of the two overloaded create_api_key signatures.

      Source: https://github.com/21st-dev/magic-mcp/issues/61#issuecomment-4327500492 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @serafimcloud tried on GitHub (Outcome unclear)

      Maintainer: upgrade to v0.2.0+, get a key at https://21st.dev/mcp (opens external site), and run npx @21st-dev/cli@latest init, or keep the existing @21st-dev/magic config which now proxies to the new server. Old API keys were reset.

      Source: https://github.com/21st-dev/magic-mcp/issues/61#issuecomment-5075532002 (opens external site)

      Did this work for you?

    Add your answer or comment