curl --request PUT \
--url http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cli": "<string>",
"script": "<string>",
"runtime": "<string>",
"config": {}
}
'import requests
url = "http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}"
payload = {
"cli": "<string>",
"script": "<string>",
"runtime": "<string>",
"config": {}
}
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({cli: '<string>', script: '<string>', runtime: '<string>', config: {}})
};
fetch('http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8765",
CURLOPT_URL => "http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}",
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([
'cli' => '<string>',
'script' => '<string>',
'runtime' => '<string>',
'config' => [
]
]),
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 := "http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}"
payload := strings.NewReader("{\n \"cli\": \"<string>\",\n \"script\": \"<string>\",\n \"runtime\": \"<string>\",\n \"config\": {}\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("http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cli\": \"<string>\",\n \"script\": \"<string>\",\n \"runtime\": \"<string>\",\n \"config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cli\": \"<string>\",\n \"script\": \"<string>\",\n \"runtime\": \"<string>\",\n \"config\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"detail": "<unknown>",
"errno": "<string>",
"refusal": {}
}{
"detail": "<unknown>",
"errno": "<string>",
"refusal": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<unknown>",
"errno": "<string>",
"refusal": {}
}Install an MCP CLI
Install an MCP server as a CLI on the live workspace.
The body is one clis: entry, cli: mcp with its config, as a
config file states it. Its pointers resolve and its tools are listed
under the workspace’s network. A name already installed answers 409.
curl --request PUT \
--url http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cli": "<string>",
"script": "<string>",
"runtime": "<string>",
"config": {}
}
'import requests
url = "http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}"
payload = {
"cli": "<string>",
"script": "<string>",
"runtime": "<string>",
"config": {}
}
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({cli: '<string>', script: '<string>', runtime: '<string>', config: {}})
};
fetch('http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8765",
CURLOPT_URL => "http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}",
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([
'cli' => '<string>',
'script' => '<string>',
'runtime' => '<string>',
'config' => [
]
]),
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 := "http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}"
payload := strings.NewReader("{\n \"cli\": \"<string>\",\n \"script\": \"<string>\",\n \"runtime\": \"<string>\",\n \"config\": {}\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("http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cli\": \"<string>\",\n \"script\": \"<string>\",\n \"runtime\": \"<string>\",\n \"config\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8765/v1/workspaces/{workspace_id}/clis/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cli\": \"<string>\",\n \"script\": \"<string>\",\n \"runtime\": \"<string>\",\n \"config\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"detail": "<unknown>",
"errno": "<string>",
"refusal": {}
}{
"detail": "<unknown>",
"errno": "<string>",
"refusal": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<unknown>",
"errno": "<string>",
"refusal": {}
}Authorizations
The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default local mode with no token accepts requests without one.
Body
One clis: entry: install a named CLI with its own config.
The section key is the installed head word. Exactly one handler
source: cli names a registered spec tree; script references
a program file whose content is embedded at load (the docker
build-context model). runtime optionally pins the world runtime
entry that runs the script; unset picks the first entry speaking
the script's language. config validates through the spec's
config_model at install time (fail loud). A CLI never takes a
mode and never shares a mount's credentials: a binary has no mode,
the credential does.
Response
OK