TradeMemory Protocol MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add tradememory-protocol -- uvx tradememory-protocol
README.md

Persistent, outcome-weighted memory for AI trading agents

Tutorial | API Reference | OWM Framework | 中文版


TradeMemory Protocol is an MCP server that gives AI trading agents persistent memory across sessions. Instead of forgetting every trade after each conversation, your agent stores decisions, discovers patterns, and adjusts strategy automatically — using a three-layer architecture inspired by ACT-R cognitive science.

When to use this: You're building an AI agent that trades forex, crypto, or equities via MT5, Binance, Alpaca, or any platform — and you want it to remember what worked, what didn't, and why.

How it works

  1. Store — Your agent records trades with context (strategy, confidence, market regime) via MCP tools
  2. Recall — Before the next trade, the agent retrieves similar past trades weighted by outcome (Outcome-Weighted Memory)
  3. Evolve — The Evolution Engine discovers patterns across trades and generates new strategy hypotheses, validated with Deflated Sharpe Ratio

When to use TradeMemory vs alternatives

TradeMemory Raw Mem0/Qdrant LangChain Memory Custom SQLite
Trade-specific schema ✅ L1→L2→L3 pipeline ❌ Generic vectors ❌ Chat-oriented ❌ DIY everything
Outcome weighting ✅ Kelly + ACT-R ❌ Cosine only ❌ Recency only ❌ Manual
Strategy evolution ✅ Built-in engine ❌ Not included ❌ Not included ❌ Not included
MCP native ✅ 15 tools ❌ Custom wrapper ❌ Custom wrapper ❌ Custom wrapper
Statistical validation ✅ DSR + walk-forward ❌ None ❌ None ❌ None

News

  • [2026-03] v0.5.0 — Evolution Engine + OWM 5 memory types. 1,087 tests. Release Notes
  • [2026-03] Statistical Validation — Strategy E passes P100% random baseline, Sharpe 3.24 walk-forward
  • [2026-03] Live Paper Trading — Strategy E running on Binance via GitHub Actions (hourly)
  • [2026-02] v0.4.0 — OWM Framework, 15 MCP tools, Smithery + Glama listed

Architecture

Three-Layer Memory

Quick Start

pip install tradememory-protocol

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "tradememory": {
      "command": "uvx",
      "args": ["tradememory-protocol"]
    }
  }
}

Then tell Claude: "Record my BTCUSDT long at 71,000 — momentum breakout, high confidence."

Claude Code / Cursor / Docker
# Claude Code
claude mcp add tradememory -- uvx tradememory-protocol

# From source
git clone https://github.com/mnemox-ai/tradememory-protocol.git
cd tradememory-protocol && pip install -e . && python -m tradememory

# Docker
docker compose up -d

MCP Tools (15)

Category Tools
Core Memory store_trade_memory · recall_similar_trades · get_strategy_performance · get_trade_reflection
OWM Cognitive remember_trade · recall_memories · get_behavioral_analysis · get_agent_state · create_trading_plan · check_active_plans
Evolution evolution_run · evolution_status · evolution_results · evolution_compare · evolution_config
REST API (30+ endpoints)

Trade recording, outcome logging, history, reflections, risk constraints, MT5 sync, OWM, evolution.

Full reference: docs/API.md

OWM — Outcome-Weighted Memory

Full theoretical foundation: OWM Framework

Evolution Engine

Methodology & data: Research Log

Documentation

| Doc | Description | |-----

Tools (5)

store_trade_memoryRecords a trade with context including strategy, confidence, and market regime.
recall_similar_tradesRetrieves past trades similar to the current context weighted by outcome.
get_strategy_performanceReturns performance metrics for a specific trading strategy.
get_trade_reflectionProvides a reflection on past trade outcomes.
evolution_runTriggers the evolution engine to discover patterns and generate new strategy hypotheses.

Configuration

claude_desktop_config.json
{"mcpServers": {"tradememory": {"command": "uvx", "args": ["tradememory-protocol"]}}}

Try it

Record my BTCUSDT long at 71,000 — momentum breakout, high confidence.
Recall similar trades to my current setup and tell me if I should adjust my position size.
Run the evolution engine to see if there are better strategy hypotheses based on my recent trade history.
What is the current performance of my momentum breakout strategy?

Frequently Asked Questions

What are the key features of TradeMemory Protocol?

Persistent memory across trading sessions for AI agents. Outcome-Weighted Memory (OWM) using Kelly criterion and ACT-R cognitive science. Evolution Engine for discovering patterns and generating strategy hypotheses. Statistical validation of strategies using Deflated Sharpe Ratio. 15 specialized MCP tools for trade recording, recall, and strategy evolution.

What can I use TradeMemory Protocol for?

Building AI agents for forex, crypto, or equities trading. Automating strategy adjustments based on historical trade outcomes. Detecting behavioral biases in automated trading decisions. Validating trading strategies using walk-forward analysis.

How do I install TradeMemory Protocol?

Install TradeMemory Protocol by running: pip install tradememory-protocol

What MCP clients work with TradeMemory Protocol?

TradeMemory Protocol works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep TradeMemory Protocol docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare