An external MCP server needs an API key. Where does the key go?
Why B is the answer
Databricks Secrets
Keep keys in Secrets, and reference them in the configuration.
In detail
- Secrets keep keys out of code and configuration.
- The app reads the key at run time through a reference.
- Rotate secrets on a schedule.
Use case
An illustrative scenario, not a real incident.
An agent needs a third-party MCP key. It goes in Databricks Secrets, and the configuration references it, so it never appears in code or prompts.
See it in different ways
flowchart TD
A{"Which MCP server?"} -->|"Databricks provides one"| B["Managed"]
A -->|"Third party with an API key"| C["External, key in Databricks Secrets"]
A -->|"Your own logic"| D["Custom"]sequenceDiagram participant A as Agent participant B as Databricks Secrets participant E as External MCP server A->>B: Read the secret reference B-->>A: Key at run time A->>E: Tool call, authenticated
sequenceDiagram participant P0 as Agent participant P1 as Databricks Secrets participant P2 as External server P0->>P1: Read the reference P1-->>P0: Key at run time P0->>P2: Authenticated call
Key point: Keys belong in Secrets.
Why the other options are wrong
- A. A public notebook
- A public notebook exposes the key to everyone.
- C. The app's JavaScript
- JavaScript is visible to users.
- D. A prompt
- Prompts can be logged, and the model can repeat them.

