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 exposed to the AI — secret values are never sent to the AI client or included in the MCP protocol layer
  • Per-server — secrets on one server are not accessible from another
  • Not version-controlled — they live in the dashboard, not in your code

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 you cannot view the value after saving.

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