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
18 changes: 16 additions & 2 deletions docs/manage-sandboxes/add-mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,16 @@ NemoClaw records the normalized host and every validated address as OpenShell po
The raw bearer value passes transiently to the OpenShell provider and remains absent from NemoClaw state, sandbox configuration, command arguments, and logs.
The sandbox configuration contains only an OpenShell resolver placeholder for `LOCAL_MCP_TOKEN`, not the raw bearer value.
You can unset the host variable after `mcp add` returns because OpenShell retains the credential.
To replace it, remove and re-add the server with the replacement exported under the same host variable name. `mcp remove` detaches the provider, and sandbox destroy may leave the detached provider for explicit operator cleanup.
To replace it, record any `--deny-tool` selectors and run `mcp remove` first.
`mcp remove` deletes the generated policy that holds them.
If removal reports an `MCP cleanup warning`, resolve it before you continue.
If removal reports a preserved provider, follow [Add Reports an Existing Provider](../../reference/troubleshoot-mcp-servers#add-reports-an-existing-provider) before re-adding the server.
If it reports no preserved provider, skip provider deletion.
Export the replacement credential under the same host variable name.
If the original command used `NEMOCLAW_TRUSTED_PRIVATE_HOSTS`, export it again before re-adding the server.
Otherwise, pass the same `--trusted-private-host` value.
Run `mcp add` with each recorded `--deny-tool` selector and the recorded trusted-private declaration.
`mcp remove` and `destroy` keep the provider until you delete it.

Inspect the registration after the add returns:

Expand Down Expand Up @@ -186,7 +195,12 @@ NemoClaw binds each dedicated provider to its generated MCP endpoint, so OpenShe
One normalized endpoint URL can have only one credential-bound managed server definition in a sandbox.
If two definitions need different credentials, retain one definition for that URL or configure distinct endpoint URLs so OpenShell can select one credential unambiguously.

If this server uses the profile-less `generic` provider from an earlier NemoClaw build, remove it and add it again with the credential exported.
If this server uses the profile-less `generic` provider from an earlier NemoClaw build, record its `--deny-tool` selectors, then run `mcp remove`.
`mcp remove` deletes the generated policy that holds them.
If removal reports an `MCP cleanup warning`, resolve it before you continue.
If removal reports a preserved provider, follow [Add Reports an Existing Provider](../../reference/troubleshoot-mcp-servers#add-reports-an-existing-provider) before re-adding the server.
If it reports no preserved provider, skip provider deletion.
Add the server again with the credential exported, and pass `--deny-tool` again for each recorded selector.
That provider cannot be bound to an endpoint, so restart and rebuild fail closed until you recreate the registration.

## Meet Endpoint Requirements
Expand Down
62 changes: 52 additions & 10 deletions docs/manage-sandboxes/manage-mcp-servers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,38 @@ The bare `mcp list` and `mcp status` forms never probe, so they stay fast. Endpo

## Rotate a Credential

Export the replacement under the same host environment name used by `mcp add`, remove the native registration, and add it again so NemoClaw creates a fresh provider binding:
Before you remove the server, record its `--deny-tool` selectors.
`mcp remove` deletes the generated policy that holds them.
Export the replacement under the same host environment name used by `mcp add`, and remove the native registration:

```bash
export GITHUB_MCP_TOKEN='replacement-value'
$$nemoclaw my-sandbox mcp remove github
```

If removal reports an `MCP cleanup warning`, resolve it before you continue.
If removal reports a preserved provider, follow [Add Reports an Existing Provider](../../reference/troubleshoot-mcp-servers#add-reports-an-existing-provider) before re-adding the server.
If it reports no preserved provider, skip provider deletion.
For a trusted-private entry, pass the same reviewed `--trusted-private-host` value to `add`, or export `NEMOCLAW_TRUSTED_PRIVATE_HOSTS` again when the original command used it.
Pass `--deny-tool` again for each recorded selector, or omit it when the original registration had none.
Add the server again so NemoClaw creates a new provider with the replacement credential and reconnects the native registration:

```bash
$$nemoclaw my-sandbox mcp add github \
--url https://api.githubcopilot.com/mcp/ \
--env GITHUB_MCP_TOKEN
unset GITHUB_MCP_TOKEN
```

`remove` deletes the agent-native registration and detaches the exact managed provider, but conservatively preserves the provider object. Remove that preserved provider explicitly after confirming no sandbox uses it; then `add` creates a new provider with the replacement credential and reconnects the native registration.

For a trusted-private entry, pass the same reviewed `--trusted-private-host` value to `add`; NemoClaw resolves and records the replacement pins again. For a public entry, `add` resolves the hostname and creates a policy for the current validated public addresses.
NemoClaw resolves and records the replacement pins again. For a public entry, `add` resolves the hostname and creates a policy for the current validated public addresses.

The raw value passes only through the OpenShell provider command's process environment and is not added to argv, NemoClaw state, or sandbox config. Revoke the old credential upstream after the new add succeeds.

If the provider was deleted, restart reports the source as unbound. Remove and add the server again when you intend to create a replacement provider.

Restart follows the live policy credential binding and reloads only when the current provider ID, type, attachment, and credential-key metadata agree with the agent registration. It does not recreate or update the provider and does not reapply policy. If a source is missing or conflicting, repair it explicitly or remove and add the server again.
Restart follows the live policy credential binding and reloads only when the current provider ID, type, attachment, and credential-key metadata agree with the agent registration.
It does not recreate or update the provider and does not reapply policy.
If a source is missing or conflicting, repair it explicitly, or remove and add the server again as described above.

Running restart without a server name validates and reloads every managed server at its current credential handle. It does not rotate credentials.

Expand Down Expand Up @@ -206,20 +218,31 @@ Successful tool discovery verifies that the endpoint is reachable through its ex

For a trusted-private server, review every destination change before NemoClaw records new pins. Neither status, restart, rebuild, nor restore changes the recorded address set.

If the endpoint moves to another address, remove and re-add the server:
If the endpoint moves to another address, record the existing `--deny-tool` selectors first.
`mcp remove` deletes the generated policy that holds them.
Export the credential and remove the server:

```bash
export LOCAL_MCP_TOKEN='replace-with-secret-manager-value'
$$nemoclaw my-sandbox mcp remove local-tools
```

If removal reports an `MCP cleanup warning`, resolve it before you continue.
If removal reports a preserved provider, follow [Add Reports an Existing Provider](../../reference/troubleshoot-mcp-servers#add-reports-an-existing-provider) before re-adding the server.
If it reports no preserved provider, skip provider deletion.
If the original command used `NEMOCLAW_TRUSTED_PRIVATE_HOSTS`, export it again.
Pass `--deny-tool` again for each recorded selector, or omit it when the original registration had none.
Use the recorded `--trusted-private-host` value when the original registration used that option.
Add the server again to perform a new DNS preflight and record the reviewed address set:

```bash
$$nemoclaw my-sandbox mcp add local-tools \
--url https://mcp-host.corp.example/mcp \
--env LOCAL_MCP_TOKEN \
--trusted-private-host mcp-host.corp.example
unset LOCAL_MCP_TOKEN
```

Removing the server deletes the agent-native entry, removes its generated key from the current OpenShell policy, and detaches the provider. The provider itself is preserved for explicit cleanup. The re-add performs a new DNS preflight and records the reviewed exact address set.

## Remove a Server

For a legacy registration, removal requires a committed registry row that proves ownership of the named entry.
Expand All @@ -234,6 +257,10 @@ The retry verifies that the entry is still absent and compares any remaining pol
Provider detachment still requires an exact match with the live provider identity.
NemoClaw preserves unproven entries and refuses removal when the same server exists in both legacy and native configuration.

If you plan to add this server again, record its current `--deny-tool` selectors before removal.
Also record its trusted-private declaration from `--trusted-private-host` or `NEMOCLAW_TRUSTED_PRIVATE_HOSTS`.
Removal deletes the generated policy, and NemoClaw does not retain the environment declaration after `mcp add` returns.

Remove the named registration:

```bash
Expand All @@ -246,7 +273,11 @@ Removing a server blocks new requests and reconnects but does not terminate a re

Policy removal targets the deterministic current MCP policy key. Force never claims an unrelated policy or provider.

NemoClaw removes the agent registration first, removes the policy key, and then detaches a provider only when the live policy binding, provider ID, type, and credential key agree. This ordering blocks new agent use before cleanup. The workspace provider is retained because current OpenShell provider deletion is name-based.
NemoClaw removes the agent registration first, removes the policy key, and then detaches a provider only when the live policy binding, provider ID, type, and credential key agree.
This ordering blocks new agent use before cleanup.
When the workspace provider exists, NemoClaw preserves it because current OpenShell provider deletion is name-based.
If you plan to add the same server name again and `mcp remove` reports a preserved provider, follow [Add Reports an Existing Provider](../../reference/troubleshoot-mcp-servers#add-reports-an-existing-provider) before you add the server again.
If `mcp remove` reports no preserved provider, skip provider deletion.

If cleanup leaves a residual, the command reports the exact policy or attachment warning and the provider name to inspect. It never detaches the provider from another sandbox or silently reports that the provider was deleted.

Expand All @@ -272,7 +303,18 @@ If sandbox replacement fails, NemoClaw attempts to restore the previous attachme

## Destroy a Sandbox with MCP State

Destroy reads the current agent and OpenShell sources before deletion but does not scrub a separate MCP registry or write destroy markers. OpenShell deletes the sandbox-scoped policy and attachments with the sandbox. NemoClaw preserves workspace-level MCP providers and prints their exact names for later inspection. An interrupted destroy is retried from current sandbox presence; no local MCP marker authorizes cleanup.
Before destruction, record each server's current `--deny-tool` selectors if you plan to recreate its registration.
Also record its trusted-private declaration from `--trusted-private-host` or `NEMOCLAW_TRUSTED_PRIVATE_HOSTS`.
Destroy deletes the generated policies, and NemoClaw does not retain the environment declaration after `mcp add` returns.

Destroy reads the current agent and OpenShell sources before deletion but does not scrub a separate MCP registry or write destroy markers. OpenShell deletes the sandbox-scoped policy and attachments with the sandbox. NemoClaw preserves workspace-level MCP providers and prints their exact names for later inspection.
A preserved provider blocks `mcp add` for the same server name on a recreated sandbox with the same name.
Export the credential under its original environment-variable name.
If the recorded declaration used `NEMOCLAW_TRUSTED_PRIVATE_HOSTS`, export it again before the first add.
Run `mcp add` for that server with each recorded `--deny-tool` selector and the recorded trusted-private declaration.
Omit either setting only when the original registration did not use it.
If it reports an existing provider, follow [Add Reports an Existing Provider](../../reference/troubleshoot-mcp-servers#add-reports-an-existing-provider) with the gateway name and delete command that the error prints before you add the server again.
An interrupted destroy is retried from current sandbox presence; no local MCP marker authorizes cleanup.

## Respect the Lifecycle Lock

Expand Down
Loading
Loading