How to Connect Action Gateway Toolspublic
Last verified 22 Oct 2026
Action Gateway connects applications and AI agents to tools through a managed MCP endpoint or SDK, with the accounts and permissions you choose. See What You Can Build for standalone agent examples.
An Action Gateway session gives you an MCP endpoint (URL) with the tools and permissions you choose. Add the URL to your MCP client and authenticate with DigitalOcean to use those tools. You can create the session in the Control Panel or with DigitalOcean’s Python, Go, or TypeScript SDK.
For a guided setup with one read-only tool, use the Action Gateway Quickstart. Harness Runtime integration is documented separately in Connect Action Gateway to Harness Runtime.
Prerequisites
- Access to Action Gateway.
Some tools, including Exa web search and web fetch, require a positive prepaid balance. Prepayment is not required for every tool.
Connect an External MCP Client
Use the session URL with a client that supports remote Streamable HTTP MCP servers, such as a coding agent, OpenClaw, Hermes, or ChatGPT. Authentication setup and support for approval prompts depend on the client.
- Create an Action Gateway session in the Control Panel with the tools and permission policy you need. For your own client, keep the default actor ID.
- Copy the session’s MCP endpoint.
- Register the URL as a Streamable HTTP MCP server in your client.
- Authenticate through your client’s browser sign-in flow as the DigitalOcean user who created the session, in the same team.
- Restart the client or reload its MCP configuration if required, then confirm the server connects.
In the following commands, replace <action-gateway-session-mcp-url> with the copied endpoint.
For Codex, add the server and start browser sign-in:
codex mcp add action-gateway --url "<action-gateway-session-mcp-url>"
codex mcp login action-gatewayFor Claude Code, add the server:
claude mcp add --transport http action-gateway "<action-gateway-session-mcp-url>"In Claude Code, run /mcp, select action-gateway, and follow the browser sign-in prompts.
This signs the client in to Action Gateway, not to GitHub, Linear, or another external service. For tools that access those accounts, create provider connections using the session’s actor ID. You can connect accounts later without changing this MCP URL.
For calls that use ask, your client must support gateway approval. A connected MCP server does not by itself guarantee inline approval prompts.
Create a Session Using an SDK
Create a DigitalOcean personal access token authorized for Action Gateway in your team and make it available locally as DIGITALOCEAN_TOKEN. Do not paste the token into an agent conversation or commit it to source control.
The following examples create a session with one selected, read-only tool and explicit permissions for search and invocation. Replace <actor-id> with your stable actor ID. The printed URL is the endpoint to register with an MCP client.
Install PyDo:
pip install pydoCreate action_gateway_session.py with the following content:
import os
from pydo.action_gateway import ActionGatewayClient
gateway = ActionGatewayClient(token=os.environ["DIGITALOCEAN_TOKEN"])
session = gateway.session.create(
actor_id="<actor-id>",
tools=["digitalocean_size-list"],
permissions={
"default_action": "deny",
"rules": [
{"tool": "action_search", "action": "allow"},
{"tool": "action_invoke", "action": "allow"},
{"tool": "digitalocean_size-list", "action": "allow"},
],
},
)
print(session.url)Run the file to create the session and print its MCP URL:
python action_gateway_session.pyInstall the DoTs build that includes Action Gateway support in your TypeScript project:
npm install @digitalocean/[email protected]Add the following session creation code to your application and run it with your project’s TypeScript tooling:
import { ActionGatewayClient } from "@digitalocean/dots/action_gateway";
const gateway = new ActionGatewayClient({
apiKey: process.env.DIGITALOCEAN_TOKEN!,
});
const session = await gateway.session.create({
actorId: "<actor-id>",
tools: ["digitalocean_size-list"],
permissions: {
defaultAction: "deny",
rules: [
{ tool: "action_search", action: "allow" },
{ tool: "action_invoke", action: "allow" },
{ tool: "digitalocean_size-list", action: "allow" },
],
},
});
console.log(session.url);Install Godo:
go get github.com/digitalocean/godoCreate action_gateway_session.go with the following content:
package main
import (
"context"
"fmt"
"os"
"github.com/digitalocean/godo"
)
func main() {
client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
ctx := context.Background()
session, _, err := client.ActionGateway.Sessions.CreateRuntime(ctx, &godo.ActionGatewaySessionCreateRequest{
ActorID: "<actor-id>",
Tools: []string{"digitalocean_size-list"},
Policy: &godo.ActionGatewaySessionPolicy{
DefaultAction: "deny",
Rules: []godo.ActionGatewaySessionPolicyRule{
{Tool: "action_search", Action: "allow"},
{Tool: "action_invoke", Action: "allow"},
{Tool: "digitalocean_size-list", Action: "allow"},
},
},
})
if err != nil {
panic(err)
}
fmt.Println(session.MCPURL)
}Run the file to create the session and print its MCP URL:
go run action_gateway_session.goFind Tools in a Large Catalog
Use action_search to discover tools within the session’s selected catalog, then action_invoke to run one with its documented arguments. Search results do not expand permissions.
To access a third-party provider, authorize a connection for the session’s actor. To reuse a versioned collection of tools, create a Toolbelt.