Connect Hermes to AgentKit
Connect Hermes to GitHub, Gmail, and Slack through Scalekit. Install the skill, set credentials, and run one tool call.
Hermes is the self-improving AI agent from Nous Research. Hermes runs where you put it: a laptop, a small VPS, or a GPU cluster. You reach Hermes from the command line, or from a messaging app such as Slack or Telegram, and Hermes also runs work on a cron schedule.
Hermes ships with 60+ built-in tools, and the built-in tools stop at the edge of your machine. A Hermes agent that reads your Gmail, posts to your Slack, or opens a GitHub pull request needs an access token for each app. Every access token belongs to one user.
Scalekit holds the connected account for that user, stores the access token, and refreshes the access token. Hermes reaches Scalekit through a skill. A skill is an on-demand instruction set plus scripts, and Hermes loads a skill from ~/.hermes/skills/ when a chat calls for one. The skill tells Hermes how to find the Scalekit connection, how to check that the user finished auth, and how to call the tool with the stored token. The steps below install the skill.
Prerequisites
Section titled “Prerequisites”- Hermes Agent installed
- A Scalekit account with AgentKit enabled: sign up at app.scalekit.com
- At least one connection in Dashboard > AgentKit > Connections. Create the connection before you ask Hermes to use the app. See connections.
uvon yourPATH
How the skill works
Section titled “How the skill works”The skill runs the following loop when you name an app:
- The skill looks up the Scalekit connection you already created for GitHub, Gmail, or another app.
- The skill checks the user’s connected account.
ACTIVEmeans auth is complete and Scalekit holds a token. - The skill returns a magic link when the connected account is not
ACTIVE. - The skill fetches the tool schema, calls the tool, and returns the result.
- The skill calls the Scalekit HTTP proxy when the connector has no named tool.
A magic link is a one-time URL. The hosted page shows OAuth consent, or an API-key form.
Get started
Section titled “Get started”Using a coding agent?
-
Install the skill
Section titled “Install the skill”Install
hermes-delegated-authfrom authstack:Terminal window hermes skills install scalekit-inc/authstack/kits/agentkit/host/hermes-delegated-authConfirm the skill is enabled:
Terminal window hermes skills list│ hermes-delegated-auth │ │ local │ local │ enabled │Install the Python dependencies:
Terminal window cd "${HERMES_HOME:-$HOME/.hermes}/skills/hermes-delegated-auth"uv syncNew chats load
/hermes-delegated-auth. Run/resetin a chat that is already open.HERMES_HOMEchanges the skill path. The commands on this page use~/.hermes. -
Configure credentials
Section titled “Configure credentials”Put only Scalekit client credentials in
~/.hermes/.env. Scalekit stores and refreshes the provider tokens for GitHub, Gmail, and Slack. Provider tokens never belong in a Hermes file.~/.hermes/.env SCALEKIT_CLIENT_ID=skc_your_client_id# Threat: a leaked secret lets anyone call tools as any ACTIVE identifier.SCALEKIT_CLIENT_SECRET=your_client_secretSCALEKIT_ENVIRONMENT_URL=https://your-env.scalekit.cloudSCALEKIT_IDENTIFIER=usr_8f3a2cParameter Description SCALEKIT_CLIENT_IDYour Scalekit client ID Required SCALEKIT_CLIENT_SECRETYour Scalekit client secret Required SCALEKIT_ENVIRONMENT_URLYour Scalekit environment URL Required SCALEKIT_IDENTIFIERDefault user the host acts as Required Copy the client ID, client secret, and environment URL from Dashboard > Developers > Settings > API Credentials.
SCALEKIT_IDENTIFIERis not a dashboard credential. Pick an opaque id that only your system knows, for exampleusr_8f3a2c. Everytool_exec.pycommand needsSCALEKIT_IDENTIFIER, including--list-connections. -
Ask Hermes to act
Section titled “Ask Hermes to act”Start a chat and ask for a real action. Hermes acts as
SCALEKIT_IDENTIFIERby default, and Hermes passes--identifierto the skill when you name another user in the prompt.You: Who am I on GitHub?Hermes loads the skill and runs these steps:
- Hermes looks up the GitHub connection.
- Hermes checks that the connected account is
ACTIVE, and returns a magic link when the account is not. - Hermes fetches the tool schema.
- Hermes calls the tool and returns your GitHub login.
You: Show me my latest unread emailsHermes runs these steps:
- Hermes looks up the Gmail connection.
- Hermes returns a magic link when you have not authorized Gmail yet.
- Hermes fetches the tool schema.
- Hermes returns the mail.
You: Read my Notion page https://notion.so/My-Page-abc123Hermes runs these steps:
- Hermes looks up the Notion connection.
- Hermes returns a magic link when you have not authorized Notion yet.
- Hermes fetches the page tool schema.
- Hermes returns the page content.
You: As identifier usr_8f3a2c, list my unread Slack DMsHermes runs these steps:
- Hermes looks up the Slack connection.
- Hermes returns a magic link when the Slack connected account is not
ACTIVE. - Hermes fetches the Slack tool schema.
- Hermes returns the direct messages (DMs) as
usr_8f3a2c.
Create the Slack connection with User scope for the prompt above. A Slack connection with Bot scope acts as your Slack app instead of acting as the person. See the Slack connector.
You: Create an out-of-office event tomorrow on the calendar for usr_8f3a2cHermes runs these steps:
- Hermes looks up the Google Calendar connection for
usr_8f3a2c. - Hermes returns a magic link when the connected account is not
ACTIVE. - Hermes calls the create-event tool.
- Scalekit writes the event with the
usr_8f3a2ctoken.
Name the skill in the prompt to force the same path:
/hermes-delegated-auth who am I on GitHub?
Verify it works
Section titled “Verify it works”Confirm all of the following:
- The skill is listed (
hermes skills listor/skills) ashermes-delegated-auth - The connected account is
ACTIVEafter you finish the magic link - Hermes returns data from the provider (the GitHub login, or unread mail)
Open the magic link again and retry the same prompt if the account stays inactive.
Use Slack as a bot or as a user
Section titled “Use Slack as a bot or as a user”Slack issues two kinds of token, and the token decides whose name appears on a message. A bot token posts as your Slack app. A user token posts as the person who authorized the app. Authorizing the Hermes gateway grants a bot token, so the gateway alone cannot post as a person.
| Job | Use |
|---|---|
| Chat with the agent in a channel or DM | Hermes Slack gateway. Bot tokens (xoxb- + xapp-) in ~/.hermes/.env. See the Hermes Slack setup. |
| Read private history, post, or act as a user | Scalekit Slack connection created with User scope. See the Slack connector. |
The gateway bot is a channel into the agent. The gateway bot is not usr_8f3a2c.
Always-on hosts use both identities. The gateway hears the channel. Scalekit acts as the user.
Run jobs on a schedule
Section titled “Run jobs on a schedule”Attach the skill to a Hermes cron job. Each fire is a fresh session. The skill uses Scalekit client credentials. You do not mint a session token.
hermes cron create "0 9 * * *" "List unread emails for usr_8f3a2c and post a 5-line summary" --skill hermes-delegated-authOr in chat:
/cron add "every weekday at 9am" "List unread emails for usr_8f3a2c and post a 5-line summary" --skill hermes-delegated-authThe connected account must already be ACTIVE. Cron cannot click a magic link.
Leave the gateway running on a headless host. A new magic link can then land in Slack or Telegram. Do not put Gmail or Calendar refresh tokens in ~/.hermes/.env.
Avoid these mistakes
Section titled “Avoid these mistakes”- Do not put provider tokens in
~/.hermes/.env. Put only Scalekit client credentials there. - Do not set
SCALEKIT_IDENTIFIERto an email or another guessable value. - Do not use the bundled Google Workspace skill (
~/.hermes/google_token.json) if AgentKit owns the Google user.~/.hermes/google_token.jsonis one laptop login, not a per-user identifier. - Do not run
hermes mcp loginagainst Scalekit Virtual MCP (a Scalekit MCP URL plus a session token). Virtual MCP uses a static bearer session token, and a static bearer token is not MCP OAuth. - Do not treat the Slack bot token as “send as usr_8f3a2c”.
- Do not use a Hermes host as a multi-tenant identity provider. One gateway is one operator. Switch identifiers on the same host. Do not mint per-customer session tokens inside Hermes.
Next steps
Section titled “Next steps”Common scenarios
Section titled “Common scenarios”How do I authorize a new connection?
The skill returns a magic link if the account is not ACTIVE. Open the link, finish the flow on the hosted page, then return to Hermes and retry.
The hosted page adapts to the connection. An OAuth connector asks for your consent. An API key connector, such as Snowflake, asks for the credential. Hermes never collects the credential in chat.
How do I switch users?
Set SCALEKIT_IDENTIFIER in ~/.hermes/.env as the default.
Name another user in the prompt to override the default for one turn, for example as identifier usr_8f3a2c. Hermes then passes --identifier usr_8f3a2c to the skill, and Scalekit scopes the tools to that user’s connected account.
Why do I see “connection not found”?
- Confirm the connection exists in Dashboard > AgentKit > Connections
- Confirm the connection is complete, not a draft
- Confirm
SCALEKIT_ENVIRONMENT_URLmatches the environment that holds the connection
Use the connection key_id as the connection name, for example github-connect. Do not use the conn_… id.
The connected account is not ACTIVE
Check the state in Dashboard > AgentKit > Connected accounts:
| State | What you do |
|---|---|
PENDING_AUTH | Open the magic link and finish OAuth |
PENDING_VERIFICATION | Complete user verification |
EXPIRED | Open a new magic link. Scalekit cannot refresh a dead refresh token |
DISCONNECTED | Reconnect from the Dashboard, then retry |
Should I use Virtual MCP instead?
No, not as the default. Hermes is a long-lived host. The skill calls execute_tool with client credentials. You do not mint a session token.
Virtual MCP is a Scalekit MCP URL plus a session token that your app mints. Hermes gateway and cron stay up for days. A bearer token in ~/.hermes/.env expires. There is no shipped remint hook.
Use Virtual MCP in your app for a short agent run (Claude Managed Agents, Mastra, CrewAI), or for a short hermes chat demo:
- Create a Virtual MCP config in the Dashboard.
- Mint a session token for one identifier.
- Point Hermes at the static
mcp_server_urlwithAuthorization: Bearer ${SCALEKIT_MCP_SESSION_TOKEN}. - Start a new chat before the token expires.
Do not set auth: oauth on the Virtual MCP server.
Why does hermes mcp login fail against Scalekit?
hermes mcp login is for vendor MCP OAuth. Scalekit Virtual MCP is a static URL plus a session token that your app mints.
Use the hermes-delegated-auth skill, or set a bearer header as in Set up a Virtual MCP server.