> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/technical-reference/apis-and-mcp/mcp-authentication-and-transport.md).

# MCP Authentication and Transport

The StackAI MCP server lets a compatible client discover and call supported tools. Connect using the server’s documented transport and authentication flow.

![Confirm the account behind the connection](https://1957915746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FpvCWmyLF38RCnxc4xGWP%2Fmcp-authentication-and-transport.png?alt=media)

Send through your client after completing the documented MCP connection and authentication flow. Confirm the returned identity and organization before accessing resources. This message is not a replacement for authentication.

<details>

<summary>Copy the example</summary>

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "whoami",
    "arguments": {}
  }
}
```

</details>

## Before you begin

A compatible MCP client and an account with access to the required StackAI resources.

## MCP connection concepts

| Term           | Definition                                                                                                                                                                |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MCP server     | A server that exposes tools and other supported capabilities through Model Context Protocol. Discover the catalog available to the authenticated client.                  |
| Transport      | The communication mechanism used between an MCP client and server. The client and server must support the same connection method.                                         |
| Authentication | Verification of the account or credential making a request. It identifies the caller but does not grant every resource permission.                                        |
| Read-only mode | A server configuration that limits available operations to supported non-mutating capabilities. Discover the actual tool set; execution and mutation tools can be absent. |
| User identity  | The authenticated person or application acting on a resource. It determines access; a display name or conversation ID does not authenticate a caller.                     |

## Connect an MCP client

1. Add the documented MCP server URL to the client.
2. Complete its supported authentication flow.
3. Inspect server information and your active identity before calling tools.

The client can discover tools available to the authenticated account.

## Behavior and limitations

MCP authentication and REST API authentication are not interchangeable configuration instructions. Tool availability can depend on permissions or read-only mode. Confirm organization context before resource changes. Do not assume that successful transport setup grants access to every tool.

## Related resources

[API Versions and Compatibility](https://docs.stackai.com/technical-reference/apis-and-mcp/api-versions-and-compatibility.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/technical-reference/apis-and-mcp/mcp-authentication-and-transport.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
