Metadata-Version: 2.4
Name: mcp-toolcall-policy-mcp
Version: 0.1.0
Summary: An MCP server for authoring and testing mcp-toolcall-policy policies from pasted text. It does not enforce anything; enforcement is the PreToolUse hook in the mcp-toolcall-policy package.
Keywords: mcp,model-context-protocol,policy,claude-code,authoring
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Dist: fastmcp==4.2.4
Requires-Dist: mcp-toolcall-policy==0.1.0
Requires-Python: >=3.12
Project-URL: Repository, https://github.com/kimmawla/mcp-toolcall-policy
Project-URL: Issues, https://github.com/kimmawla/mcp-toolcall-policy/issues
Project-URL: Changelog, https://github.com/kimmawla/mcp-toolcall-policy/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# mcp-toolcall-policy-mcp

<!-- mcp-name: io.github.kimmawla/mcp-toolcall-policy-mcp -->

> Authors and tests mcp-toolcall-policy policies from pasted text. Enforces nothing; the hook does.

An MCP server for **writing and testing** [mcp-toolcall-policy](https://github.com/kimmawla/mcp-toolcall-policy)
policies. You paste a policy and a sample hook input; it returns the decision the engine would make,
a per-rule trace, or lint errors and warnings.

**It does not enforce anything.** It does not watch, block, or change calls to any other tool or MCP
server. Enforcement is the Claude Code `PreToolUse` hook in the `mcp-toolcall-policy` package (see
its README). "allow" means "a rule in this policy permits the call". It is not a safety verdict.

## Install

For Claude Code, with [uv](https://docs.astral.sh/uv/):

```bash
claude mcp add mcp-toolcall-policy-mcp -- uvx mcp-toolcall-policy-mcp
```

To pin one version, use `uvx mcp-toolcall-policy-mcp@0.1.0`. Each server release pins one exact
engine version, so the decisions it reports match that engine.

## Tools

| Tool | Takes | Returns |
|---|---|---|
| `evaluate_policy` | `policy_yaml`, `hook_input_json` (pasted text) | `decision`, `rule_id`, `reason`, `hook_exit_code` |
| `explain_decision` | `policy_yaml`, `hook_input_json` | the decision plus a per-rule, per-predicate trace |
| `lint_policy` | `policy_yaml` | `valid`, errors (code and location), warnings (code and rule id) |

- **Paste only.** Tools take text, never file paths. The server reads no files, opens no network
  connections, writes nothing, and runs no subprocesses.
- **Same caps as the CLI.** Policies up to 256 KiB; hook input up to the policy's
  `max_input_bytes` (at most 8 MiB).
- **No echo.** Responses never contain argument values or input keys: only decisions, rule ids,
  policy-authored reasons, fixed codes, and policy `arg` names.
- **Fails closed.** Anything that cannot be parsed or checked returns `deny` with rule id
  `_fail_closed` and a fixed code.
- Every response includes two notes: "allow" is not a safety verdict, and this server does not
  enforce anything on other tools.

## License

MIT
