Skip to Content
EngineeringNov 2, 20266 min read

The MyFundedPerps MCP Server: Letting AI Agents Read Your Trading Account

About This Blog

The MyFundedPerps MCP server is the hosted bridge between AI assistants and your trading account. MCP, the Model Context Protocol, is an open standard that lets AI applications such as Claude, Claude Code, and other MCP-capable agents call external APIs as tools. MyFundedPerps hosts a server that exposes its REST trading and read operations as tools, so an assistant can list your challenge accounts, quote markets, place and manage orders, and inspect positions and fills on your behalf. There is nothing to install or run yourself. This article covers what it does, how sign-in works, and the guardrails you should set before handing an agent the keys.

The server speaks the current stateless MCP revision (2026-07-28) over Streamable HTTP at one address:

How the MyFundedPerps MCP server authenticates

Sign-in is OAuth, and there is no API key to copy. Connect the server from your MCP client and the flow runs like this:

  1. Add the server to your MCP client and start it.
  2. The client discovers the authorization flow automatically and opens myfundedperpetuals.com/mcp/auth in your browser.
  3. Review the client name, access level, and expiry, then choose Approve.
  4. The client receives its own session and starts calling tools.

Sessions minted this way have defined limits:

Each tool call runs as one authenticated REST request under your own session, so everything in the API's idempotency and rate-limit documentation applies unchanged. Two credential rules to internalize:

  • API keys are for direct REST and SDK calls, not MCP. A live fp_live_ key sent to the MCP server is refused with a prompt to sign in with OAuth, and an MCP session cannot be replayed against the REST hosts.
  • The sandbox has no OAuth flow. To point an MCP client at sandbox accounts, send an fp_test_ key as a bearer header instead, created in API Key Settings under the Test environment.

Connecting a client

For Claude Code:

The first tool use prompts the OAuth sign-in in your browser. Any other client that supports Streamable HTTP with OAuth connects with a standard configuration:

Clients register themselves automatically through Client ID Metadata Documents and Dynamic Client Registration, so there is no manual client setup. One naming trap: the documentation site's /mcp path belongs to the docs search service and can return 401 in a browser. The trading MCP server is only at https://mcp.myfundedperpetuals.com.

What the agent can actually do

Each exposed REST operation becomes one tool, named after the matching fperp CLI command: list-accounts, get-market-quote, create-order, cancel-order, close-position, and so on. (The two CLI authentication endpoints are excluded because MCP uses its own OAuth flow.) Tool arguments use the same snake_case names as the REST API's path, query, and body fields, and schemas carry nested objects, enums, and numeric constraints, including the full protective-exit batch shapes with OCO pairing.

Tool results are JSON with three parts:

Failed calls surface as tool errors carrying error.code and per-field error.details, so an agent can correct its input and retry. Responses with status 429 include retry_after_seconds.

Idempotency: the part that protects your account

Tools for operations that require an Idempotency-Key header require an idempotency_key argument. The rules, verbatim in spirit:

  • Generate a UUID or other unique printable ASCII key, up to 128 characters, and persist it with the exact arguments before the first call.
  • Missing, empty, whitespace-only, or malformed keys are rejected before any upstream request is sent. The server echoes your key in the result.
  • Retry a lost response with the same key, identical arguments, and the same credential. Never mint a replacement key for an uncertain outcome; that starts a new operation and can create duplicate exposure.

Bulk operations like cancel-all-account-orders and close-all-account-positions can return 202 while work remains: keep the original arguments and key, wait for retry_after_seconds, and repeat the call to advance it. All trading writes advertise destructiveHint: true and idempotentHint: false; read tools advertise read-only and idempotent hints.

Guardrails worth setting before you connect

The docs say it plainly: tools placed under an AI assistant's control can cancel orders and close positions. Two precautions cost nothing:

  • Configure the client to request the read scope when the assistant only needs to observe. A read-only session can list accounts, quote markets, and inspect positions without any ability to change them.
  • Prefer a sandbox key while you evaluate an agent. Point the client at your sandbox accounts with an fp_test_ bearer token and watch how it behaves before approving live trade access.

Rate limits are the same budgets as direct REST: per-key, per-user, and platform limits, plus a per-IP abuse ceiling of about 300 requests per minute on the MCP host. A 429 comes with a Retry-After header and is always safe to retry. And the standing rule for all automation applies: the assistant operates under the same trading rules you do, and prohibited strategies stay prohibited regardless of who or what submits the order. For the rule context, see myfundedperps-rules-explained; for direct API access without an agent layer, see our MyFundedPerps API quickstart article.

Frequently asked questions

Do I need to install anything to use the MyFundedPerps MCP server?

No. The server is hosted at https://mcp.myfundedperpetuals.com and speaks MCP over Streamable HTTP. You add that URL to an MCP-capable client, sign in through OAuth in your browser, and the client starts calling tools.

Can I use my fp_live_ API key with the MCP server?

No. API keys are for direct REST and SDK calls. A live key sent to the MCP server is refused with a prompt to sign in via OAuth, and MCP sessions cannot be replayed against the REST hosts. The one exception is sandbox access, which uses an fp_test_ key as a bearer header because the sandbox has no OAuth flow.

How do I let an assistant watch my account without letting it trade?

Have the client request the read scope during the OAuth approval. Read-only sessions get observation tools only. You review the requested access level on the approval page before clicking Approve, so check it there.

How long does an MCP session last?

Ninety days after approval. You can hold up to five active sessions at once; approving a new one beyond that ceiling revokes the oldest.

What happens if the agent's tool call fails halfway?

Failed calls return the standard error envelope with error.code and per-field details. For writes, retry with the same idempotency_key and identical arguments; never generate a fresh key for an uncertain outcome, since that starts a new operation and can duplicate exposure.

More in Engineering

Keep Exploring