Use the Agents API with MCP Vault when you want reusable agents that can call tools from an external MCP server. The vault keeps MCP server configuration and credentials outside the agent definition, so your app can rotate credentials without editing every agent. API Reference:Documentation Index
Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Register the MCP server
Create the MCP server once for the integration you want the agent to use. Useallowed_tools to expose only the tools the agent needs.
Use require_approval when your product should ask the end user before the MCP tool runs.
mcp_srv_....
Use that ID in agent tool definitions.
See the Create MCP server API reference for the complete schema.
2. Store the MCP credential
Create a credential under the MCP server. The credential can use a bearer token, an authorization header value, custom headers, or no auth. Store end-user credentials withX-On-Behalf-Of so each end user gets isolated access.
mcp_cred_....
Secret values are stored by the vault and are not returned in later list responses.
Use List MCP credentials when your app needs to show saved credential metadata.
3. Test the server
Test the server before you attach it to an agent. This catches bad URLs and tool discovery problems early. The response reports whether the server connected and which tools were discovered.4. Create the agent
Add an MCP tool to the agent withtype: "mcp".
Reference the vault records with mcp_server_id and mcp_credential_id.
You can narrow the agent’s access further with allowed_tools on the tool definition.
5. Run the agent
Run the saved agent with the task-specific input. The agent reuses the saved MCP configuration and credential reference.Operational notes
- Keep server-level
allowed_toolsbroad enough for the integration and tool-levelallowed_toolsas narrow as the agent’s job allows. - Prefer
require_approval: "always"for tools that mutate external systems. - Rotate a credential by creating a new MCP credential and updating the agent’s MCP tool to reference the new
mcp_credential_id. - Delete credentials with the Delete MCP credential endpoint when an end user disconnects an integration.