← All connections

Connect to Replit

Replit — the key in Secrets, and NewAlgorithm queried by the Agent or from code.

Before you start, create your free account.Create account

Which MCP will you connect? The commands below change according to your choice.

  1. 1

    Generate your API key

    Sign in to app.newalgorithm.io with your account, open Keys & apps and generate a key. It is shown only once: copy it and store it somewhere safe.

    Key format
    na_live_xxxxxxxxxxxxxxxxx
  2. 2

    Store the key in Secrets

    In the Repl, open Tools → Secrets and create NA_API_KEY with the key as its value. Secrets are available as server-side environment variables and don't appear in the code.

    Secret name
    NA_API_KEY
  3. 3

    Connect through the Agent, if your account offers MCP

    In the Replit Agent integrations, add a custom MCP server with the URL and the authorization header:

    URL and header
    https://totvs.mcp.newalgorithm.io/mcp
    Authorization: Bearer na_live_xxxxxxxxxxxxxxxxx
  4. 4

    Or consume it directly from code

    Install the official MCP SDK in the Repl and read the key from the secret — never write the key in the file:

    npm install @modelcontextprotocol/sdk
  5. 5

    Confirm

    Run the Repl and list the tools. If the five na_* tools come back, the connection is up.

    Expected: na_prepare, na_search, na_route, na_specialists, na_version

Public Repls expose the code, but not the Secrets. Even so, keep the call to NewAlgorithm on the server: any key that reaches the browser is a leaked key.

Authentication and tool details in the Docs.