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

# Authentication

DevAlly's MCP uses OAuth 2.1. There are no API keys to generate or rotate — you sign in with your DevAlly account, the same one you use at `app.devally.com`.

***

## What happens on first connect

1. Your client opens a browser to a DevAlly sign-in page.
2. After you sign in, DevAlly asks which organization you want to use (if you have access to more than one).
3. Your client receives a token and stores it locally. Subsequent calls don't prompt again until the token expires.

***

## Scope and switching organizations

The token inherits the scope of the user that authorized it. If a teammate can't see a workspace in the DevAlly UI, the MCP won't surface it either.

### Working with multiple organizations

If you manage more than one organization, you don't have to disconnect and reconnect to switch between them. Add the MCP **more than once, each with a distinct name** — for example `DevAlly (Acme)` and `DevAlly (Globex)` — and authorize each one against the relevant organization. Then name the connector you mean in your prompt:

> *"In DevAlly (Acme), list all open critical issues."*

You can still re-point a single connector at a different organization by disconnecting it and re-adding it, but separate named connectors are usually easier to work with day to day.

{% hint style="warning" %}
Seeing `401` / `403` errors, or a sign-in that never completes? Your session may have expired or you may be authenticated to the wrong organization. See [Troubleshooting](/EfyQpV4281edZ3h0g8tY/integrations/devally-mcp/troubleshooting.md).
{% endhint %}


---

# 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.devally.com/EfyQpV4281edZ3h0g8tY/integrations/devally-mcp/authentication.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.
