Use Tactfolio from your AI assistant

If you use an AI assistant that supports MCP (Model Context Protocol), you can connect it to your Tactfolio account. Describe an idea in a sentence and the assistant builds the strategy, runs the backtest, and saves a draft you can check in the builder.

The assistant uses the same builder and the same backtests as you do. There is nothing to install and no API key to copy: you approve access in your browser. AI trading on Tactfolio explains what an assistant can and can’t do for you.

Connect your assistant#

Tactfolio’s address is https://tactfolio.com/mcp. Claude, Cursor, and VS Code have one-click links that fill it in for you. Pick your assistant:

Claude

  1. Open Claude with Tactfolio filled in, on the web, desktop, or phone. On a Team or Enterprise plan, an owner adds it for everyone.

    Add to Claude

  2. Or open Customize, then Connectors, choose Add custom connector, and paste this address:
    https://tactfolio.com/mcp
  3. Choose Add, then Connect. Your browser opens Tactfolio so you can approve access.

ChatGPT

  1. Open chatgpt.com/plugins, choose the plus button, then Add custom MCP server. Your workspace settings decide whether you can add one.
  2. Name it Tactfolio and enter this server URL:
    https://tactfolio.com/mcp
  3. Choose OAuth for authentication, accept the warning, and choose Create as a plugin. Your browser opens Tactfolio so you can approve access.

Claude Code

  1. Add Tactfolio for all your projects:
    claude mcp add --transport http --scope user tactfolio https://tactfolio.com/mcp
  2. Sign in. Your browser opens Tactfolio so you can approve access.
    claude mcp login tactfolio

Codex

  1. Add Tactfolio. The Codex app, CLI, and IDE extension share this setting.
    codex mcp add tactfolio --url https://tactfolio.com/mcp
  2. Backtests can take up to three minutes, longer than Codex may wait by default. In ~/.codex/config.toml, add the timeout line to the Tactfolio section:
    [mcp_servers.tactfolio]
    url = "https://tactfolio.com/mcp"
    tool_timeout_sec = 300
  3. Sign in. Your browser opens Tactfolio so you can approve access.
    codex mcp login tactfolio

Cursor

  1. Open this link to add Tactfolio to Cursor, or add it to ~/.cursor/mcp.json yourself:

    Add to Cursor

    {
      "mcpServers": {
        "tactfolio": {
          "url": "https://tactfolio.com/mcp"
        }
      }
    }
  2. In Cursor's settings, find Tactfolio under MCP, choose Login, and approve access in your browser.

VS Code

  1. Open this link to add Tactfolio to VS Code, or add it to your mcp.json yourself:

    Add to VS Code

    {
      "servers": {
        "tactfolio": {
          "type": "http",
          "url": "https://tactfolio.com/mcp"
        }
      }
    }
  2. Start Tactfolio and choose Allow when VS Code asks to sign in. Your browser opens Tactfolio so you can approve access.

Gemini CLI

  1. Add Tactfolio for all your projects:
    gemini mcp add --scope user --transport http tactfolio https://tactfolio.com/mcp
  2. In Gemini CLI, sign in. Your browser opens Tactfolio so you can approve access.
    /mcp auth tactfolio

OpenCode

  1. Add Tactfolio to opencode.json:
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "tactfolio": {
          "type": "remote",
          "url": "https://tactfolio.com/mcp",
          "enabled": true
        }
      }
    }
  2. Sign in. Your browser opens Tactfolio so you can approve access.
    opencode mcp auth tactfolio

Other

  1. Add a remote MCP server that uses Streamable HTTP at this address:
    https://tactfolio.com/mcp
  2. Choose OAuth or automatic sign-in. No API key or custom header is needed.

The same steps are on the MCP page, with copy buttons.

Approve access#

When you sign in, your browser opens Tactfolio. If you don’t have an account yet, choose Create account first, then open the link we email you: it signs you in and brings you back here. You’ll then see a page such as Connect Claude Code to Tactfolio, listing the access it asks for:

  • Build and manage strategies: create, inspect, edit, and save strategy drafts.
  • Run strategy research: validate strategies, calculate allocations, and run backtests.

Choose the Connect button. Your account settings aren’t shared.

Check it works#

Start a new conversation, so the assistant loads Tactfolio’s tools, and ask:

Use the Tactfolio connection_status tool and tell me which account you are signed in as.

It should answer with the email address you signed in with.

Things to try#

Build and backtest a rule, then save it:

Hold QQQ while it is above its 50-day average and the VIX is under 25. Otherwise split between IEF and BIL. Backtest it from 2010 and save it as a draft.

Compare variations and keep the most robust one:

Using my strategy "Trend following", compare 100-, 150-, and 200-day moving
averages over 2010 to 2020, then check the best one on 2021 to today. Rank them
by max drawdown first and Sharpe second.

Rebuild an idea you found somewhere else:

I read about a rule that holds SPY when it is above its 10-month moving average
and otherwise holds IEF, checked monthly. Build it in Tactfolio, backtest it from
2005, and tell me where it did worst.

Open anything the assistant saved in the builder to see the tree and check the backtest yourself.

Get better results#

An assistant can try fifty variations in the time it takes you to try one, which makes it very good at finding a rule that fits the past by luck. A few habits keep it honest:

  • Say what the idea is and why it should work, not just the rule. “Bonds should do better when stocks trend down” gives the assistant something to test; “find the best moving average” invites it to fit noise.
  • Name your tickers and your dates. Ask it to tune on older years and check the winner once on recent years it hasn’t seen, as in the second example above. backtest_variants does exactly that.
  • Decide how you’ll pick the winner before it runs, such as “lowest max drawdown, then highest Sharpe”, so the choice isn’t made after seeing the results.
  • Ask for the uncomfortable numbers: the result at higher trading costs, and the benchmark held at the same risk. Every backtest returns both; the next-day-open line is in the builder.
  • Ask it to list its caveats when it saves: where it had to approximate an idea, and what it couldn’t express. They’re stored with the strategy.
  • Check its work in the builder. The tree it built is the same tree you edit; read it before you trust the result.

What the assistant can and can’t do#

  • It builds strategies with the same blocks as the builder, and validates them before running a backtest.
  • Saving creates a new revision; earlier ones never change. Deleting a strategy happens only when you ask, and only if nobody changed it since the assistant last read it.
  • It can’t publish strategies, trade, or change your account settings.

Tools#

Your assistant sees these tools. Some clients show them with a prefix, such as tactfolio_backtest_strategy.

ToolWhat it does
connection_statusChecks the connection and which account is signed in.
get_builder_contractExplains the blocks, settings, and exact edit formats.
create_strategyStarts a new draft, blank or from a starter pattern.
mutate_strategyApplies a batch of edits to a draft.
inspect_strategyShows the outline of a draft.
validate_strategyChecks a draft against the full rules.
search_tickersFinds tickers and confirms their price history.
find_similar_tickersLists close substitutes for a ticker that is hard to trade or has little history.
import_strategyBrings in a Composer symphony or a QuantMage spell as a private draft. Changes your data.
backtest_strategyRuns a backtest.
backtest_variantsBacktests up to 12 variations, picks one by your rules, and confirms it on separate dates.
get_latest_bookShows the target a strategy computes at the latest close, and whether it is due to rebalance then.
list_strategiesLists your saved strategies.
get_strategyReads a saved strategy or one of its versions.
save_strategySaves a draft as a new strategy or a new revision. Changes your data.
delete_strategyDeletes a strategy permanently. Changes your data.
send_feedbackSends the Tactfolio team a bug report, missing feature, or idea the assistant ran into.

Assistants use send_feedback when something breaks or the engine can’t express an idea. Reports include what the assistant writes, the tool involved, and your assistant’s name, and are stored with your account so the team can fix problems and plan features. Most assistants ask before sending.

Tactfolio’s administrators also see list_feedback and triage_feedback, which their own assistants use to read these reports and record what was fixed. Other accounts never see them.

While your assistant works on a strategy, Tactfolio keeps its draft for it, private to your account, so the whole strategy doesn’t travel through every message. A draft unused for 7 days is deleted, and your account keeps the 200 most recently used. Drafts aren’t saved strategies and don’t appear in your workspace: ask the assistant to save the ones you want to keep.

Security and revoking access#

  • The assistant holds a short-lived access token, valid for one hour, that works only for Tactfolio’s MCP address. Most assistants renew it in the background; if one goes 30 days without using Tactfolio, you approve it again.
  • You can revoke an assistant at any time on the MCP page. It loses access within the hour.
  • Tactfolio never asks you to paste a password or key into your assistant.
  • The approval page says where access goes: a website’s name, “an app on this computer”, or an app such as cursor://. Any assistant can call itself “Claude Code”, so approve only if that destination is the assistant you are connecting.

Troubleshooting#

  • “401” or “needs authentication” before you sign in. That is expected: it is how your assistant discovers that it needs to sign in. Run the sign-in step.
  • The browser doesn’t open. Copy the sign-in link your assistant prints into your browser.
  • The tools don’t appear. Start a new conversation or restart the assistant, so it reloads its tool list.
  • A backtest times out. Large comparisons can take up to about three minutes. Allow at least 180 seconds for tool calls if your assistant has a setting for it (in Codex, tool_timeout_sec = 300), or ask for a shorter date range.
  • Cline can’t connect or sign in. Use Cline 4.0 or later, and set "type": "streamableHttp" for Tactfolio in Cline’s MCP settings. With only a URL, Cline uses the older SSE transport, and Cline 3 signs in through a vscode:// link that Tactfolio doesn’t accept.
  • It stopped working after you revoked it. Run the sign-in step again.
  • OpenCode says “Database is not empty and has no session table”. That comes from OpenCode’s own local database, before it contacts Tactfolio. Check whether the OPENCODE_DB environment variable points somewhere unexpected, or move OpenCode’s database aside and try again.
  • Still stuck? Tell us what you tried at Support, including your assistant’s name and the error it showed, and we’ll reply by email.

For developers#

The server speaks Streamable HTTP at https://tactfolio.com/mcp and uses OAuth with PKCE. Clients can register dynamically or with a client metadata document; discovery starts from the WWW-Authenticate header on the first response. Request the scopes it names, mcp offline_access, to get a refresh token. Browser-based clients can call the server and the OAuth endpoints from any origin.

Agents and directories can find the server before they connect. Its MCP Server Card is at https://tactfolio.com/mcp/server-card, listed in the AI Catalog at /.well-known/ai-catalog.json. Skill installers that read /.well-known/agent-skills/index.json can add a Tactfolio skill, which teaches an agent how to connect and the workflow below.

Once connected, an agent should read two resources before building: tactfolio://builder/guide, the authoring guide with the workflow, a complete worked example, and the engine’s rules; and tactfolio://builder/contract, a compact index of the exact edit formats, which get_builder_contract expands one section at a time.

These docs are also published as plain markdown for assistants and other text readers: every page at its address plus .md (such as /docs/builder.md), all of them together in /llms-full.txt, and an index in /llms.txt.