
Connexion avec Replit
Replit — the key in Secrets, and NewAlgorithm queried by the Agent or from code.
Ce contenu est disponible en anglais.
Quel MCP allez-vous connecter ? Les commandes ci-dessous s'adaptent à votre choix.
- 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 formatna_live_xxxxxxxxxxxxxxxxx - 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 nameNA_API_KEY - 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 headerhttps://totvs.mcp.newalgorithm.io/mcp Authorization: Bearer na_live_xxxxxxxxxxxxxxxxx - 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
Confirm
Run the Repl and list the tools. If the five na_* tools come back, the connection is up.
Résultat attendu : 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.
Détails sur l'authentification et les outils dans la Documentation.