Skip to main content

What are secrets?

Secrets are encrypted key-value pairs stored on your MCPCore server. They let you use sensitive credentials in tool code without hardcoding them. Instead of writing:
You store the token as a secret and reference it as:
Secrets are:
  • Encrypted at rest with AES-256
  • Not sent to the AI on their own: MCPCore doesn’t add secret values to MCP messages. A value reaches the AI client only if your tool returns it or includes it in an error
  • Per-server: secrets on one server are not accessible from another
  • Not version-controlled: they live in the dashboard, not in your code
If a tool returns a secret or includes it in an error, the value still goes to the AI client. MCPCore replaces exact secret values of 6 characters or more with [REDACTED] in Traffic Logs and Error Logs. Shorter values, and values your code has encoded or changed, aren’t masked. Return only what the AI needs.

Adding a secret

1

Open the Secrets tab

On the server detail page, click the Secrets tab.
2

Click Add secret

Click Add secret.
3

Enter the key and value

4

Save

Click Save secret. The value is encrypted and stored. You can update or delete the secret later, but the dashboard doesn’t show the value after saving.

Creating a secret from the editor

You don’t have to leave the tool editor to add a missing secret. Secret fields in the Snippets panel and in workflow steps such as Database and HTTP Request offer Create a new secret. The secret is saved to the server and selected in the field right away.

Referencing secrets in code

Access secrets through the env object using the key name you defined:

Naming conventions

MCPCore has no enforced naming convention, but UPPER_SNAKE_CASE is standard and makes secrets easy to distinguish from regular variables:

Updating a secret

To rotate a credential:
  1. Open the Secrets tab
  2. Click the edit icon next to the secret
  3. Enter the new value
  4. Click Save
The new value takes effect immediately, no redeploy needed. Running tool invocations will use the new value on their next execution.

Deleting a secret

Click the delete icon next to the secret and confirm. Any tool code that references the deleted key will receive undefined for env.DELETED_KEY. Update the tool code to remove the reference, or add a new secret with the same key name.

Secret visibility