Every MCP tool is a shell command
← All posts

Every MCP tool is a shell command


The February post was about giving an agent one capabilities file. The next problem was the opposite one. In some cases, an agent was not needed at all. We only needed to call one tool, inspect the output, and then continue.

That is capa sh. It shipped in CAPA 1.2 on March 12.

The problem

An MCP tool is difficult to test by hand. First, a client has to start and connect. Then the model has to select the appropriate tool, and finally the result has to be extracted from a chat. If the call fails, the model and the tool have to be debugged together.

Our goal was the tool without the model.

One command

capa sh lists every tool the project configured and runs one of them. MCP tools sit under their server id, and command tools sit at the top level. The server has to be running (capa install already started it).

In a small demo project, the list is as follows.

capa sh listing aws-docs and draft-status

draft-status is a command tool, and its {title} placeholder becomes a flag.

tools:
  - id: draft-status
    description: Print a one-line draft status
    type: command
    def:
      run:
        cmd: 'echo "brief: {title}"'
        args:
          - name: title
            type: string
            description: Working title of the brief
            required: true

Running it does not involve a model.

capa sh draft-status printing the brief title

capa sh draft-status --title "Q3 launch brief"
# brief: Q3 launch brief

capa sh draft-status --help prints the parameters, so there is no need to open the YAML to find the flag.

MCP tools, same interface

Remote MCP tools use the same shape. This project exposes one tool from the public AWS documentation server. capa sh aws-docs lists it, and capa sh aws-docs <tool> --help shows the arguments.

capa sh listing the aws-docs search tool

Add --raw to receive the raw output of the tool rather than the formatted view of CAPA.

capa sh --raw aws-docs aws-search-documentation --query "S3 presigned URL expiration"

Any input that capa sh does not recognize is passed through to the shell, so capa sh git status also works.

Why we reach for it

  • Check a tool before an agent does. If the command fails in the terminal, it will also fail in the chat.
  • Skip the model for a lookup. Documentation search, a status line, or a query that is already known.
  • Same definition. The tool the agent calls and the command in the terminal are the same entry in capabilities.yaml.

The agent remains the appropriate choice when the task is vague. However, when the task is only “run this”, the shell is faster.


capa sh has been in CAPA since 1.2. The screenshots are from 2.2.4 (the version capa upgrade installs now).