You choose how your agent reaches a mount: through the tools of one MCP server, or through its shell. Both modes read the same files. They differ only in how the agent searches, calls source tools, and saves notes.

Use MCP mode unless your agent has a shell and you want fewer tool schemas in its context.

## MCP mode

MCP mode is the default. `stash attach` adds a server named `stash` to each harness:

```sh
stash attach ops
```

The agent gets a search tool, a note tool when the mount has `[extraction]`, and the tools of each MCP or Gateway source. Stash saves each result file that fits the result and cache limits, while the tool returns a compact view.

See the [`stash mcp` reference](/docs/user-guide/stash/reference/cli/index.md#stash-mcp) for the tools and their inputs.

## CLI mode

In CLI mode, Stash adds no MCP server. The agent uses its shell:

```sh
ls /tmp/ops-context/
cat /tmp/ops-context/_sources/incidents.md
grep -rl "checkout latency" /tmp/ops-context/agentcore-memory/incidents/
stash search ops "checkout latency" --path "/agentcore-memory/incidents/*"
stash tool call ops ticketing/get_ticket --input '{"id": "INC-4412"}'
jq '.comments | length' /tmp/ops-context/mcp/ticketing/_tools_results/get_ticket/*/content/1.json
stash note save ops --topic "INC-4412 mitigation plan" < plan.md
```

Attach with `--no-mcp`:

```sh
stash attach ops --no-mcp
```

The steering block names the CLI commands and the schema file of each source tool. See the references for [`stash search`](/docs/user-guide/stash/reference/cli/index.md#stash-search), [`stash tool call`](/docs/user-guide/stash/reference/cli/index.md#stash-tool-call), and [`stash note save`](/docs/user-guide/stash/reference/cli/index.md#stash-note-save).

## Choose a mode

|  | MCP mode | CLI mode |
| --- | --- | --- |
| Agent tools | Stash search, notes, and source tools | No Stash tools |
| Agent requirements | A file reader | A shell and a file reader |
| Calls | MCP tool calls | `stash` commands |
| Good fit | An agent that prefers tools or has no shell | A coding agent with a shell |

## Use a mode with a Strands agent

`StrandsStash` uses MCP mode by default. Turn off its `mcp` option for CLI mode, and give the agent a shell.

See [Strands Agents](/docs/user-guide/stash/integrations/strands-agents/index.md) for the Python and TypeScript setup.

## Switch modes

Run `attach` again for the same mount:

```sh
stash attach ops --no-mcp
stash attach ops
```

Stash updates its steering block and MCP entry. It keeps the rest of each file. Start a new agent session so the harness reads the new steering.

## What attach installs

Both modes install a generated steering block and harness hooks.

The steering block tells the agent where the mount is and how to use it. Stash keeps every byte outside its markers. The [`stash attach` reference](/docs/user-guide/stash/reference/cli/index.md#stash-attach) lists the steering, hook, and MCP files for each harness. The steering also tells the agent to use filters, limits, and queries so each tool returns only what the task needs.

The hooks warm the mount at session start and capture each completed turn. They also ask for notes when the mount has `[extraction]`. The [`stash hook` reference](/docs/user-guide/stash/reference/cli/index.md#stash-hook) owns the event behavior, output, and exit codes.

A Strands agent gets the same steering and session context through `StrandsStash`. It does not need harness files.

### Note requests

With `[extraction]`, Claude Code and Codex can ask for a note after a tool call. Kiro can ask at the end of a turn. The agent can continue when there is nothing to record.

See [The local store](/docs/user-guide/stash/integrations/local-store/index.md) for note extraction and [`stash hook`](/docs/user-guide/stash/reference/cli/index.md#note-requests) for the request threshold and harness output.

## Next steps

-   [Supported harnesses and frameworks](/docs/user-guide/stash/integrations/harnesses/index.md)
-   [Command reference: `stash attach`](/docs/user-guide/stash/reference/cli/index.md#stash-attach)
-   [Strands Agents](/docs/user-guide/stash/integrations/strands-agents/index.md)
-   [Progressive disclosure](/docs/user-guide/stash/capabilities/progressive-disclosure/index.md)