Connect an agent

In this guide

To find active licences in a test organisation, give the agent a key limited to reading. MCP, CLI and direct HTTP calls all use the management API’s permissions.

Client applications use an installation identity and pinned product keys. Integrate the client SDKs.

Prepare test access

In the console, select your organisation and the Test environment. Under Settings → API keys, create a key for this agent with only the read permission. Save the key in a keychain or secrets manager when it is displayed. Pass it to your tool through its secret configuration. The key determines both the organisation and the environment.

The write permissions are licences, catalog, files and customers. The admin permission includes all rights. Some organisation-wide operations also require a Live admin key. Check “Who may call” for the specific operation.

Call the MCP server

Configure a streamable HTTP transport to https://keyseal.io/mcp. Supply the Authorization: Bearer <API_KEY> header from the client’s secrets manager. The server accepts Keyseal API keys only. Add Keyseal-Read-Only: true to refuse writes on this connection.

Read the keyseal://guide resource, then call licences_list with the following arguments. The result contains up to ten active licences in scope, newest first. Pass next_cursor as the next cursor to continue.

{"state":"active","limit":10}

For writes with a Live key, the user confirms the specific change before the agent passes confirm_live: true. Retry a write that supports idempotency with the same idempotency_key. Creating an API key, creating a webhook endpoint and rotating its secret each return a secret once and refuse this option.

Run the same search from a terminal

If you have the CLI source, install from its root with uv tool install ./clients/cli. An existing KEYSEAL_API_KEY takes precedence over --profile. In a sh-compatible terminal, the following function removes that variable and KEYSEAL_URL from the environment of each command. Enter the test key at the masked login prompt.

keyseal_test() {
  env -u KEYSEAL_API_KEY -u KEYSEAL_URL keyseal --profile sandbox "$@"
}
keyseal_test login --url https://keyseal.io
keyseal_test whoami

Check that whoami shows the expected organisation, environment test, profile sandbox and server https://keyseal.io. If a value differs, correct the profile and repeat whoami. Once all four match, run the search in the same terminal.

keyseal_test licences list --state active --limit 10 --json

Use --help on a named command to see its arguments. Where the reference lists keyseal api, supply the method and path, for example keyseal_test api GET /events in this terminal.

The three operations that require a person signed in to the console appear as “Console only” in the reference. To generate a client or brief an agent, use the OpenAPI contract, the agent index or the full-text guides.

All guides