Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Add an MCP server from a README or setup page

For anyone who found an MCP server whose README or setup page shows a config snippet to copy, often with a token or API key already in it. At the end, the server is in Surjection's store and enabled for the clients you pick, and the token is in your OS keyring instead of any config file.

Before you start

  • Surjection is installed (Install and bring in your existing setup).
  • Copy the snippet from the setup page. Any client's format works: a JSON block with mcpServers (Claude Code, Cursor, omp), VS Code's servers, or a Codex TOML table. If the page offers a "copy" button, use it.
  • If the page shows the token only once, keep it on the clipboard or in your password manager until you have saved the server.

Steps

  1. Open MCP in the sidebar and choose Add server in the toolbar (or press Ctrl+N). On the MCP page, Ctrl+V outside a text field opens the dialog with the clipboard already pasted.

    The MCP page with its server cards; Add server is highlighted in the toolbar.

  2. Paste the snippet into Paste a server URL, a config snippet, or a command. The dialog says what it found ("Detected: Config snippet"). Choose Continue (or press Enter). A snippet with several servers lists them; choose Use on the one you want.

    The Add MCP server dialog with a JSON snippet pasted, Detected: Config snippet, the links Local command, From Git or folder, Browse catalogs and Import from your clients, and Continue highlighted.

    If one of your clients already has this server, the dialog says so and offers Import instead, which keeps that client's settings and secrets.

  3. Decide where the token goes. The dialog shows where the snippet came from, for example "Filled in from n8n-mcp (Claude Code).". A value that may be a secret (an Authorization header, a token in env, an --api-key argument, a key in the URL) is replaced in the form by a reference such as Bearer ${secret:N8N_MCP_AUTHORIZATION}, and listed with a destination:

    • OS keyring (the default): the value goes to the keyring when you save and is never shown again.
    • 1Password reference: an op://vault/item/field reference to an item you keep in 1Password.
    • Environment variable: the name of a variable you set yourself.
    • Leave empty for now: set the value later in Settings > Secrets.

    You can change the alias name next to the field. An obvious placeholder such as YOUR_TOKEN is not treated as a secret: it becomes an alias without a value. The pasted text itself is not kept once it is converted.

    The review state after pasting: Filled in from n8n-mcp (Claude Code), Name and ID, Streamable HTTP with the URL, headers.Authorization with the alias N8N_MCP_AUTHORIZATION going to the OS keyring, and Sign-in set to Needs a token.

  4. Check the rest and pick clients. Name and ID come from the snippet's name. Sign-in is Needs a token, with the header holding the reference. Under Enable in clients, the installed clients that can run this transport are already on; turn clients on or off, or choose All detected clients. Clients that are not installed, or that have no MCP config here, are behind Show N more. Description, secret delivery and tool filters are under More options, with Preview client entries to see what each client file gets.

    The same dialog further down: Enable in clients with the installed clients turned on, More options, and the Add server button highlighted.

  5. Choose Add server (or press Ctrl+Enter). If a field needs a fix, the problem shows under the field and in a summary next to the button ("1 problem: ID"), and focus moves to the first one. In the default instant mode the change is applied at once: each client file is backed up, then written, and a notification says "Added n8n-mcp. Enabled in ..." with View, which shows the server's card.

  6. Restart the clients that were open, so they load the new server.

How the token reaches the server depends on the client: Surjection picks a delivery that never writes the value into a client file (for example a command the client runs at connect time, or surject exec). Secret delivery under More options overrides it; see user guide, Secrets.

On the command line

Put the token in the keyring first (piped on stdin, so it stays out of your shell history), then add the server with a reference to it:

# PowerShell 7
Read-Host -MaskInput | surject secrets set N8N_MCP_AUTHORIZATION --keyring
surject server add n8n-mcp --url https://n8n.example.test/mcp-server/http --header 'Authorization=Bearer ${secret:N8N_MCP_AUTHORIZATION}'
# bash or zsh
read -rs VALUE && printf %s "$VALUE" | surject secrets set N8N_MCP_AUTHORIZATION --keyring; unset VALUE
surject server add n8n-mcp --url https://n8n.example.test/mcp-server/http \
  --header 'Authorization=Bearer ${secret:N8N_MCP_AUTHORIZATION}'

Use single quotes so the shell leaves ${...} alone. A literal token on the command line is refused (leak_detected). Without --client, the server is enabled for the detected clients that can run it; pass --client omp --client codex (repeatable) to choose, or --no-clients to only define it. For a stdio server, use --env 'NAME=${secret:ALIAS}' and put the command after --.

Check that it worked

  • The notification says the server was added, and View shows its card on the MCP page with a pill for each client.
  • surject secrets check reports the alias as resolved; surject status shows the entries as in sync.
  • In the client, open its MCP view and check that the server connects.

Undo

History, select the apply, Undo this apply (surject rollback last). To remove the server later, use the trash button on its card, or surject server rm n8n-mcp. The keyring entry stays until you run surject secrets clear N8N_MCP_AUTHORIZATION.

More detail