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/mcpWhat 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:
| Setting | Value |
|---|---|
| Server URL | https://api.trainerstudio.io/mcp |
| Transport | HTTP (Streamable HTTP) |
| Auth header | X-API-Key: your-api-key |
Available tools
Once connected, your AI assistant can use these tools:
| Tool | Description |
|---|---|
| List clients | Get a page of clients, with search and filters |
| Create client | Add a new client with name and email |
| Get workouts | View programmed workouts for a client |
| Create workout | Program a workout block with exercises |
| List exercises | Browse the exercise library |
| Track metrics | Read 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
- Authentication — create your API key
- AI Agents — build custom agents with the REST API
- API Reference — explore all available endpoints