Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added openhands/static/img/mcp-credential-broker.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions openhands/usage/settings/mcp-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,39 @@ Direct stdio connections may still be appropriate in these scenarios:

For production use, we recommend using proxy tools like SuperGateway.
</Tab>
<Tab title="Credential Broker (SHTTP)">
A credential broker lets the agent call an API such as GitHub without the token being in its environment.
The token stays in the broker's vault. The agent names a binding, a method and a path; the broker checks what
a person allowed, adds the token, sends the request and returns the response.

This example uses [1Claw](https://1claw.co), which provides a hosted MCP server. In 1Claw, store the token,
create an agent, and give it a binding that says what it may call, for example `GET` only on one repository.
Then add the server with `Add custom server`:

| Field | Value |
|-------|-------|
| `Server Type` | `SHTTP` |
| `Server name` | `1claw` |
| `URL` | `https://mcp.1claw.co/mcp` |
| `Authentication` | `Header` |

In `Headers`, enter the tool set and the 1Claw agent's key:

```text
X-1Claw-Toolsets=execute
Authorization=Bearer <1Claw agent key>
```

`X-1Claw-Toolsets=execute` gives the agent only the tools for brokered calls. Click `Test connection`; a working
setup reports `Connected — 9 tool(s) available`.

In a new conversation, the agent can call the `execute_http` tool with the binding's name. A request outside
the binding's limits is refused by the broker, whatever the prompt says:

![Agent Canvas: adding the broker as a custom MCP server, then a conversation where the agent finds no GitHub token in its environment, reads a repository through the broker, and is refused a DELETE request](/openhands/static/img/mcp-credential-broker.gif)

Access is revoked per agent in the broker, without rotating the token.
</Tab>
</Tabs>

Other options include:
Expand Down
6 changes: 6 additions & 0 deletions openhands/usage/settings/secrets-settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ For security, the existing value is not displayed. Enter a replacement value whe
secret named `OPENAI_API_KEY`, you can access it in your code as `process.env.OPENAI_API_KEY` in JavaScript or
`os.environ['OPENAI_API_KEY']` in Python.

<Note>
For an HTTP API, the agent can also use a credential without it being exported at all, through a credential broker
connected as an MCP server. See the Credential Broker example in
[MCP Settings](/openhands/usage/settings/mcp-settings#configuration-examples).
</Note>

## Agent-Requested Secrets

Secrets saved in `Settings > Secrets` reach conversations that start after the save. During a conversation, the agent can also ask for a credential it needs for the current task.
Expand Down