Connect your AI assistant to Octopus with OAuth

Sign in to the Octopus remote MCP with your Octopus account. There's no API key to create, copy, or paste.

An AI assistant icon connected through the cloud to an Octopus server, with a key hanging from the connection.

We recently introduced remote MCP, the Model Context Protocol (MCP) server built into Octopus. It lets your AI assistant talk to Octopus directly, with nothing to install. People are using it to check deployment status, dig into failed tasks, and kick off runbooks without leaving their editor or chat window.

There was one bit of friction, though. To connect, you had to create an API key in Octopus, copy it, and paste it into a config file or environment variable. Then you did it again for the next assistant, and again on the next machine.

If you’ve connected GitHub or other developer tools to your AI assistant, you know it doesn’t have to be like that. You click connect, a browser opens, you sign in, you approve, and you’re done.

Octopus now works the same way: the remote MCP supports OAuth.

What it looks like

Here’s the whole flow:

  1. Add your Octopus instance’s MCP address to your assistant.
  2. Your assistant opens Octopus in your browser.
  3. Sign in if you aren’t already, choose Read-only or Full access, and select Approve access.
  4. You land back in your assistant, connected.

The Octopus consent screen, showing the assistant's name, where the authorization will be sent, and the access options

That’s it. Octopus doesn’t create a key, and nothing sits in a config file. Your assistant acts as you, at the access level you picked, and it can never do more than your account can.

Access levelWhat your assistant can do
Read-onlyUse your permissions, minus anything that makes changes
Full accessEverything you can do, in every space you have access to

A connection ends after 7 days without use, and after 20 days at most, even if you’re using it. After that, your assistant asks you to sign in again. Admins can change the 20-day limit.

Getting started with Claude Code

You’ll need:

  • Octopus Cloud, or Octopus Server 2027.0.9289 or later.
  • The remote MCP turned on. It’s on by default, under Configuration > Settings > MCP Controls.
  • A regular Octopus user account. Service accounts can’t connect with OAuth yet, but it’s on our list. See what’s next.

Swap in your Octopus address and run:

claude mcp add --transport http octopus --scope user https://your-octopus-url/mcp
claude mcp login octopus

The second command opens Octopus in your browser. Before you approve, check that the application name and the address under Authorization will be sent to match the assistant you’re connecting.

That check is worth a second of your time. If you didn’t start the connection, or the address looks unfamiliar, don’t approve it.

Back in Claude Code, run /mcp and you should see octopus connected. Now ask it something:

Which of the {space name} projects has a failed deployment to Production in the last month, and what went wrong with the last failed deployment?

Claude Code finding a failed Production deployment from the last month and explaining what went wrong, with names redacted

Claude finds the deployments, reads the task logs, and tells you what broke. No API key involved.

Other assistants

Codex. The Codex CLI, IDE extension, and ChatGPT desktop app share the same configuration, so you only need to connect once:

codex mcp add octopus --url https://your-octopus-url/mcp
codex mcp login octopus

Claude, ChatGPT, GitHub Copilot, Google Antigravity, Zed, Grok, and others. Octopus works with any assistant that supports OAuth 2.1 and Client ID Metadata Documents (CIMD). Add a remote MCP server with the address https://your-octopus-url/mcp. If your assistant asks how to authenticate, choose OAuth. Web-based assistants like claude.ai, ChatGPT, and Grok connect from their own servers, so your Octopus instance needs to be reachable from the internet.

For step-by-step setup for each assistant, see the OAuth docs. The remote MCP docs cover everything else, including API keys.

When should I use OAuth?

Whenever you can. OAuth is now the recommended way to connect an assistant to Octopus, because:

  • There’s no secret to leak. An API key is a long-lived password sitting in a file. With OAuth, there’s nothing to accidentally commit to Git or paste into Slack.
  • It’s you. Your assistant does everything as you, within your permissions. There’s no separate key to scope and keep in sync with your access.
  • Forgotten connections go away on their own. A connection you stop using ends after 7 days. An API key you forgot about is still there months later.
  • More assistants just work. Some assistants expect OAuth and don’t have anywhere to put an API key.

When to use an AI agent API key instead

  • Nobody is around to click Approve. CI pipelines, scheduled jobs, and autonomous agents run as service accounts, and service accounts can’t use OAuth yet. Use an AI agent service account with an AI agent API key.
  • You need finer-grained access. To limit an agent to specific spaces, projects, and environments (say, deploy to Staging but not Production), use an AI agent API key with custom scopes.
  • Your assistant doesn’t support CIMD.

Side by side:

OAuthAI agent API key
SetupSign in and approve in your browserCreate a key and paste it into your assistant’s config
Acts asYouThe key’s owner (a user or an AI agent service account)
AccessRead-only or Full accessRead-only, Full access, or custom scopes
Lasts7 days without use, 20 days at most, then sign in again180 days by default, configurable
Service accounts and automationNot yetYes

What’s in it for admins?

If you look after an Octopus instance, the first question is probably “Can I see what’s connected?” Here’s what you get.

Octopus audits connections. Sign-ins, issued and revoked tokens, and refusals such as a redirect URI that isn’t allowed go in the audit log. In Configuration > Audit, filter by the MCP OAuth events group, or MCP OAuth critical-events if you only care about failures and refusals. Octopus records what the assistant does with that connection as AI agent activity, tied to the person who approved it, so the AI events only filter picks it up alongside AI agent API key activity.

The audit log filtered to MCP OAuth events, showing authorization codes and access tokens issued to Claude

You decide which assistants can connect. Octopus only sends an approval back to an assistant running on the user’s own computer (localhost) or to a host on the Redirect URI allowlist. You’ll find it in Configuration > Settings > Authorization Server. It comes pre-filled with claude.ai, chatgpt.com, vscode.dev, grok.com, and console.x.ai. You can add hosts, remove the ones you don’t want, or stop allowing localhost altogether.

Why bother? It closes off a phishing trick. Without it, someone could send a user a link that looks like a normal connection request but sends the approved access somewhere the attacker controls. With the allowlist, Octopus refuses to send access anywhere you haven’t approved.

Your agent guardrails still apply. Runbooks marked “AI agents can’t run this runbook” stay off-limits, and approvals you’ve set up for agent-started runs still need a person. See restricting AI agents for the full set.

There’s still a big off switch. Clear Enable Remote MCP in Configuration > Settings > MCP Controls and no assistant can connect, with OAuth or an API key.

One thing that isn’t there yet: an admin page listing every user’s OAuth connections, like the API Keys page does for keys. For now, the audit log is where you see who connected what.

Disconnecting

Here’s something we found while testing. Removing Octopus from your assistant, or signing out of it, doesn’t always tell Octopus. Plenty of assistants just throw away their copy of the token and move on, so the connection stays valid on the Octopus side until it expires.

To disconnect properly, do it from Octopus. Go to My Profile > My Sessions, find the assistant, and revoke it. It stops working straight away.

The My Sessions page listing browser sessions and OAuth sessions for Claude and Claude Code

This is also how you change your access level. You can’t switch a connection from Read-only to Full access in place, so revoke it and connect again.

A peek under the hood

Octopus Server is now its own OAuth 2.1 authorization server, so there’s no identity provider to set up. Assistants identify themselves with Client ID Metadata Documents (CIMD), the approach the MCP authorization spec recommends. Each assistant publishes a small JSON file about itself at an HTTPS address it controls, and Octopus reads it to show you the assistant’s name, with no registration step or client secret.

What’s next

This is the first step, and we want your input on where OAuth goes from here. Here’s what we’re thinking about:

  • OAuth for service accounts. OAuth Client Credentials would let automation and autonomous agents connect to the remote MCP as a service account, without a long-lived API key. With JSON Web Token (JWT) bearer assertions, your workload proves who it is with a signed token instead of a stored secret.
  • Finer-grained access. This could be a more flexible approval screen, similar to scoped API keys, where you pick the spaces, projects, and environments your assistant can touch. Or it could be step-up authorization, where your assistant starts with less access and asks for more only when a task needs it.
  • OAuth for the Octopus CLI. Sign in to the CLI with your browser, so you can stop handing out API keys everywhere.
  • Something else? If there’s an OAuth feature you’d like that isn’t on this list, we want to hear about it.

Which of these would make the biggest difference for you? Share your feedback.

Try it out

OAuth for the remote MCP is available now on Octopus Cloud, and in Octopus Server 2027.0. Connect your assistant, ask it about your deployments, and let us know how it goes, good or bad.

Happy deployments!