Agent MCP Server

Wiki / Tools

Agent MCP Server

Here agent means an AI assistant coding agent — a command-line tool that takes a task in plain language and works on your code or files on its own.

The Agent server wraps any such command-line agentClaude Code, GitHub Copilot CLI, aider — as a single MCP tool. You configure an invocation template and a workspace folder; when DMJBot calls run_agent with a single-line task, the template's PROMPT token is replaced with that task and the command runs in the workspace. This lets DMJBot delegate larger pieces of work to a specialized coding/automation agent.

The Agent Command is the template that runs each time, with PROMPT swapped for the task. A few examples of what you can configure:

# Claude Code
claude -p 'PROMPT' --dangerously-skip-permissions

# GitHub Copilot CLI
copilot -p 'PROMPT' --yolo --model gpt-5.5

# aider
aider --yes --message 'PROMPT'

Wrap PROMPT in single quotes so the whole task is passed as one argument.

Run it non-interactively

The agent runs unattended — there is no terminal and no way for it to ask you a question and get an answer back mid-run. So the command must run fully non-interactively: every permission prompt and confirmation has to be auto-approved, otherwise the run hangs waiting for input that can never arrive.

Each CLI has its own flag for this:

  • Claude Code--dangerously-skip-permissions (skips all permission prompts).
  • GitHub Copilot CLI--yolo (auto-approves every action).
  • aider--yes (assumes yes to all confirmations).

Because these flags let the agent act without asking, only point this server at a workspace where that level of autonomy is acceptable.

It needs filesystem access and the agent CLI installed on the host, so it runs on a device via the bridge.

What DMJBot can do

  • run_agent — run the configured agent/tool on a single-line task. Only one task runs at a time; calling it again while one is running returns an error.
  • cancel_task — cancel the running task by force-killing its whole process tree.

How runs work

  • Fast runs return output directly. Runs longer than ~3 seconds are detached as background tasks: DMJBot gets a task id immediately and the final output arrives when the run finishes.
  • A running task is cancellable.
  • Progress during a run is driven by an optional status file (see below).

This server supports background tasks.

The status file (optional)

By default a long run is a black box: DMJBot starts the agent and only sees the result when it finishes. The status file is an optional way to follow along while the agent works.

How it works:

  1. You pick a file path in Status File (e.g. .agent_status in the workspace).

  2. You instruct the agent to write a short, one-line status to that file as it goes — for example "reading the codebase", then "editing src/app.py", then "running tests". The simplest way is to append the instruction to the prompt template, e.g.

    claude -p 'PROMPT. Write a short one-line status of what you are doing to .agent_status as often as you can' --dangerously-skip-permissions
    
  3. The server polls that file (every Status Poll Interval seconds) and forwards each new line to DMJBot as a live progress update.

It is entirely optional: leave Status File empty and the agent still runs normally — you just won't see intermediate progress, only the final result. It's most useful for long runs where you want to know what is going on rather than waiting blindly.

Add the server

This server runs on the machine that has the agent CLI installed, through the DMJBot bridge:

dmjbot-bridge install agent
dmjbot-bridge configure agent
dmjbot-bridge start

You can run several instances (different agents) — give each a distinct Agent Title so DMJBot can tell them apart.

Configuration

Field Required Default Description
Agent Command yes The full invocation template. The literal token PROMPT is replaced with the task — wrap it in single quotes. Example: copilot -p 'PROMPT' --yolo --model gpt-5.5. You can append fixed instructions, e.g. ... 'PROMPT. Update .agent_status with a short status line as often as possible' --yolo.
Workspace Folder yes Absolute path the agent runs in (its working directory).
Agent Title no Agent Short label prefixed into the server name and tool descriptions so DMJBot can pick the right instance when several are loaded.
Status File no (empty) Path (relative to the workspace, or absolute) the agent writes a short status line to; the server polls it for progress. Recommended: .agent_status. Empty disables progress monitoring.
Status Poll Interval (s) no 5 How often the status file is polled while the agent runs (minimum 1).

Tips

  • Always wrap PROMPT in single quotes so multi-word tasks are passed as one argument.
  • To get live progress, instruct the tool (in the template) to write to the status file and set Status File to the same path.

See also