# update()

Canonical URL: https://developers.iagenify.com/sdk/ref/mcp/update/
Language: en

`api.mcp.update(name, { tools?, category?, token?, label?, url? }) → Promise<Server>`

Change the allowed tools, the permission category, the token, the label or the address. Only what you pass is touched.

Status: PATCH · tools replaces the list · a new address is checked

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `tools` | string[] |  | **Replaces** the allowed list. `[]` allows none. |
| `category` | string |  | `read` · `write` · `exec`. |
| `token` | string|null |  | A new token, cleaned the same way. `null` removes it. |
| `label` | string |  | The display name. |
| `url` | string |  | A new address — checked like a new connection. |

```javascript
// Allow two tools and nothing else
await api.mcp.update("example", { tools: ["search_docs", "get_issue"] });

// Make them free to call in auto mode
await api.mcp.update("example", { category: "read" });

// Rotate the token
await api.mcp.update("example", { token: process.env.EXAMPLE_TOKEN_NEW });

// Turn the server off without disconnecting it
await api.mcp.update("example", { tools: [] });
```

## tools replaces, it does not add {#replaces}

> **Pass the whole list you want**
>
> Sending one name leaves exactly one tool allowed. To add one, read the current list with get() and send it back with the addition.

```javascript
const server = await api.mcp.get("example");
const allowed = server.tools.filter((t) => t.allowed).map((t) => t.name);
await api.mcp.update("example", { tools: [...allowed, "create_issue"] });
```

## Changing the category is a permission decision {#category}

`read` makes every tool of that server free to call in every mode but plan. Set it only when you know what all of them do — the category is the server's, not the tool's, so one write among reads is enough reason to leave it at `exec`.

## A new address goes through the same check {#url}

Scheme, and that it resolves publicly. An address that does not pass is refused with `url_blocked` and the connection is left as it was.

## Turning a server off {#off}

`tools: []` keeps the connection and its token while declaring nothing. Useful to stop a misbehaving server reaching any run, without losing the credential.

- [Allowed tools](/sdk/mcp/allowed-tools): Why none is allowed by default.
- [disconnect()](/sdk/ref/mcp/disconnect): Removing it entirely.
- [api.mcp](/sdk/ref/mcp): Connecting, listing and using a server.

```python
import os

# Allow two tools and nothing else
api.mcp.update("example", tools=["search_docs", "get_issue"])

# Make them free to call in auto mode
api.mcp.update("example", category="read")

# Rotate the token
api.mcp.update("example", token=os.environ["EXAMPLE_TOKEN_NEW"])

# Turn the server off without disconnecting it
api.mcp.update("example", tools=[])
```

```python
server = api.mcp.get("example")
allowed = [t["name"] for t in server["tools"] if t["allowed"]]
api.mcp.update("example", tools=[*allowed, "create_issue"])
```
