MCP tools
OpsCode natively supports the Model Context Protocol (MCP), allowing you to connect external tool servers—such as Kubernetes cluster inspectors, Terraform and Helm registries, ArgoCD controllers, and Prometheus query engines—directly into the agent runtime.
Configure an MCP server
Define MCP servers in .mcp.json at the root of your repository or globally in ~/.opscode/.mcp.json:
{
"mcpServers": {
"helm": {
"command": "docker",
"args": ["run", "-i", "--rm", "talkops/helm-mcp:latest"]
},
"terraform": {
"command": "docker",
"args": ["run", "-i", "--rm", "talkops/terraform-mcp:latest"],
"env": {
"AWS_REGION": "us-east-1"
}
}
}
}
| Field | Type | Description |
|---|---|---|
command | string | Executable used to start the MCP server (docker, npx, uvx, python) |
args | list[string] | Command-line arguments passed to the server binary |
env | object | Environment variables injected into the MCP server process |
Configuration resolution order
OpsCode searches for MCP configurations in the following order (first match wins, or pass --mcp-config to override):
- Explicit CLI flag:
ops --mcp-config path/to/mcp.json - Project-level:
.mcp.json,mcp.json,.opscode/.mcp.json, or.opscode/mcp.json - User-level:
~/.opscode/.mcp.json
Tool naming and inspection
At startup, OpsCode connects to each configured MCP server, discovers its tool schemas, and registers each tool under a namespaced identifier:
mcp__<server-name>__<tool-name>
For example, the list_releases tool on the helm server is exposed as mcp__helm__list_releases.
Inspect connected MCP servers from the CLI or inside an interactive session:
ops mcp list # List configured MCP servers
ops mcp tools # List all discovered tools across servers
ops mcp test helm # Test connectivity to a specific server
In the TUI, run /mcp to browse active servers and tool schemas.
Trust and headless safety
Project MCP trust
Because project-level .mcp.json files are committed to Git and specify arbitrary process commands, OpsCode prompts you to trust a project's MCP configuration the first time you open it.
For non-interactive CI/CD pipelines, explicitly grant trust or disable MCP loading:
# Trust project-level .mcp.json in headless CI/CD runs
ops -n "Verify Helm release status" --trust-project-mcp
# Disable all MCP servers for an isolated run
ops -n "Lint local Terraform files" --no-mcp
Headless security tiers
When running unattended (-n), OpsCode classifies every MCP tool into four security tiers and blocks unsafe mutations:
| Security tier | Headless behavior | Example tools |
|---|---|---|
| Read-only | Allowed automatically | mcp__helm__list_releases, mcp__prometheus__execute_query |
| Mutating-safe | Requires -y or explicit allowlist | mcp__argocd__sync_application, mcp__helm__upgrade_release |
| Mutating-destructive | Blocked unless explicitly allowlisted | mcp__helm__uninstall_release, mcp__argocd__delete_application |
| Privileged | Blocked in headless mode | Cluster RBAC or IAM privilege escalation operations |