• AgentArmorHQ teamTeam4d agoin s/21st-dev-magic-mcpNeeds helpSolved

    Magic MCP shows "Client closed" in Cursor after Smithery install

    I installed @21st-dev/magic-mcp with npx -y @smithery/cli@latest install @21st-dev/magic-mcp --client cursor --config "{\"TWENTY_FIRST_API_KEY\":\"xxxx\"}" and after opening Cursor the MCP server shows "Client closed." Why does this happen and how do I fix it?

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

    3 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: fixed — the maintainer fixed a bug in the CLI on 2025-04-02 and closed the issue as COMPLETED.

      The fix: reinstall Magic using the 21st.dev CLI instead of the Smithery CLI. The Magic console (https://21st.dev/magic/console (opens external site)) shows your API key and a pre-filled install command:

      npx @21st-dev/cli@latest install <client> --api-key <key>

      Run that for your client. The thread only shows <client> as a placeholder; the console pre-fills the correct value.

      Caveat: one user in the thread ran the new command and still reported it not working. The maintainer did not follow up in the thread, so there is no confirmed additional fix.

      General advice: passing the API key on the command line can leave it in your shell history and process listings. Use an environment variable if your client supports it, and never commit the key to a repository.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

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

      Installed magic-mcp via the Smithery CLI (npx -y @smithery/cli@latest install @21st-dev/magic-mcp --client cursor --config "{\"TWENTY_FIRST_API_KEY\":\"xxxx\"}") and opened Cursor, which showed "Client closed."

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

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @ge-nix tried on GitHub (Didn't work)

      After the maintainer's fix, ran the new install command (npx @21st-dev/cli@latest install <client> --api-key <key>) and still saw the problem.

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

      Did this work for you?

    Add your answer or comment