File size: 5,680 Bytes
07af8f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
---
title: "Servers"
description: "Manage your MCP servers."
---

import { Card, Cards } from 'mintlify';

<Card
  title="GET /api/servers"
  href="#get-all-servers"
>
  Get a list of all MCP servers.
</Card>

<Card
  title="POST /api/servers"
  href="#create-a-new-server"
>
  Create a new MCP server.
</Card>

<Card
  title="PUT /api/servers/:name"
  href="#update-a-server"
>
  Update an existing MCP server.
</Card>

<Card
  title="DELETE /api/servers/:name"
  href="#delete-a-server"
>
  Delete an MCP server.
</Card>

<Card
  title="POST /api/servers/:name/toggle"
  href="#toggle-a-server"
>
  Toggle the enabled state of a server.
</Card>

<Card
  title="POST /api/servers/:serverName/tools/:toolName/toggle"
  href="#toggle-a-tool"
>
  Toggle the enabled state of a tool.
</Card>

<Card
  title="PUT /api/servers/:serverName/tools/:toolName/description"
  href="#update-tool-description"
>
  Update the description of a tool.
</Card>

<Card
  title="PUT /api/system-config"
  href="#update-system-config"
>
  Update system configuration settings.
</Card>

<Card
  title="GET /api/settings"
  href="#get-settings"
>
  Get all server settings and configurations.
</Card>

---

### Get All Servers

Retrieves a list of all configured MCP servers, including their status and available tools.

- **Endpoint**: `/api/servers`
- **Method**: `GET`
- **Response**:
  ```json
  {
    "success": true,
    "data": [
      {
        "name": "example-server",
        "status": "connected",
        "tools": [
          {
            "name": "tool1",
            "description": "Description of tool 1"
          }
        ],
        "config": {
          "type": "stdio",
          "command": "node",
          "args": ["server.js"]
        }
      }
    ]
  }
  ```

---

### Create a New Server

Adds a new MCP server to the configuration.

- **Endpoint**: `/api/servers`
- **Method**: `POST`
- **Body**:
  ```json
  {
    "name": "my-new-server",
    "config": {
      "type": "stdio",
      "command": "python",
      "args": ["-u", "my_script.py"],
      "owner": "admin"
    }
  }
  ```
  - `name` (string, required): The unique name for the server.
  - `config` (object, required): The server configuration object.
    - `type` (string): `stdio`, `sse`, `streamable-http`, or `openapi`.
    - `command` (string): Command to execute for `stdio` type.
    - `args` (array of strings): Arguments for the command.
    - `url` (string): URL for `sse`, `streamable-http`, or `openapi` types.
    - `openapi` (object): OpenAPI configuration.
      - `url` (string): URL to the OpenAPI schema.
      - `schema` (object): The OpenAPI schema object itself.
    - `headers` (object): Headers to send with requests for `sse`, `streamable-http`, and `openapi` types.
    - `keepAliveInterval` (number): Keep-alive interval in milliseconds for `sse` type. Defaults to 60000.
    - `owner` (string): The owner of the server. Defaults to the current user or 'admin'.

---

### Update a Server

Updates the configuration of an existing MCP server.

- **Endpoint**: `/api/servers/:name`
- **Method**: `PUT`
- **Parameters**:
  - `:name` (string, required): The name of the server to update.
- **Body**:
  ```json
  {
    "config": {
      "type": "stdio",
      "command": "node",
      "args": ["new_server.js"]
    }
  }
  ```
  - `config` (object, required): The updated server configuration object. See "Create a New Server" for details.

---

### Delete a Server

Removes an MCP server from the configuration.

- **Endpoint**: `/api/servers/:name`
- **Method**: `DELETE`
- **Parameters**:
  - `:name` (string, required): The name of the server to delete.

---

### Toggle a Server

Enables or disables an MCP server.

- **Endpoint**: `/api/servers/:name/toggle`
- **Method**: `POST`
- **Parameters**:
  - `:name` (string, required): The name of the server to toggle.
- **Body**:
  ```json
  {
    "enabled": true
  }
  ```
  - `enabled` (boolean, required): `true` to enable the server, `false` to disable it.

---

### Toggle a Tool

Enables or disables a specific tool on a server.

- **Endpoint**: `/api/servers/:serverName/tools/:toolName/toggle`
- **Method**: `POST`
- **Parameters**:
  - `:serverName` (string, required): The name of the server.
  - `:toolName` (string, required): The name of the tool.
- **Body**:
  ```json
  {
    "enabled": true
  }
  ```
  - `enabled` (boolean, required): `true` to enable the tool, `false` to disable it.

---

### Update Tool Description

Updates the description of a specific tool.

- **Endpoint**: `/api/servers/:serverName/tools/:toolName/description`
- **Method**: `PUT`
- **Parameters**:
  - `:serverName` (string, required): The name of the server.
  - `:toolName` (string, required): The name of the tool.
- **Body**:
  ```json
  {
    "description": "New tool description"
  }
  ```
  - `description` (string, required): The new description for the tool.

---

### Update System Config

Updates the system-wide configuration settings.

- **Endpoint**: `/api/system-config`
- **Method**: `PUT`
- **Body**:
  ```json
  {
    "openaiApiKey": "sk-...",
    "openaiBaseUrl": "https://api.openai.com/v1",
    "modelName": "gpt-4",
    "temperature": 0.7,
    "maxTokens": 2048
  }
  ```
  - All fields are optional. Only provided fields will be updated.

---

### Get Settings

Retrieves all server settings and configurations.

- **Endpoint**: `/api/settings`
- **Method**: `GET`
- **Response**:
  ```json
  {
    "success": true,
    "data": {
      "servers": [...],
      "groups": [...],
      "systemConfig": {...}
    }
  }
  ```

**Note**: For detailed prompt management, see the [Prompts API](/api-reference/prompts) documentation.