> ## Documentation Index
> Fetch the complete documentation index at: https://stage-docs.getswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Myles in your AI assistant

> Connect Claude, ChatGPT, Cursor, VS Code or any MCP client to Myles and ask about your fleet without leaving your tools.

Myles is the SWITCH assistant for your fleet. Through the **Model Context Protocol (MCP)** you can ask Myles from the AI tools you already use, and get the same answers as in the SWITCH Copilot chat: data and analytics, forecasts, live status, operations and your connected integrations.

You sign in with your SWITCH account: there is no API key to copy.

## Before you start

* A **SWITCH account**, the one you use for the [SWITCH Copilot](https://copilot.getswitch.io).
* **Myles in other AI tools** turned on for your company. A company admin turns it on in the Copilot settings; if it is off, Myles answers *"Myles over MCP is not enabled for this company"*.
* An AI tool that supports remote MCP servers with sign-in (OAuth). All the tools below do.

The server address is the same for every tool:

```text theme={null}
https://api.getswitch.io/mcp
```

## Connect your tool

> [tab] Claude
>
> Works in Claude on the web and in the Claude desktop app.
>
> **1. Add the connector**
>
> Open **Settings → Connectors** and choose **Add custom connector**. Name it `SWITCH Myles` and paste `https://api.getswitch.io/mcp` as the URL.
> On Team and Enterprise plans, an owner may have to add the connector for the organization first.
>
> **2. Connect and sign in**
>
> Click **Connect**. A SWITCH page opens: sign in, check what Claude is asking for, and click **Allow**.
>
> **3. Ask**
>
> In a new chat, make sure the connector is enabled in the tools menu, then ask, for example: *"Ask Myles how many vehicles were unavailable yesterday."*

> [tab] Claude Code
>
> **1. Add the server**
>
> ```bash theme={null}
> claude mcp add --transport http switch-myles https://api.getswitch.io/mcp
> ```
>
> Add `--scope user` to make it available in every project.
>
> **2. Sign in**
>
> Start `claude`, run `/mcp`, select `switch-myles` and choose **Authenticate**. Your browser opens the SWITCH sign-in and consent page; click **Allow**.
>
> **3. Ask**
>
> *"Use switch-myles to show me yesterday's top 5 stations by trips."*

> [tab] ChatGPT
>
> **1. Turn on developer mode**
>
> Open **Settings → Apps & Connectors → Advanced settings** and turn on **Developer mode** (your workspace admin may have to allow it).
>
> **2. Create the connector**
>
> In **Apps & Connectors**, choose **Create**. Name it `SWITCH Myles`, paste `https://api.getswitch.io/mcp` as the MCP server URL and pick **OAuth** as authentication.
>
> **3. Sign in and ask**
>
> Connect, sign in to SWITCH and click **Allow**. In a chat, add the connector from the tools menu and ask your question.

> [tab] Cursor
>
> **1. Add the server**
>
> Open **Cursor Settings → MCP → Add new MCP server**, or add it to `~/.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "switch-myles": {
>       "url": "https://api.getswitch.io/mcp"
>     }
>   }
> }
> ```
>
> **2. Sign in**
>
> The server shows **Needs login**: click it, sign in to SWITCH and click **Allow**.
>
> **3. Ask**
>
> In Agent mode: *"Ask switch-myles which zones will be undersupplied tomorrow morning."*

> [tab] VS Code
>
> **1. Add the server**
>
> Run **MCP: Add Server** from the Command Palette, choose **HTTP** and paste `https://api.getswitch.io/mcp`, or add it to `.vscode/mcp.json`:
>
> ```json theme={null}
> {
>   "servers": {
>     "switch-myles": {
>       "type": "http",
>       "url": "https://api.getswitch.io/mcp"
>     }
>   }
> }
> ```
>
> **2. Sign in**
>
> Start the server. VS Code asks to sign in: allow it, sign in to SWITCH and click **Allow**.
>
> **3. Ask**
>
> In Copilot Chat agent mode, enable the `switch-myles` tools and ask your question.

> [tab] Other MCP clients
>
> Any client that supports the MCP **Streamable HTTP** transport and OAuth sign-in can connect:
>
> * **Server URL:** `https://api.getswitch.io/mcp`
> * **Authorization:** OAuth 2.1 with PKCE, discovered from the server (`/.well-known/oauth-protected-resource/mcp`). Clients can identify themselves with a Client ID Metadata Document or register dynamically.
> * **Scope:** `mcp:agent`

> [!NOTE]
>
> The sign-in page is a SWITCH page on `copilot.getswitch.io`. It names the tool asking for access: only click **Allow** for a tool you are setting up yourself.

## What Myles can do

Your AI tool sees two tools. You don't call them yourself: ask in plain language and your assistant uses them.

### `ask_myles`

Asks Myles a question and returns the full answer, with links to any files Myles produced (they open in the SWITCH Copilot).

| Parameter | Description |
| - | - |
| `query` | Your question. |
| `session_id` | Continue an earlier conversation. Every answer ends with `session_id: <id>`; assistants pass it back on their own. |
| `model_tier` | `fast` (default) or `deep`: the strongest model, about 3× the credits. |
| `thinking_effort` | `low`, `medium` (default) or `high`. More effort thinks longer and uses more credits. |

If you don't set `model_tier` or `thinking_effort`, Myles uses your saved choice from the Copilot. If your company has turned the model selector off, the defaults are used.

### `confirm_myles_action`

Some actions change things in your fleet or in your connected tools, for example an action Myles would run in one of your connected integrations. Myles never runs them on its own: the answer ends with an **Action awaiting confirmation** section describing exactly what would happen.

Your assistant should then ask you. When you approve or refuse, it calls `confirm_myles_action`, and Myles reports what actually happened.

## Credits and limits

* Answers use your company's SWITCH credits exactly like the Copilot chat; `deep` and higher thinking effort cost more.
* Each person can have **2** answers running at once, and each company **4**. Beyond that Myles answers `too_many_turns`: wait for the other answer to finish.
* An answer can take up to **5 minutes**. Long questions show progress in tools that display it.
* Conversations started from your AI tool appear in your Copilot history, so you can continue them there.

## Troubleshooting

| Message | What to do |
| - | - |
| Sign-in loop or `401` | Disconnect the connector and connect again; make sure you sign in with your SWITCH account. |
| `access_denied: Myles over MCP is not enabled for this company` | Ask your company admin to turn on **Myles in other AI tools** in the Copilot settings. |
| `too_many_turns` | You (or your company) already have answers running. Wait and ask again. |
| `account_inactive` | Your SWITCH account is deactivated. Contact your company admin. |
| Out of credits | Top up or upgrade in the Copilot under **Billing**. |
| The tool times out before Myles answers | Ask a narrower question, or raise the tool's MCP timeout if it has one (answers can take up to 5 minutes). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.