PluginBench
MCP Server
Active
MIT

io.github.mnemox-ai/tradememory-protocol MCP Server

io.github.mnemox-ai/tradememory-protocol

Tamper-evident decision audit trail and outcome-weighted memory for AI trading agents.

What is the io.github.mnemox-ai/tradememory-protocol MCP server?

The TradeMemory Protocol MCP server is a memory layer for AI trading agents that records every trade decision with SHA-256 tamper-evident audit trails and recalls past trades weighted by outcome quality, context similarity, recency, confidence, and emotional state. It enables agents to learn from historical trades, maintain regulatory compliance (MiFID II, EU AI Act), and detect behavioral drift through five memory layers: episodic, semantic, procedural, affective, and trade records.

TradeMemory solves the amnesia problem in AI trading systems. Before trading, agents query memory to learn what happened in similar market conditions; after trading, one call records the decision with full context. It provides safety rails (confidence tracking, drawdown alerts, losing streak detection), regulatory audit trails with Merkle-rooted daily summaries, and works with any market, broker, or AI platform without touching API keys or executing trades.

How to install io.github.mnemox-ai/tradememory-protocol

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "tradememory-protocol": {
      "command": "uvx",
      "args": [
        "tradememory-protocol"
      ]
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • remember_trade — Record a trade with outcome context, confidence level, and market conditions; updates five memory layers automatically
  • recall_memories — Retrieve past trades weighted by outcome quality, context similarity, recency, confidence, and emotional state
  • get_agent_state — Fetch current agent state including confidence level, drawdown, winning/losing streaks, and behavioral patterns
  • get_behavioral_analysis — Analyze behavioral patterns, strategy decay, and trading mistakes over time
  • create_trading_plan — Create prospective trading plans with conditional triggers and pre-trade gates
  • check_active_plans — Check status of active trading plans and their trigger conditions
  • check_trade_legitimacy — Pre-trade 5-factor gate (full/reduced/skip) based on confidence, drawdown, and risk state
  • export_audit_trail — Export SHA-256 tamper-evident audit trail for regulatory submission or review
  • verify_audit_hash — Verify a single trade record hasn't been tampered with using SHA-256 content hash
  • verify_audit_chain — Walk the entire audit chain end-to-end to detect any tampering across records
  • get_daily_root — Retrieve daily Merkle root summarizing all trading decision records for that UTC day
  • get_strategy_performance — Retrieve performance metrics and statistics for a specific trading strategy
  • get_trade_reflection — Get reflection analysis on past trades including lessons learned and patterns
  • validate_strategy — Validate a trading strategy against historical performance and risk criteria
  • compute_dqs — Compute decision quality score based on decision factors and outcomes
  • evolution_fetch_market_data — Fetch market data for strategy evolution and backtesting
  • evolution_discover_patterns — Discover trading patterns in historical data
  • evolution_run_backtest — Run backtest on a trading strategy
  • evolution_evolve_strategy — Generate and evolve trading strategies using research engine
  • evolution_get_log — Retrieve evolution engine logs and experiment results

Use cases

  • Pre-flight checklist before every trade: query memory to see what happened last time in similar market conditions and apply learned discipline
  • Automated memory loop for EA systems: sync MT5 trades to TradeMemory and record decision context (signals, filters, confidence) for every execution and skip
  • Compliance audit trail: export SHA-256 tamper-evident trading decision records for MiFID II Article 17 and EU AI Act Article 14 regulatory submission
  • Behavioral drift detection: run weekly/monthly reviews to identify strategy decay, losing streaks, and forced-liquidation patterns
  • Risk management gates: use confidence tracking and drawdown alerts to automatically reduce position size or skip trades when agent is in drawdown or losing streak

io.github.mnemox-ai/tradememory-protocol MCP server FAQ

What is TradeMemory and what does it do?

TradeMemory is a memory layer for AI trading agents. It records every trade decision with full context (conditions, indicators, confidence, outcome) in a tamper-evident SHA-256 audit trail, and recalls past trades weighted by outcome quality, context similarity, recency, and confidence. It does not execute trades or touch your money — it only records and recalls.

Is TradeMemory free?

Yes, the TradeMemory Protocol MCP server is free and open-source (MIT license), self-hosted, and requires only `pip install tradememory-protocol`. The maintainer offers paid statistical analysis of your trading records as an optional service, but the core server is free.

How do I install TradeMemory in Claude Desktop or Cursor?

Install via `pip install tradememory-protocol`, then add to `claude_desktop_config.json`: `{"mcpServers": {"tradememory": {"command": "uvx", "args": ["tradememory-protocol"]}}}`. For Cursor, use `claude mcp add tradememory -- uvx tradememory-protocol`. Full setup guide is in the Getting Started docs.

Does TradeMemory require authentication or API keys?

No. TradeMemory never touches API keys, wallets, or broker connections. It is read-and-record only: your agent passes decision context to TradeMemory, and it stores it locally. The only outbound call is optional RFC 3161 trusted timestamping of daily audit roots (a 32-byte hash, no trade data), which can be disabled with `TRADEMEMORY_TSA=off`.

What regulations does TradeMemory help with?

TradeMemory supports MiFID II Article 17 (record every algorithmic trading decision factor), EU AI Act Article 14 (human oversight of high-risk AI systems), and EU AI Act Article 12 (automatic tamper-resistant logs). Every trade is recorded as a Trading Decision Record with SHA-256 content hash, linked into a forward-chained audit ledger with daily Merkle roots.

Can TradeMemory work with my broker or market?

Yes. TradeMemory works with any market (stocks, forex, crypto, futures), any broker, and any AI platform. It integrates with MetaTrader 5 for automated sync, and accepts trade context from any source via REST API or MCP tools.

README (reference)

Source of truth, from the repository.

<!-- mcp-name: io.github.mnemox-ai/tradememory-protocol --> <p align="center"> <img src="assets/header.png" alt="TradeMemory Protocol" width="600"> </p> <div align="center">

PyPI Tests MCP Tools Smithery License: MIT

Getting Started | Use Cases | API Reference | OWM Framework | Limitations | 中文版

</div>

Project status (August 2026): Feature-complete, in maintenance mode — bug and security reports are still reviewed; no new features or hosted service are planned. For paid work, see Trading Record Analysis.

Your trading AI has amnesia. And regulators are starting to notice.

It makes the same mistakes every session. It can't explain why it traded. It forgets everything when the context window ends. Meanwhile, MiFID II is raising the bar for algorithmic decision documentation (Article 17). The EU AI Act demands systematic logging of AI actions (Article 14). Your competitors' agents are learning from every trade.

The AI trading stack is missing a layer. Every MCP server handles execution — placing orders, fetching prices, reading charts. None handle memory.

Your agent can buy 100 shares of AAPL but can't answer: "What happened last time I bought AAPL in this condition?"

TradeMemory is the memory layer. One pip install, and your AI agent remembers every trade, every outcome, every mistake — with a SHA-256 tamper-evident audit trail.

Used in production by traders running pre-flight checklists before every position, and by EA systems logging thousands of decisions daily.

What it does

  • Before trading: ask your memory — what happened last time in this market condition? How did it end?
  • After trading: one call records everything — five memory layers update automatically
  • Safety rails: confidence tracking, drawdown alerts, losing streak detection — the system tells you when to stop

Works with any market (stocks, forex, crypto, futures), any broker, any AI platform. TradeMemory doesn't execute trades or touch your money — it only records and recalls.

Quick Start

pip install tradememory-protocol

Add to Claude Desktop (claude_desktop_config.json):

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

Then tell Claude: "Record my AAPL long at $195 — earnings beat, institutional buying, high confidence."

<details> <summary>Claude Code / Cursor / Docker</summary>
# 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
</details>

Full walkthrough: Getting Started (Trader Track + Developer Track)

Who uses TradeMemory

US Equity TraderForex EA SystemCompliance Team
MarketStocks (AAPL, TSLA, ...)XAUUSD (Gold)Multi-asset
HowPre-flight checklist before every tradeAutomated sync from MT5Full decision audit trail
Key valueDiscipline system — memory before every decisionRecord why signals were blocked, not just executedSHA-256 tamper-evident records for regulators
DetailsRead more →Read more →Read more →

How it works

<p align="center"> <img src="assets/owm-factors.png" alt="OWM 5 Factors" width="900"> </p>
  1. Recall — Before trading, retrieve past trades weighted by outcome quality, context similarity, recency, confidence, and emotional state (OWM Framework)
  2. Record — After trading, one call to remember_trade writes to five memory layers: episodic, semantic, procedural, affective, and trade records
  3. Reflect — Daily/weekly/monthly reviews detect behavioral drift, strategy decay, and trading mistakes
  4. Audit — Every decision is SHA-256 hashed at creation. Export anytime for review or regulatory submission

MCP Tools

CategoryToolsDescription
Memoryremember_trade · recall_memoriesRecord and recall trades with outcome-weighted scoring
Stateget_agent_state · get_behavioral_analysisConfidence, drawdown, streaks, behavioral patterns
Planningcreate_trading_plan · check_active_plansProspective plans with conditional triggers
Riskcheck_trade_legitimacy5-factor pre-trade gate (full / reduced / skip)
Auditexport_audit_trail · verify_audit_hashSHA-256 tamper detection + bulk export
<details> <summary>All 20 MCP tools + REST API</summary>
CategoryTools
Core Memoryget_strategy_performance · get_trade_reflection
OWM Cognitiveremember_trade · recall_memories · get_behavioral_analysis · get_agent_state · create_trading_plan · check_active_plans
Risk & Governancecheck_trade_legitimacy · validate_strategy · compute_dqs
Evolutionevolution_fetch_market_data · evolution_discover_patterns · evolution_run_backtest · evolution_evolve_strategy · evolution_get_log
Auditexport_audit_trail · verify_audit_hash · verify_audit_chain · get_daily_root

REST API: 35+ endpoints for trade recording, reflections, risk, MT5 sync, OWM, evolution, and audit. Full reference →

</details>

Trading Record Analysis

TradeMemory itself is free and self-hosted. What the maintainer offers as a paid service is statistical analysis of your own trading records: export your MT4/MT5 history and get a descriptive-statistics report — where your losses concentrate, how your position sizing changes after losses, forced-liquidation structure, and the actual risk you took per trade — followed by a walkthrough call.

Descriptive statistics of past trades only: no trade signals, no investment advice, no performance promises. Your files are deleted after delivery.

dev@mnemox.ai | Book a call

Enterprise & Compliance

Every trading decision your agent makes — including decisions not to trade — is recorded as a Trading Decision Record (TDR). Per-record SHA-256 content hashes are linked into a forward-chained audit ledger; every UTC day is summarised by a Merkle root which itself chains across days. Tampering with any historical record invalidates every subsequent link.

RegulationRequirementTradeMemory Coverage
MiFID II Article 17Record every algorithmic trading decision factorFull decision chain: conditions, filters, indicators, execution
EU AI Act Article 14Human oversight of high-risk AI systemsExplainable reasoning + memory context for every decision
EU AI Act Article 12Automatic, tamper-resistant logs over system lifetimeLinked SHA-256 chain + daily Merkle roots (RFC 3161 TSA in Phase 1.5)
# Verify a single record hasn't been tampered with
verify_audit_hash(trade_id="MT5-7047640363")
# → {"verified": true, "chain_entry": {"sequence_num": 42, ...}}

# Walk the entire chain (or a slice) end-to-end
verify_audit_chain(from_seq=1, to_seq=None)
# → {"verified": true, "checked_count": 1284, "first_break_at": null}

# Daily Merkle root — single 32-byte anchor over every TDR for that day
get_daily_root(date="2026-05-14")
# → {"verified": true, "root_hash": "a05544...", "record_count": 18}

# Bulk export for regulatory submission
GET /audit/export?strategy=VolBreakout&start=2026-03-01&format=jsonl

See LIMITATIONS.md for the full audit-chain maturity statement, including what's not in v0.5.2 yet (TSA timestamping, external anchoring, zkML proof of inference).

Need a custom deployment for your fund? → dev@mnemox.ai

Security

  • Never touches API keys. TradeMemory does not execute trades, move funds, or access wallets.
  • Read and record only. Your agent passes decision context to TradeMemory. It stores it. That's it.
  • Local-first. The only outbound call is RFC 3161 trusted timestamping of daily audit roots — a 32-byte hash, no trade data (on by default; disable with TRADEMEMORY_TSA=off). Nothing else leaves your machine.
  • SHA-256 chained audit ledger. Every record is hashed at creation and linked to the previous record. Daily Merkle roots anchor the chain. Verify integrity at the record, slice, or day level. Tampering is detectable at every level; external anchoring (TSA by default) is on the roadmap.
  • 1,400+ tests passing. Full test suite with CI.

Research Status

TradeMemory's OWM framework is grounded in cognitive science (Tulving 1972) and reinforcement learning (Schaul et al. 2015). Current status:

  • OWM five-factor scoring: implemented, tested (1,400+ tests)
  • Statistical validation: DSR, MBL implemented (Bailey-de Prado 2014)
  • Audit trail: SHA-256 tamper-evident TDR
  • Evolution engine: research phase (strategy generation works, statistical gate pass rate under optimization)
  • Hybrid recall: OWM-only mode active, vector fusion available when embeddings configured
  • Empirical validation: ongoing (n=40 trades, target n>=100 for statistical significance)

Documentation

DocDescription
Getting StartedInstall → first trade → pre-flight checklist
Use Cases3 real-world production scenarios
API ReferenceAll REST endpoints
OWM FrameworkOutcome-Weighted Memory theory
ArchitectureSystem design & layer separation
TutorialDetailed walkthrough
MT5 SetupMetaTrader 5 integration
Research LogEvolution experiments & data
Failure Taxonomy11 trading AI failure modes
中文版Traditional Chinese

Contributing

See Contributing Guide · Security Policy

<a href="https://star-history.com/#mnemox-ai/tradememory-protocol&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=mnemox-ai/tradememory-protocol&type=Date&theme=dark" /> <img alt="Star History" src="https://api.star-history.com/svg?repos=mnemox-ai/tradememory-protocol&type=Date" width="600" /> </picture> </a>

MIT — see LICENSE. For educational/research purposes only. Not financial advice.

<div align="center">Built by <a href="https://mnemox.ai">Mnemox</a></div>

Related MCP servers

Automatically scan GitHub, HN, npm, PyPI for competing ideas—get a 0-100 reality score before you build.

780
Python
MIT
View repository →

Read-only PAPER market research for autonomous agents; no live trading or alpha claim.

Find governed AI capabilities and verify signed receipts. Read-only, no account.

View repository →

ESQ 1.0 题库包工具链(墨题刷题机):build(auto_fix) → validate(双轨校验) → upload/publish + kajweb 词表解析与热点词统计

技能库维护 MCP server:损坏扫描/改前备份/决策日志/体检(skill-evolution 机械环节工具化),uvx 一行接入

macOS automation via Hammerspoon — 75 tools for windows, Spaces, audio, Bluetooth, and more

1
TypeScript
MIT
View repository →