tradememory-protocol — Claude Code MCP server: how to install
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.
MIT ★ 1,450 updated 2026-10-23
claude mcp add tradememory-protocol -- uvx tradememory-protocolWhat tradememory-protocol 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.
What it helps with
- 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 for the agent
- Log my AAPL long entered at $195 with
remember_trade, reason: earnings beat. - Before you suggest an AAPL order, call tradememory
recall_memorieswithorder="losses_first"and show my losing trades. - Run this order through
evaluate_orderand tell me whether my policy would allow it, without sending anything to the broker.
How to install tradememory-protocol
Platform CLI
claude mcp add tradememory-protocol -- uvx tradememory-protocoluvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>
Platform CLI
codex mcp add tradememory-protocol -- uvx tradememory-protocoluvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add tradememory-protocol uvx tradememory-protocoluvx runs the command named after the package; if the README names another one, use uvx --from tradememory-protocol <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about tradememory-protocol
How do I install tradememory-protocol in Claude Code?
Run claude mcp add tradememory-protocol -- uvx tradememory-protocol. The server starts through uvx.
What does tradememory-protocol do?
It stores your closed trades locally, shows where your history loses money, and gives the agent its losing trades before a new order. In proxy mode it also checks orders against your policy.
What does proxy mode require?
Python 3.12+ and pip install "tradememory-protocol[proxy]". For now the proxy works with Alpaca's MCP server and is a preview.