Metadata-Version: 2.4
Name: autonomous-audit-mcp
Version: 0.1.0
Summary: MCP server exposing autonomous-audit's tamper-evident decision log (record/verify/report/anchor) as agent-callable tools - integrity & traceability for AI trading agents (not investment advice).
Author-email: Autonomous Asset Management Agents UG <support@aaagents.de>
License-Expression: Apache-2.0
Project-URL: Homepage, https://aaagents.de
Project-URL: Repository, https://github.com/Autonomous-Asset-Management-Agents/autonomous_
Keywords: mcp,model-context-protocol,autonomous,audit,hash-chain,tamper-evident,agent,trading
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: autonomous-audit>=0.1.0
Requires-Dist: fastmcp>=3.2
Dynamic: license-file

<!-- mcp-name: io.github.autonomous-asset-management-agents/autonomous-audit-mcp -->

# autonomous-audit-mcp

**An MCP server that lets an AI trading agent record, verify, and report its own decisions to a
tamper-evident audit log — as native, agent-callable tools.**

Thin [Model Context Protocol](https://modelcontextprotocol.io) wrapper around the open-source
[`autonomous-audit`](https://pypi.org/project/autonomous-audit/) tool (Apache-2.0, Python standard
library only). No new audit logic — it exposes the existing hash-chain over stdio so an agent in
Claude Desktop, Cursor, or any MCP client can build a tamper-evident decision trail *while it
works*, without writing code.

## Tools

| Tool | What it does |
|---|---|
| `check_and_size_order(...)` | Cooperative fail-closed pre-trade check & position sizer (concentration cap, max order value, daily trade limit, whole-share rounding by default for IBKR AI Partitions). |
| `record_decision(log_path, decision)` | Append one decision (`symbol`, `side`, `qty`, `reason`, `timestamp`, …) to a SHA-256 hash-chained log. Returns the new hash + record count. |
| `verify_log(log_path)` | Full-chain integrity check. Detects in-place edits (hash mismatch) and deletions/reorders (prev_hash break). |
| `export_report(log_path, output_path?)` | Render a self-contained HTML report (integrity banner + one row per decision + disclosure). |
| `chain_head(log_path)` | Return the current head hash + record count — the value to publish/sign **externally** so truncation or a genesis rewrite (which the local chain alone cannot catch) becomes detectable. |

Read-only with respect to any broker or market — it never places, modifies, or cancels orders;
`check_and_size_order` is a cooperative calculation aid (not a technical broker-level blocker),
and `record_decision` only appends to the local audit log you point it at. See [`SKILL.md`](./SKILL.md)
for the recommended pre-trade + audit agent workflow.

## Run

```bash
uvx autonomous-audit-mcp        # runs the MCP server over stdio
```

Register it with an MCP client, e.g. Claude Desktop (`claude_desktop_config.json`), Claude Code, or Cursor
*(local `stdio`/`uvx` servers run in desktop and IDE clients, not in `claude.ai` Web or Mobile)*:

```json
{
  "mcpServers": {
    "autonomous-audit": { "command": "uvx", "args": ["autonomous-audit-mcp"] }
  }
}
```

### Sidecar with Alpaca MCP or IBKR Autonomous Trading MCP

Run `autonomous-audit` alongside a broker MCP server so every agent trade decision (and resulting
broker order ID) is recorded in a local SHA-256 hash chain before or right after execution:

- **With Alpaca (`alpaca-mcp-server`):**

```json
{
  "mcpServers": {
    "alpaca": {
      "command": "uvx",
      "args": ["alpaca-mcp-server"],
      "env": {
        "ALPACA_API_KEY": "YOUR_KEY",
        "ALPACA_SECRET_KEY": "YOUR_SECRET",
        "ALPACA_PAPER_TRADE": "true"
      }
    },
    "autonomous-audit": { "command": "uvx", "args": ["autonomous-audit-mcp"] }
  }
}
```

- **With Interactive Brokers (`https://api.ibkr.com/v1/api/mcp-public`) or Alpaca Hosted MCP (`https://api.alpaca.markets/mcp`):**
  Keep your remote OAuth broker connector enabled in Claude Desktop / Claude Code / Cursor and add
  `"autonomous-audit"` above as a local sidecar. Instruct your agent to call `record_decision`
  with the broker order ID and rationale on every trade.

## Scope & disclosure

Provides **tamper-evidence** (integrity + traceability): it detects post-hoc edits, reorders, and
mid-chain deletions. It is **tamper-evident, not tamper-proof durable storage**, does not on its
own satisfy statutory record-keeping (e.g. MiFID II), and is neither model explainability nor a
regulatory approval. For educational and informational purposes only — **not** investment advice.
See the [`autonomous-audit` scope & regulatory context](https://pypi.org/project/autonomous-audit/).

## License

Apache-2.0.
