Developers

MCP Server

TrainerStudio hosts an MCP (Model Context Protocol) server that lets AI assistants interact with your coaching data directly. No code required — just point your client to the server URL and start chatting.

https://api.trainerstudio.io/mcp

What is MCP?

Model Context Protocol is an open standard that lets AI assistants connect to external tools and data sources. Instead of writing API calls yourself, the AI handles everything through natural conversation.

With TrainerStudio's MCP server, you can say things like:

  • "Show me all my active clients"
  • "Create a leg day workout for María on Thursday"
  • "What exercises target the glutes?"

The AI translates your instructions into API calls automatically.

Authentication

Use either an API key in the X-API-Key header or the server's OAuth flow when your MCP client supports it. Create an API key from Settings → API Keys in the coach app; see Authentication. Clients that cannot send custom headers should use OAuth. A normal REST session bearer token is not an MCP OAuth token.

Configure a remote Streamable HTTP connection using the settings below. Configuration files and settings screens differ by client; use your client's remote-server configuration rather than assuming a shared JSON format.

Connect with any MCP client

Any client that supports the MCP standard can connect using:

SettingValue
Server URLhttps://api.trainerstudio.io/mcp
TransportHTTP (Streamable HTTP)
Auth headerX-API-Key: your-api-key

Available tools

Once connected, your AI assistant can use these tools:

ToolDescription
List clientsGet a page of clients, with search and filters
Create clientAdd a new client with name and email
Get workoutsView programmed workouts for a client
Create workoutProgram a workout block with exercises
List exercisesBrowse the exercise library
Track metricsRead assigned metric sets and recorded metric history

The full list of available tools is discovered automatically by your AI client when it connects — no manual configuration needed.

Request contract and errors

MCP uses JSON-RPC over POST /mcp; it is separate from the REST OpenAPI reference. GET /mcp and DELETE /mcp do not provide session streams or session deletion in this stateless server. Let the MCP client handle transport negotiation and initialization.

Discover tool input schemas with tools/list. Tool parameters and defaults can differ from REST endpoints: for example, list_customers uses page (default 1), pageSize (default 20, maximum 100), search, isArchived (default false), and groups. Do not copy those names or defaults into GET /coach/customers.

Missing or invalid credentials produce HTTP 401. Missing credentials also include a WWW-Authenticate header pointing to OAuth resource metadata. Protocol errors use JSON-RPC errors; tool failures can return an isError result. Inspect those results even when HTTP transport succeeds. OAuth clients discover authorization and token endpoints from the server metadata.

Example conversation

Once connected, a conversation might look like this:

You: How many active clients do I have?

AI: You have 47 active clients. Would you like to see the full list?

You: Create a push day for Carlos next Monday with bench press, overhead press, and lateral raises.

AI: Done! I created a "Push Day" workout for Carlos on Monday May 18th with 3 exercises: Bench Press, Overhead Press, and Lateral Raises. Each exercise has 3 sets programmed. Want me to adjust the sets or add more exercises?

Next steps

On this page