AI agents

AI agents for investment research

How Claude, Cursor, ChatGPT, and custom agents build and backtest systematic strategies through a finance MCP server or the REST API.

AI assistants are good at reasoning about investment ideas and bad at testing them, because testing requires clean historical data, a correct implementation of the rule, and a place to run it. Giving an assistant those things as tools is what turns a conversation about a strategy into a backtest of it. This section explains how that works: what a finance MCP server is, how to connect Claude, Cursor, and other agents to ENSEMBLE, and what an agent can do once it is connected.

What changes when an agent has tools

Without tools, an assistant asked about a dual momentum strategy can describe the rule, cite the original paper, and speculate about how it might have performed. With tools, it can build the strategy, run it against twenty years of daily data, read the tear sheet, notice that turnover is higher than expected, propose a variation, and run that too. The conversation becomes an iteration loop, and the assistant's role shifts from explaining to researching.

ENSEMBLE was built for that loop. Every capability of the platform is available as a tool: create a model from a description, revise it, read its metrics and holdings, compose models out of other models, schedule reruns, and receive webhooks when allocations change. The finance MCP server guide explains each tool and when an agent should reach for it.

Two ways to connect

Agents differ in what they can do, so the platform offers two surfaces at two levels of setup.

The hosted MCP server. MCP clients connect to https://api.ensemble.markets/mcp over Streamable HTTP, authenticate with OAuth or an API key, and receive the full toolset. This is the right surface for Claude Desktop, Claude Code, Cursor, and VS Code. The backtest with Claude walkthrough shows the setup and a real session.

The REST API. Custom agents and pipelines call the same endpoints the MCP server wraps, with an OpenAPI schema and a generated TypeScript client. The REST API page covers authentication, rate limits, and the shape of each resource.

All three surfaces produce the same models. A strategy built by ChatGPT through the GET interface can be read and revised by Claude through MCP and monitored by a cron job through REST.

What good agent workflows look like

The agents that get the most from a backtesting tool follow a pattern that human researchers would recognize.

  1. State the hypothesis before building. A good agent turns "what about momentum?" into a specific rule with a universe, a lookback, and a rebalancing cadence before it calls the build tool. Vague prompts produce models whose results cannot be interpreted.
  2. Read the whole tear sheet, not the headline. The get_model tool returns metrics, the trading universe the code actually used, run metadata such as rebalances per year, and any QA findings. An agent that reads only CAGR will miss that the rule traded twice as often as intended.
  3. Change one thing at a time. Revising a model with a new prompt keeps the old version's history, so an agent can compare a 10-month lookback to a 12-month lookback directly rather than reasoning about the difference.
  4. Compose rather than complicate. When two models each do something useful, the right move is often a model that holds both, not a single model with more rules. Models hold assets, other models, or both, to any depth, for exactly this.

The guides in this section include real transcripts that show these patterns, including the moments where the agent gets something wrong and corrects it.

Why a hosted server rather than a local one

Most finance MCP servers you will find on GitHub run locally, wrap a data vendor's API, and require you to supply your own keys. That works for lookups. It does not work for backtesting, because a backtest needs a sandbox to execute generated code, a maintained dataset with survivorship handled, and a place to store the result so that it can be revisited, shared, and rerun tomorrow with new data.

A hosted server provides all of that behind one URL. The agent never handles market data directly, never runs untrusted code on your machine, and never has to reimplement a Sharpe ratio. The trade-off is that you are trusting the platform's methodology, which is why every model's generated code is readable and every metric is documented on the methodology page.

Scope

This section is about using agents for systematic investment research. It is not about live trading, order routing, or portfolio management, none of which ENSEMBLE does. Models produce target allocations that a human or a downstream system can act on; the platform never holds assets or places trades. Backtests are hypothetical, past performance does not guarantee future results, and ENSEMBLE is research software rather than an investment adviser.

Start with the finance MCP server guide if you want to understand the tools, or go straight to backtest with Claude if you want to connect and run something in the next ten minutes.

Guides in this section

  1. 01What is a finance MCP server, and is there one for backtesting?A finance MCP server gives an AI assistant tools for investment research. This guide explains how MCP works, what separates a data-lookup server from a backtesting server, hosted versus local servers, authentication, and the tools ENSEMBLE's server exposes.
  2. 02How to backtest a strategy with ClaudeConnect Claude Desktop or Claude Code to ENSEMBLE's MCP server and backtest a strategy in conversation. Setup for both clients, a real session from idea to tear sheet to revision, and the prompts that get good results from an agent.

Frequently asked questions

What is an MCP server for finance?
A Model Context Protocol server exposes a set of tools that an AI assistant can call. A finance MCP server gives the assistant tools for tasks like building and backtesting a strategy, looking up an asset, or reading a model's holdings. ENSEMBLE runs a hosted MCP server at api.ensemble.markets/mcp that any MCP client can connect to.
Do I need an API key to let an agent use ENSEMBLE?
The agent authenticates with OAuth (a sign-in the MCP client opens for you) or an ensemble_ API key from the dashboard. Either one unlocks the full toolset, including private models, schedules, and webhooks. Every account starts with $100 in credit and no card required.
Which AI assistants work with ENSEMBLE?
Any MCP client, including Claude Desktop, Claude Code, Cursor, VS Code with Copilot, and Windsurf. Assistants without MCP support, such as ChatGPT with web browsing, can use the GET interface. Custom agents can use either surface or the REST API directly.

Other sections

Backtests are illustrative. Past performance does not guarantee future results. ENSEMBLE is a software platform, not an investment adviser.

Describe a strategy. Read the tear sheet.Connect the MCP server