---
title: "updateMCPServer"
---

> Documentation Index
> Fetch the complete documentation index at: https://agenthold.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# updateMCPServer

Path: agenthold API › tools

`PUT /mcp-servers/{serverId}`

URL: `/api/v1/mcp-servers/{serverId}`

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `serverId` (`updateMCPServer.path.serverId`; string, required)

## Request body

_Required._

- `name` (`updateMCPServer.name`; string, required) — Letters, digits, dashes and underscores.
- `transport` (`updateMCPServer.transport`; string, required)
  - one of `"stdio"`, `"http"`
- `command` (`updateMCPServer.command`; string, optional) — stdio only; runs inside the sandbox.
- `args` (`updateMCPServer.args`; array of string, optional)
- `env` (`updateMCPServer.env`; map of string, optional) — stdio only. Values may reference secrets as {{secret:NAME}}.
- `url` (`updateMCPServer.url`; string, optional) — http only.
- `headers` (`updateMCPServer.headers`; map of string, optional) — http only. Values may reference secrets as {{secret:NAME}}; the sandbox sees a placeholder and the egress proxy injects the value.

## Example request

```json
{
  "name": "string",
  "transport": "stdio",
  "command": "string",
  "args": [
    "string"
  ],
  "env": {
    "property1": "string",
    "property2": "string"
  },
  "url": "string",
  "headers": {
    "property1": "string",
    "property2": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url '<base-url>/api/v1/mcp-servers/<serverId>' \
  --header 'Content-Type: application/json' \
  --cookie 'agenthold_session=<agenthold_session>' \
  --data '
{
  "name": "string",
  "transport": "stdio",
  "command": "string",
  "args": [
    "string"
  ],
  "env": {
    "property1": "string",
    "property2": "string"
  },
  "url": "string",
  "headers": {
    "property1": "string",
    "property2": "string"
  }
}
'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/mcp-servers/<serverId>';
const options = {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    cookie: 'agenthold_session=<agenthold_session>'
  },
  body: JSON.stringify({
    name: 'string',
    transport: 'stdio',
    command: 'string',
    args: ['string'],
    env: {property1: 'string', property2: 'string'},
    url: 'string',
    headers: {property1: 'string', property2: 'string'}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/mcp-servers/<serverId>"

payload = {
    "name": "string",
    "transport": "stdio",
    "command": "string",
    "args": ["string"],
    "env": {
        "property1": "string",
        "property2": "string"
    },
    "url": "string",
    "headers": {
        "property1": "string",
        "property2": "string"
    }
}
headers = {
    "cookie": "agenthold_session=<agenthold_session>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updated.

#### Example

```json
{
  "name": "string",
  "transport": "stdio",
  "command": "string",
  "args": [
    "string"
  ],
  "env": {
    "property1": "string",
    "property2": "string"
  },
  "url": "string",
  "headers": {
    "property1": "string",
    "property2": "string"
  },
  "id": "string",
  "workspaceId": "string",
  "scope": "workspace",
  "agentId": "string",
  "secretRefs": [
    "string"
  ],
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
```

- `name` (`updateMCPServer.response.200.name`; string, required) — Letters, digits, dashes and underscores.
- `transport` (`updateMCPServer.response.200.transport`; string, required)
  - one of `"stdio"`, `"http"`
- `command` (`updateMCPServer.response.200.command`; string, required) — stdio only; runs inside the sandbox.
- `args` (`updateMCPServer.response.200.args`; array of string, required)
- `env` (`updateMCPServer.response.200.env`; map of string, required) — stdio only. Values may reference secrets as {{secret:NAME}}.
- `url` (`updateMCPServer.response.200.url`; string, required) — http only.
- `headers` (`updateMCPServer.response.200.headers`; map of string, required) — http only. Values may reference secrets as {{secret:NAME}}; the sandbox sees a placeholder and the egress proxy injects the value.
- `id` (`updateMCPServer.response.200.id`; string, required)
- `workspaceId` (`updateMCPServer.response.200.workspaceId`; string, required)
- `scope` (`updateMCPServer.response.200.scope`; string, required)
  - one of `"workspace"`, `"agent"`
- `secretRefs` (`updateMCPServer.response.200.secretRefs`; array of string, required)
- `createdAt` (`updateMCPServer.response.200.createdAt`; string, required)
  - format: `date-time`
- `updatedAt` (`updateMCPServer.response.200.updatedAt`; string, required)
  - format: `date-time`
- `agentId` (`updateMCPServer.response.200.agentId`; string, optional)

### 400

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateMCPServer.response.400.error`; string, required)

### 403

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateMCPServer.response.403.error`; string, required)

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`updateMCPServer.response.404.error`; string, required)


Source: https://agenthold.dev/api/mcp-servers/update/index.md
