Back to TresekoView full library

Access-controlled MCP

Public guide for connecting an AI to Treseko, discovering its tools and operating with least privilege, auditability and idempotency.

Practical guide

1 guide found

All guides

Access-controlled MCP

Public guide for connecting an AI to Treseko, discovering its tools and operating with least privilege, auditability and idempotency.

Open guide
Reading
7 min
Updated
2026-09-17
Version
1.0.6

When to use this guide

Use it when connecting an MCP-compatible assistant to Treseko QA context with a controlled scope.

Expected result

The AI understands the catalog through discovery, distinguishes visibility from authorization, and executes only what the credential and RBAC allow.

MCP is the governed interface that lets a compatible assistant query and operate on Treseko QA context. Activation is manual from Settings and remains disabled by default until an authorized person enables it.

The AI must not assume which functions exist: it first reads the tool catalog and contracts. A visible catalog does not imply execution authorization; every call re-checks mcp.usar, the credential scope, the functional capability and project or organization access.

The mcp.usar permission controls the entry point: read allows configuration and discovery; edit allows activation and credential management. Administrators receive edit automatically, while other users remain limited by their functional permissions.

The surface covers test execution and control, evidence, result-derived bugs, cases, environments and datasets, and trends/build comparison. Chat, performance/load testing and arbitrary scripts are outside this contract.

MCP credentials are separate from the browser session. Store them in a secret manager and never put them in repositories, prompts, screenshots, tickets or logs. The downloadable file is an instruction template: it contains no credentials and grants no permissions.

Recommended flow

  1. Grant mcp.usar at read or edit level according to the task; the tool must not bypass functional RBAC.
  2. Enable MCP manually from Settings. It does not need to be enabled from deployment configuration.
  3. Create an MCP credential with only scopes the user can use and keep the secret out of source code.
  4. Run discovery before calling: read each tool name, description, parameters, scopes and required level.
  5. Start with a read-only query against an authorized project and retain the returned evidence/correlation_id.
  6. For mutations, request explicit confirmation, use the confirmation required by the tool and always send a unique idempotency_key.
  7. Validate the result in Treseko and review the audit entry. Revoke the credential or disable MCP when it is no longer needed.

Discover tools before execution

curl -sS https://YOUR_TRESEKO/mcp/tools \
   -H "X-MCP-API-Key: ${TRESEKO_MCP_API_KEY}"

JSON-RPC read call

curl -sS https://YOUR_TRESEKO/mcp \
+  -H "Content-Type: application/json" \
+  -H "X-MCP-API-Key: ${TRESEKO_MCP_API_KEY}" \
+  --data @request.json

Safe case update

POST /mcp
method: tools/call
name: treseko.cases.update
confirmation: UPDATE_CASE
idempotency_key: update-case-<unique-id>

# Include complete steps until partial-update behavior is safe.

How to verify

  • Manual activation is persisted in the installation settings and MCP remains deny-by-default.
  • Discovery returns the available catalog without presenting visibility as execution permission.
  • The credential contains only scopes compatible with the user’s functional capabilities.
  • Successful calls are audited with actor, tool and correlation_id.
  • Mutations reject missing or incorrect confirmation and requests without idempotency_key.

Common pitfalls

  • Using a browser JWT instead of an MCP credential.
  • Storing the API key in a versioned file or prompt.
  • Confusing a visible catalog with authorization to execute every tool.
  • Trying to use a tool without its scope or functional capability.
  • Omitting confirmation or idempotency_key from a mutation.
  • Omitting steps from treseko.cases.update: current behavior may replace existing steps with an empty list.
mcpaiapi keyrbacdiscoverysecurity