curl --request PUT \
--url https://melso.ai/api/tasks/{id}/mcp-servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mcp_servers": [
{
"name": "<string>",
"url": "<string>",
"headers": {},
"command": "<string>",
"args": [
"<string>"
],
"env": {}
}
]
}
'import requests
url = "https://melso.ai/api/tasks/{id}/mcp-servers"
payload = { "mcp_servers": [
{
"name": "<string>",
"url": "<string>",
"headers": {},
"command": "<string>",
"args": ["<string>"],
"env": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mcp_servers: [
{
name: '<string>',
url: '<string>',
headers: {},
command: '<string>',
args: ['<string>'],
env: {}
}
]
})
};
fetch('https://melso.ai/api/tasks/{id}/mcp-servers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://melso.ai/api/tasks/{id}/mcp-servers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mcp_servers' => [
[
'name' => '<string>',
'url' => '<string>',
'headers' => [
],
'command' => '<string>',
'args' => [
'<string>'
],
'env' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://melso.ai/api/tasks/{id}/mcp-servers"
payload := strings.NewReader("{\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ],\n \"env\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://melso.ai/api/tasks/{id}/mcp-servers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ],\n \"env\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/tasks/{id}/mcp-servers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ],\n \"env\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"mcp_servers": [
{
"name": "<string>",
"transport": "http",
"url": "<string>",
"header_names": [
"<string>"
],
"command": "<string>",
"args": [
"<string>"
],
"env_names": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Replace task mcp servers
A workspace owner or admin (browser session or personal access token) or a workspace API key of the Task’s workspace, who can also edit the Task with PUT /api/tasks/{id}. Other members get 403 {error:"only workspace owners, admins and API keys can set Task MCP servers",code:"task_mcp_servers_forbidden"}, also for []. Run tokens get 403, including a Run of this Task.
Request: {mcp_servers:McpServerInput[]} (required) replaces the Task’s whole set; [] removes every server. At most 10 servers. The JSON body is limited to 1 MiB and the sealed set to 64 KiB.
Response: {mcp_servers:McpServerSummary[]}: the new set, without header or env values.
Status: 200; 400 {error:string,code:"task_mcp_servers_invalid"}; 403 code: "task_mcp_servers_forbidden" for anyone but a workspace owner, admin or API key, or a Run token (code: "isolated_task_scope" for a Run of an isolated Task); 413 body over 1 MiB or set over 64 KiB sealed; 503 Secrets unavailable. Authentication and resource-access errors follow Overview.
curl --request PUT \
--url https://melso.ai/api/tasks/{id}/mcp-servers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mcp_servers": [
{
"name": "<string>",
"url": "<string>",
"headers": {},
"command": "<string>",
"args": [
"<string>"
],
"env": {}
}
]
}
'import requests
url = "https://melso.ai/api/tasks/{id}/mcp-servers"
payload = { "mcp_servers": [
{
"name": "<string>",
"url": "<string>",
"headers": {},
"command": "<string>",
"args": ["<string>"],
"env": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mcp_servers: [
{
name: '<string>',
url: '<string>',
headers: {},
command: '<string>',
args: ['<string>'],
env: {}
}
]
})
};
fetch('https://melso.ai/api/tasks/{id}/mcp-servers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://melso.ai/api/tasks/{id}/mcp-servers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mcp_servers' => [
[
'name' => '<string>',
'url' => '<string>',
'headers' => [
],
'command' => '<string>',
'args' => [
'<string>'
],
'env' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://melso.ai/api/tasks/{id}/mcp-servers"
payload := strings.NewReader("{\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ],\n \"env\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://melso.ai/api/tasks/{id}/mcp-servers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ],\n \"env\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/tasks/{id}/mcp-servers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mcp_servers\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"headers\": {},\n \"command\": \"<string>\",\n \"args\": [\n \"<string>\"\n ],\n \"env\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"mcp_servers": [
{
"name": "<string>",
"transport": "http",
"url": "<string>",
"header_names": [
"<string>"
],
"command": "<string>",
"args": [
"<string>"
],
"env_names": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Company API key (mwk_) or personal access token (mel_). A PAT requires X-Workspace-ID on company-scoped routes. An API key implies its own company.
Headers
Company UUID for a personal token on company-scoped operations. A company API key already binds its company.
Path Parameters
id from the corresponding authorized response.
Body
At most 10 servers with unique, non-reserved names. Each server uses exactly one of a remote HTTPS url or a stdio command. headers belong to remote servers; args and env belong to stdio servers. The encrypted set is limited to 64 KiB; the server rejects a larger sealed set with HTTP 413. This encrypted-size limit cannot be measured as JSON character count. Header and environment values are write-only; GET returns McpServerSummary objects.
10Show child attributes
Show child attributes
Response
{mcp_servers:McpServerSummary[]}: the new set, without header or env values.
Show child attributes
Show child attributes