# AI agents

Connect Claude Code, Kiro, Codex, Cursor, VS Code, claude.ai and other MCP clients to Shonin. The agent signs in as you and can do what you can do in the portal, nothing more. It never gets AWS credentials, console links or codes.

## Add Shonin to your agent

The address is your Shonin org followed by `/mcp`:

```text
https://<your Shonin org>.app.shonin.ai/mcp
```

The quickest way: in **Personal settings**, panel **AI agents**, choose **Copy** and paste the text into your agent. It has the address of your Shonin org, and the agent adds Shonin on its own. If you use the `shonin` command, you can also ask the agent "add Shonin to this agent": the skill installed by `shonin` knows how.

To do it yourself, follow the steps of your agent below. Each agent opens your browser to sign in: sign in to Shonin with your second factor, check the agent and where it goes back, then choose **Allow**. The connection lasts 8 hours.

### Claude Code

```bash
claude mcp add --transport http --scope user shonin https://<your Shonin org>.app.shonin.ai/mcp
```

Without `--scope user`, Claude Code adds Shonin only for the folder you run the command in. Then run `/mcp`, choose `shonin` and **Authenticate**.

### Codex

```bash
codex mcp add shonin --url https://<your Shonin org>.app.shonin.ai/mcp
codex mcp login shonin
```

### Cursor

Add Shonin to `~/.cursor/mcp.json`, for all your projects:

```json
{
  "mcpServers": {
    "shonin": { "url": "https://<your Shonin org>.app.shonin.ai/mcp" }
  }
}
```

If the file already has other servers, add `shonin` next to them. Cursor opens the browser when it connects to Shonin; if it does not, connect `shonin` from the MCP section of Cursor Settings.

### Kiro

Add Shonin to `~/.kiro/settings/mcp.json`, for all your workspaces:

```json
{
  "mcpServers": {
    "shonin": { "url": "https://<your Shonin org>.app.shonin.ai/mcp" }
  }
}
```

Kiro opens the browser when it connects to Shonin. In Kiro CLI, `/mcp auth` signs in again.

### VS Code

```bash
code --add-mcp '{"name":"shonin","type":"http","url":"https://<your Shonin org>.app.shonin.ai/mcp"}'
```

It adds Shonin to your user profile. VS Code opens the browser the first time it connects to Shonin. Use the agent mode of GitHub Copilot Chat to see the tools.

### claude.ai and Claude Desktop

- **Free, Pro and Max:** in **Customize > Connectors**, choose **Add custom connector**, enter the address, then **Add**. Then **Connect**.
- **Team and Enterprise:** an Owner adds Shonin in **Organization settings > Connectors**: **Add**, then **Custom**, the address, then **Add**. Each member then connects it from **Customize > Connectors**.

Leave the OAuth client ID and secret empty: Claude identifies itself on its own.

## What the agent can do

- **Everyone:** read your AWS access (accounts and permission sets assigned to you), and get the `shonin login` command for one of them. You run the command yourself: see [Command line and SDKs](command-line.md).
- **Administrators:** manage people, groups, permission sets, assignments and delegations, as in the portal and the [Assistant](assistant.md). These tools are off until a primary admin turns on **Let administrators manage the Shonin org from AI agents** in **Org settings**, panel **AI agents**. An agent connected before sees them after you reconnect it.

Shonin does not use AI for these tools: the AI is the one of your agent.

## Disconnect an agent

In **Personal settings**, panel **AI agents**, choose **Disconnect** next to the agent. Its access ends at once.

## Event log

Connections, disconnections and every change an agent makes are in the [Event log](event-log.md), with the agent that made them. Changes Shonin refused (for example after too many in one hour) are there too.
