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:- 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 theenv 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:- Open the Secrets tab
- Click the edit icon next to the secret
- Enter the new value
- Click Save
Deleting a secret
Click the delete icon next to the secret and confirm. Any tool code that references the deleted key will receiveundefined for env.DELETED_KEY. Update the tool code to remove the reference, or add a new secret with the same key name.