# tradememory-protocol

tradememory-protocol keeps your closed trades on your machine, shows an AI trading agent its past losses before it orders, and can block orders that break your rules.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1450 repo stars
- Author: mnemox-ai
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mnemox-ai/tradememory-protocol
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/tradememory-protocol

## What it does

Run `tradememory sync hyperliquid --address 0xYourAddress` to pull closed trades for a public address, no key required. `tradememory sync alpaca --env-file ~/.secrets/alpaca.env` does the same for Alpaca with your own keys. Re-running adds only new trades. The command then shows which situations cost you money, such as how you trade after two losses in a row. It describes past trades and predicts nothing. Hyperliquid returns only recent fills per address, so sync soon.

Before proposing a trade, the agent can call `recall_memories(order="losses_first")`, which lists losing trades first with their size and P&L. The server instructs connected agents to do this. Agents log trades with `remember_trade`.

Proxy mode is a preview and needs Python 3.12+ plus `pip install "tradememory-protocol[proxy]"`. It sits between your agent and Alpaca's MCP server and checks each order against a policy you own. Symbols outside your list and entries with no bracket stop are refused, while closing a position is never blocked. Option orders, amendments to existing orders, and stop-limit or trailing types are rejected without evaluation.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add tradememory-protocol -- uvx tradememory-protocol
```
uvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>

### Codex

**Platform CLI**
```bash
codex mcp add tradememory-protocol -- uvx tradememory-protocol
```
uvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "tradememory-protocol": {
            "command": "uvx",
            "args": [
                "tradememory-protocol"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "tradememory-protocol": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "tradememory-protocol"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add tradememory-protocol uvx tradememory-protocol
```
uvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>

## When to use it
- find the situations where your own trading history loses money
- pull closed Hyperliquid fills for a public address without an API key
- put an agent's past losses in front of it before a new order
- refuse orders with no bracket stop or a symbol outside your list
- freeze every new order with `tradememory proxy halt FULL_HALT`

## Example prompts
- Log my AAPL long entered at $195 with `remember_trade`, reason: earnings beat.
- Before you suggest an AAPL order, call tradememory `recall_memories` with `order="losses_first"` and show my losing trades.
- Run this order through `evaluate_order` and tell me whether my policy would allow it, without sending anything to the broker.

## Similar
- [breakout-trade-planner](https://affpapa.org/en/nevibecode/skills/breakout-trade-planner.md) — skill · 3500 installs
- [alpaca-trading-mcp-server](https://affpapa.org/en/nevibecode/skills/alpaca-trading-mcp-server.md) — skill · 186 installs
- [alpaca-mcp-server-trading](https://affpapa.org/en/nevibecode/skills/alpaca-mcp-server-trading.md) — skill · 185 installs
- [Canli Paper Trading](https://affpapa.org/en/nevibecode/mcp/canli-paper-trading.md) — MCP server · ★ 6 repo stars
- [hyperliquid](https://affpapa.org/en/nevibecode/skills/hyperliquid.md) — skill · 8700 installs
- [trader-budget](https://affpapa.org/en/nevibecode/skills/trader-budget.md) — skill · ★ 9067 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
