MCP (Model Context Protocol)
DojOps supports the Model Context Protocol (MCP) — a Linux Foundation standard for connecting LLMs to external tool servers. MCP enables the autonomous agent (dojops auto) to call tools from databases, cloud APIs, GitHub, and any MCP-compatible server.
Overview
MCP extends the agent loop beyond the 7 built-in tools (read_file, write_file, edit_file, run_command, run_skill, search_files, done) with tools from external servers. The @dojops/mcp package handles server lifecycle, tool discovery, and dispatch.
Key concepts:
- Transports:
stdio(spawn a local process) orstreamable-http(connect to a remote endpoint) - Tool namespacing: MCP tools appear as
mcp__<server>__<tool>(e.g.,mcp__github__create_issue) - Non-fatal: MCP is optional — connection failures are silently skipped, and the agent continues with built-in tools
Configuration
MCP servers are configured in JSON files at two levels:
- Project:
.dojops/mcp.json— scoped to the current project - Global:
~/.dojops/mcp.json— shared across all projects
Project config overrides global by server name when both define the same server.
Config Format
{
"mcpServers": {
"filesystem": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"env": {}
},
"remote-api": {
"transport": "streamable-http",
"url": "http://localhost:8080/mcp",
"headers": {}
}
}
}Stdio Transport
Spawns a local process that communicates over stdin/stdout:
| Field | Type | Required | Description |
|---|---|---|---|
transport | "stdio" | Yes | Transport type |
command | string | Yes | Command to run (e.g., npx, node) |
args | string[] | No | Command arguments |
env | Record<string, string> | No | Environment variables (merged over process.env) |
Streamable HTTP Transport
Connects to a remote MCP server over HTTP:
| Field | Type | Required | Description |
|---|---|---|---|
transport | "streamable-http" | Yes | Transport type |
url | string | Yes | Server endpoint URL |
headers | Record<string, string> | No | HTTP headers |
CLI Commands
List Servers
dojops mcp listShows all configured servers with transport type and connection details. Tests connections and reports available tool count.
Add a Server
dojops mcp addInteractive prompts for:
- Server name (lowercase alphanumeric, hyphens, underscores)
- Transport type (stdio or streamable-http)
- Command and arguments (stdio) or URL (HTTP)
Remove a Server
dojops mcp remove [name]Removes a server from .dojops/mcp.json. If no name is provided, shows an interactive picker.
Agent Integration
When dojops auto starts, it:
- Loads MCP config from
.dojops/mcp.jsonand~/.dojops/mcp.json - Connects to all configured servers (failures silently skipped)
- Discovers tools from each server via
listTools() - Merges MCP tools with the 7 built-in agent tools
- Passes the
McpToolDispatchertoToolExecutor - Disconnects all servers in a
finallyblock on completion
The ToolExecutor dispatch chain:
built-in tools → skill resolution → MCP dispatcher → "Unknown tool" errorExample
# Configure a filesystem MCP server
cat > .dojops/mcp.json << 'EOF'
{
"mcpServers": {
"memory": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}
EOF
# The agent can now use memory tools
dojops auto "Store a note about our deployment process and retrieve it"
# Agent discovers: mcp__memory__read_memory, mcp__memory__write_memoryArchitecture
┌─────────────────────────────────────────────────┐
│ dojops auto "prompt" │
└────────────────────┬────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ AgentLoop │
│ LLM sees: 7 built-in tools + N MCP tools │
└────────┬──────────────────────┬─────────────────┘
│ │
▼ ▼
┌────────────────┐ ┌──────────────────────────┐
│ Built-in tools │ │ McpToolDispatcher │
│ (ToolExecutor) │ │ ─ Parses mcp__srv__tool │
│ │ │ ─ Routes to McpClientMgr │
└────────────────┘ └──────────┬───────────────┘
│
┌────────────┴────────────┐
│ McpClientManager │
│ ─ stdio transport │
│ ─ HTTP transport │
│ ─ Tool discovery │
└─────────────────────────┘Popular MCP Servers
| Server | Transport | Description |
|---|---|---|
@modelcontextprotocol/server-filesystem | stdio | File system access |
@modelcontextprotocol/server-memory | stdio | Key-value memory store |
@modelcontextprotocol/server-github | stdio | GitHub API integration |
@modelcontextprotocol/server-postgres | stdio | PostgreSQL queries |
@modelcontextprotocol/server-slack | stdio | Slack messaging |
Browse more at modelcontextprotocol.io/servers .
DojOps as MCP server
DojOps can also run as an MCP server, exposing its capabilities to external CLI agents like Claude Code, Gemini CLI, GitHub Copilot, and OpenClaw.
Starting the server
# Via the CLI (requires dojops serve running separately on port 3000)
dojops serve --mcp
# Standalone (same behavior)
npx @dojops/mcpThe MCP server uses stdio transport and proxies all requests to a running dojops serve instance (default http://localhost:3000).
Exposed tools
| Tool | Description |
|---|---|
generate | Agent-routed LLM generation for DevOps configs |
plan | Decompose a goal into a dependency-aware task graph |
scan | Run security scanners on a project directory |
debug-ci | Diagnose CI/CD log failures |
diff-analyze | Analyze infrastructure diffs for risk and cost |
chat | Send a chat message with agent routing |
list-agents | List available specialist agents |
list-skills | List available built-in and custom skills |
repo-scan | Scan a repository for DevOps context |
Configuring external agents
Claude Code (~/.claude/settings.json or project .mcp.json):
{
"mcpServers": {
"dojops": {
"command": "dojops",
"args": ["serve", "--mcp"]
}
}
}Gemini CLI (.gemini/settings.json):
{
"mcpServers": {
"dojops": {
"command": "npx",
"args": ["@dojops/mcp"]
}
}
}GitHub Copilot (.vscode/mcp.json):
{
"servers": {
"dojops": {
"command": "dojops",
"args": ["serve", "--mcp"]
}
}
}Environment variables
| Variable | Default | Description |
|---|---|---|
DOJOPS_API_URL | http://localhost:3000 | Base URL of running dojops serve instance |
DOJOPS_API_KEY | (none) | API key for dojops serve authentication |
Architecture
External Agent (Claude Code / Gemini CLI / Copilot)
|
v stdio (JSON-RPC)
DojOps MCP Server (dojops serve --mcp)
|
v HTTP
DojOps API (dojops serve, port 3000)
|
v
LLM Provider → Agent Router → Skill Engine → ExecutorThe MCP server is a thin proxy layer. It translates MCP tool calls into HTTP requests to the DojOps REST API and returns the results. All the actual processing (agent routing, skill matching, LLM generation, validation) happens in the running dojops serve instance.