MCP tools
Load additional tools from Model Context Protocol (MCP) servers
Model Context Protocol (MCP) lets you extend TalkOps (talkops) with tools from external servers—Kubernetes cluster inspectors, Terraform registries, cloud SDKs, databases, and internal developer platforms—without modifying the agent itself. TalkOps connects to configured MCP servers at startup, discovers their tools, and exposes them alongside its built-in tools.
Add MCP servers by placing an .mcp.json configuration file in your project for project-level scope, or in ~/.talkops/.mcp.json to make them available across all projects on your machine.
Quickstart
1. Create the .mcp.json config file
Create ~/.talkops/.mcp.json for user-wide servers, or .mcp.json (or .talkops/.mcp.json) in your project root for repository-specific servers:
# User-level (available in every project)
mkdir -p ~/.talkops
touch ~/.talkops/.mcp.json
# Or project-level (available in the current repository)
touch .mcp.json
2. Add MCP servers
Define your servers under the mcpServers key:
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["-y", "@kubernetes/mcp-server"],
"env": {
"KUBECONFIG": "/Users/user/.kube/config"
}
},
"aws": {
"command": "npx",
"args": ["-y", "@aws/mcp-server"],
"env": {
"AWS_PROFILE": "production",
"AWS_REGION": "us-west-2"
}
}
}
}
3. Launch TalkOps and inspect loaded tools
talkops
On startup, TalkOps connects to each configured server, discovers its tools, and registers them using the namespaced format mcp__<server>__<tool> (for example, mcp__kubernetes__get_pods).
Run /mcp inside an interactive session to inspect connected servers, tool schemas, and connection health, or test tools manually before agent execution.
Auto-discovery and flags
TalkOps searches for MCP configuration files in the following precedence order:
| Priority | Location | Scope |
|---|---|---|
| 1 (highest) | --mcp-config PATH | Explicit CLI override for the current session |
| 2 | <project>/.mcp.json or <project>/.talkops/.mcp.json | Project-level (Claude Code compatible) |
| 3 (lowest) | ~/.talkops/.mcp.json | User-level (applies across all projects) |
CLI flags and subcommands
| Flag / Command | Behavior |
|---|---|
--mcp-config PATH | Load a custom MCP JSON config file as the highest-precedence source |
--no-mcp | Disable all MCP server connections and tool loading for the session |
--trust-project-mcp | Trust project-level MCP servers without interactive confirmation for the current run |
talkops mcp list | List configured MCP servers and their connection status from the shell |
talkops mcp tools | List all tools exposed by configured MCP servers from the shell |
--mcp-config and --no-mcp are mutually exclusive. If you already have a .mcp.json at your project root for Claude Code or Cursor, TalkOps discovers it automatically.
Configuration format
Each key under mcpServers is a server name.
stdio servers
stdio servers run as child processes over stdin/stdout:
| Field | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Executable to launch (npx, uvx, python, docker) |
args | string[] | No | Command-line arguments passed to command |
env | object | No | Environment variables injected into the server subprocess |
Subagent and plugin MCP servers
Agent plugins and custom subagents can bundle their own dedicated MCP servers (via an .mcp.json inside the plugin package or mcp_config in the subagent's YAML frontmatter). Subagent MCP servers launch on demand when the subagent is invoked, scope their tools exclusively to that subagent, and shut down cleanly when the subagent finishes. See Plugins and marketplaces and Subagents.
Trust and security
Global vs. project trust
- User-level servers (
~/.talkops/.mcp.json) are always trusted because they live in your home directory. - Project-level servers (
.mcp.json,.talkops/.mcp.json) require confirmation on first use because they can be committed to Git repositories by external contributors. TalkOps saves your trust decisions in~/.talkops/.state/mcp_trust.json.
For unattended CI/CD runs that use project-scoped MCP servers, pass --trust-project-mcp:
talkops -p "Check cluster pod status" --trust-project-mcp
Headless MCP security guard
When running non-interactively (-p / -n or piped stdin), HeadlessMCPGuardMiddleware classifies every MCP tool into one of four security tiers to prevent destructive unattended actions:
| Tier | Behavior in headless mode | Examples |
|---|---|---|
READ_ONLY | Executes automatically | mcp__kubernetes__get_pods, mcp__aws__describe_instances |
MUTATING_SAFE | Allowed in Auto (-y) and Smart (--smart) modes | mcp__kubernetes__apply_manifest, mcp__aws__tag_resource |
MUTATING_DESTRUCTIVE | Blocked unless explicitly allowlisted | mcp__kubernetes__delete_namespace, mcp__aws__terminate_instances |
PRIVILEGED | Blocked in unattended mode | Modifying cluster RBAC or root IAM policies |
Troubleshooting
Server fails to start (stdio)
- Verify that the
commandbinary (npx,uvx,python,docker) is installed and on yourPATHby runningtalkops doctor. - Check that all required environment variables (such as
KUBECONFIGorAWS_PROFILE) exist in theenvblock or your shell.
Tools not appearing in the session
- Run
/mcpin the TUI (ortalkops mcp listandtalkops mcp toolsfrom the shell) to check whether the server connected or reported a startup error. - If you edited
.mcp.jsonwhile a session was already open, run/reloadto refresh MCP connections.
Project MCP server skipped in non-interactive mode
- Non-interactive runs (
-p/-n) cannot display an interactive trust prompt. Either opentalkopsinteractively once in the repository to record trust in~/.talkops/.state/mcp_trust.json, or pass--trust-project-mcpon the command line.