Connect Claude Code

Add the EDEXTRON MCP server to Claude Code and keep your AI key out of shared and committed files.

1. Create a key

In the dashboard, open Connect AI, enter a Key name (for example "Claude Code desktop"), choose the Permissions and press Create key. Copy the key (it starts with edx_). It is shown only once.

2. Add the server (user scope)

claude mcp add --transport http --scope user edextron https://mcp.edextron.com/mcp --header "Authorization: Bearer <your-key>"

Replace <your-key> with your key. --scope user makes the server available in all your projects without putting anything in the project folder.

Important: the key is stored in plain text. Claude Code writes the header into its user config file, ~/.claude.json. Anyone who can read that file can use your key. On a shared or lost computer, revoke the key on the Connect AI page.

Never add the server with --scope project while the key is written in the header. Project scope writes a .mcp.json file into your project, and that file is easily committed to Git and pushed for everyone to see.

Option: keep the key in an environment variable

Claude Code can expand environment variables in MCP server settings. Then the config contains only ${EDEXTRON_TOKEN}, not the key. Set EDEXTRON_TOKEN as shown in Connect Codex, step 2, then add the server with single quotes so your shell does not expand the variable:

claude mcp add-json --scope user edextron '{"type":"http","url":"https://mcp.edextron.com/mcp","headers":{"Authorization":"Bearer ${EDEXTRON_TOKEN}"}}'

The same JSON can go into a project .mcp.json file: since it contains only the variable name, the file holds no secret. Each person sets their own EDEXTRON_TOKEN.

3. Check the connection

claude mcp list

Inside Claude Code, /mcp shows the server and its tools. Then ask:

List my EDEXTRON devices.
Turn off "Desk lamp".

Claude Code asks for permission before it uses a tool, unless you have allowed it. Approve set_relay only when you mean it.

For better behaviour, paste the prompt from Prompt for your AI on the Connect AI page as your first message, or put it in CLAUDE.md. It contains no key.

Remove or change the key

claude mcp remove edextron --scope user

Then add it again with the new key. Revoke the old key in the dashboard so it stops working everywhere.

Common problems

Symptom Fix
401 "Invalid or expired API key." Key revoked or mistyped. Create a new one and add the server again
Server listed but no tools Check the URL is exactly https://mcp.edextron.com/mcp and the transport is http
"AI control is disabled for this relay." Turn on Allow AI control for that relay in the dashboard

See also MCP tools reference and Keys and revocation.