---
name: treseko-mcp
description: Use when an AI assistant needs to discover or operate Treseko through access-controlled MCP. Follow discovery, least privilege, confirmation and idempotency rules.
---

# Treseko MCP skill

This file is a reusable instruction template for an AI assistant connecting to a Treseko installation through its access-controlled MCP interface. It contains no API key, password, token, connection string or project data.

## Operating contract

1. Ask the user to confirm the Treseko base URL and the intended project or organization scope.
2. Use an MCP credential supplied through the client secret manager. Never request, print, store or repeat its value in chat, prompts, source code, screenshots or logs.
3. Discover before calling. Read the available tools, descriptions, input schemas, required scopes and required permission level from the installation's MCP discovery endpoint.
4. Treat a visible tool as discoverable, not automatically executable. Every call must satisfy `mcp.usar`, the credential scope, the functional RBAC capability and project/organization access.
5. Prefer read operations first. Explain what a mutation will change before requesting confirmation.
6. For every mutation, send the exact confirmation required by the tool and a unique `idempotency_key`. Never invent a confirmation value.
7. Validate the response in Treseko and report the returned identifiers, status and audit/correlation information without exposing secrets.

## Permission model

- `mcp.usar: read`: inspect MCP configuration and discover tools.
- `mcp.usar: edit`: activate/deactivate MCP and manage MCP credentials.
- Administrators receive `mcp.usar: edit` automatically.
- Non-administrators remain constrained by their functional permissions. `mcp.usar` alone does not grant access to projects, cases, executions or bugs.
- A credential must use only scopes allowed by the user. A `none` scope means the current identity cannot use that scope.

## Supported functional areas

The governed catalog covers test execution and control, detailed evidence, bugs derived from results, individual test cases, environments and datasets, and trends/build comparison. Chat, performance/load testing, arbitrary scripts and capabilities without a real executor are outside this contract.

## Safe workflow

1. Obtain authorized access through the administrator or the user's Treseko Settings page.
2. Enable MCP manually from Settings when the user has the required permission. Do not assume deployment configuration enables it.
3. Create a least-privilege MCP credential and store it in a secret manager.
4. Run discovery and select a tool whose scope and functional capability are both available.
5. Execute a read-only request against an authorized resource.
6. For a mutation, present the intended change, use the tool's exact confirmation string and include a unique idempotency key.
7. Verify the persisted result and audit information.

## Case updates

For `treseko.cases.update`, use `confirmation: "UPDATE_CASE"` and always include `idempotency_key`. Until partial-update behavior is explicitly safe, include the complete `steps` list: omitting it can replace existing steps with an empty list. Preserve the independent dimensions `formato_prueba` (`CLASICA`, `API`, `PERFORMANCE`, `CONVERSACIONAL`) and `tipo_prueba` (`MANUAL`, `AUTOMATIZADA`, `AUTOMATIZADA_AI`).

## Error handling

- `401`: the credential is missing or invalid; do not ask the user to paste it into chat.
- `403`: the identity, scope, functional capability or resource ownership is insufficient; do not retry by changing permissions implicitly.
- `404`: verify the installation base URL and the discovered tool name.
- Validation error: correct the request using the discovered schema; never bypass validation with arbitrary scripts.
- Duplicate/idempotency response: treat the prior result as authoritative and verify it before retrying.

## Installation in an AI client

For Hermes Agent, save this file as `~/.hermes/skills/treseko-mcp/SKILL.md` in the profile that will use Treseko, then start a new task so the skill can be discovered. Other AI clients may support a different skill or instruction-directory format; copy the content into that client's documented instruction mechanism. Installing this file does not install MCP, create credentials or grant permissions.

Canonical public documentation: https://treseko.com/documentacion/mcp-gobernado
