# mcp-tool-control [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/martinrosbier/mcp-tool-control  
**GitHub Stars:** 0  
**npm Downloads (last month):** 273  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-tool-control

## Description
A small TypeScript MCP foundation for controlled tool execution.

## Tools
Capabilities this server exposes over MCP:

- **inspect-text** — Inspect text without changing external state. Returns bounded structural metadata and never returns the submitted text.
- **plan-changes** — Build a reviewable file-change plan without writing to disk. Returns proposed writes, conflicts, and an announcement so a host can request approval before applying changes.
- **apply-changes** — Request execution of a pending change plan. The server independently verifies trusted approval before accepting the request.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-tool-control": {
    "command": "npx",
    "args": ["-y","mcp-tool-control"]
  }
}
```

## Documentation

## What mcp-tool-control does

mcp-tool-control provides a reference implementation for MCP tools that distinguish read, plan, and write access. Its included tools are `inspect-text`, `plan-changes`, and `apply-changes`. Text inspection returns bounded structural metadata without returning the submitted text. Change planning validates workspace paths, records filesystem state, and stores an immutable plan that expires after a configurable period. Applying changes is limited to the exact stored plan instance approved by trusted host code.

The project is intended as a foundation for controlled tool execution and as a security reference. It is not an operating-system sandbox or a production-ready remote service.

## How it works

The normal write flow begins when the model calls `plan-changes`. The server checks target paths and snapshots their expected state before retaining the proposed writes. A host-side approval controller then approves or rejects the specific plan. The model can request `apply-changes` with the plan identifier, but possessing that identifier does not grant approval.

Before writing, the server verifies the plan, its approval, and the expected filesystem state. Approval is consumed once, which helps prevent replay. Files are staged through exclusive temporary files, flushed, revalidated, and replaced. Path handling covers absolute paths, traversal, symlinks, junctions, duplicate targets, overlapping targets, and case-insensitive comparisons.

Embedding applications receive separate server and approval-controller capabilities from `createMcpToolControl()`. The MCP-facing server can be given to the model transport, while the controller remains in authenticated trusted host code. The package also exposes host tools for trusted in-process execution and tool metadata.

## Setup and configuration

The package requires Node.js 20 or newer and npm. A checkout can be installed and checked with:

```sh
npm ci
npm run check
```

Run the bundled stdio server with `npm start`. For a published-package setup, an MCP client can launch `npx -y mcp-tool-control`; its working directory becomes the allowed workspace root. A cloned checkout can instead run `node` against the built `dist/server.js` file.

For standalone approval, launch `mcp-tool-control-host` through `npx`. This host prompts on the controlling terminal when a plan is waiting. Approval input stays on `/dev/tty` or the Windows console and is not sent through MCP. A non-interactive terminal fails closed: plans can be created, but not approved.

Embedded hosts can set the allowed root, maximum pending plan count, retained plan-byte budget, an audit callback, and an internal-error callback. The default pending-plan expiry is ten minutes, with defaults of 100 plans and 16 MiB of retained serialized file and expected-state data.

## Tools and capabilities

- `inspect-text`: returns bounded structural metadata without echoing input text.
- `plan-changes`: validates contained paths, captures expected filesystem state, and creates an expiring immutable write plan.
- `apply-changes`: executes only the exact plan instance that trusted host code approved.
- Expected-state hashes reject stale writes.
- Conflict previews can report a bounded first difference with line, column, before/after text, and an omission indicator.
- Audit events are privacy-preserving and delivered on a best-effort basis.

## Limitations and notes

The standalone MCP entry point has no MCP-accessible approval path. Do not expose the approval controller through an unauthenticated HTTP, IPC, queue, callback, or MCP endpoint. Plan identifiers are lookup keys, not authority, and recreating an expired plan does not transfer a previous approval.

Pending plans are kept in memory. Active plans are not evicted when configured storage limits are reached; new plans that exceed the count or byte limit fail instead. Audit delivery is not awaited or retried, and audit sink failures do not change tool results or approval state. Conflict previews support review but are not a substitute for checking the complete intended writes.

_Full upstream README: https://allmcps.com/mcp/mcp-tool-control/readme_

