curl --request POST \
--url https://api.example.com/api/mcp-config/secret-env \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"manifest_pointer": "<string>",
"value": "<string>",
"key": "<string>",
"key_hint": "<string>"
}
'import requests
url = "https://api.example.com/api/mcp-config/secret-env"
payload = {
"manifest_pointer": "<string>",
"value": "<string>",
"key": "<string>",
"key_hint": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest_pointer: '<string>',
value: '<string>',
key: '<string>',
key_hint: '<string>'
})
};
fetch('https://api.example.com/api/mcp-config/secret-env', 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://api.example.com/api/mcp-config/secret-env",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'manifest_pointer' => '<string>',
'value' => '<string>',
'key' => '<string>',
'key_hint' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.example.com/api/mcp-config/secret-env"
payload := strings.NewReader("{\n \"manifest_pointer\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\",\n \"key_hint\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.example.com/api/mcp-config/secret-env")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"manifest_pointer\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\",\n \"key_hint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/mcp-config/secret-env")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest_pointer\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\",\n \"key_hint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"env_keys": 123,
"fanout": {
"mode": "<string>",
"error": "<string>",
"local_only": true,
"note": "<string>",
"op": "<string>",
"reachable": true,
"results": [
{
"name": "<string>",
"outcome": "<string>",
"detail": "<string>",
"error": "<string>",
"payload": null
}
]
},
"status": "<string>"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "reloading — the server is applying a config reload; retry shortly",
"reloading": true
}Write a secret env value and its manifest !ENV marker together, then reload
Store a pasted secret as an env value and reference it from the manifest by a marker.
The env KEY is EITHER an explicit key OR generated from key_hint — exactly one
(key | key_hint). Writes the secret value to the env store under that key AND
marks the key secret (adding it to TAI_ENV_SECRET_KEYS), and writes an !ENV ${KEY}
MARKER at manifest_pointer — all through the combined
ConfigService.apply_env_and_change pipeline so the env write and the manifest mutate
stay consistent. Partial-failure: a manifest-persist failure after the env write does
NO rollback — the env write stands as an inert, re-runnable orphan and the op raises
loudly. An explicit key colliding with an existing stored key holding a DIFFERENT value
is a loud 400 naming the key; a generated key never shadows a registered settings
env_var. The pointer’s HEAD segment MUST be mcp (loud 400 otherwise). The response
is the reloadConfigResult shape; the resolved key is NEVER returned. A dangling
!ENV / X-band refusal surfaces as a loud 400 naming the key (the shared boundary
validator, same as POST /api/mcp-config).
curl --request POST \
--url https://api.example.com/api/mcp-config/secret-env \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"manifest_pointer": "<string>",
"value": "<string>",
"key": "<string>",
"key_hint": "<string>"
}
'import requests
url = "https://api.example.com/api/mcp-config/secret-env"
payload = {
"manifest_pointer": "<string>",
"value": "<string>",
"key": "<string>",
"key_hint": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest_pointer: '<string>',
value: '<string>',
key: '<string>',
key_hint: '<string>'
})
};
fetch('https://api.example.com/api/mcp-config/secret-env', 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://api.example.com/api/mcp-config/secret-env",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'manifest_pointer' => '<string>',
'value' => '<string>',
'key' => '<string>',
'key_hint' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.example.com/api/mcp-config/secret-env"
payload := strings.NewReader("{\n \"manifest_pointer\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\",\n \"key_hint\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.example.com/api/mcp-config/secret-env")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"manifest_pointer\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\",\n \"key_hint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/mcp-config/secret-env")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest_pointer\": \"<string>\",\n \"value\": \"<string>\",\n \"key\": \"<string>\",\n \"key_hint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"env_keys": 123,
"fanout": {
"mode": "<string>",
"error": "<string>",
"local_only": true,
"note": "<string>",
"op": "<string>",
"reachable": true,
"results": [
{
"name": "<string>",
"outcome": "<string>",
"detail": "<string>",
"error": "<string>",
"payload": null
}
]
},
"status": "<string>"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "reloading — the server is applying a config reload; retry shortly",
"reloading": true
}Authorizations
Body
The combined env+manifest secret op body (POST /api/mcp-config/secret-env).
value is the raw secret pasted by the operator. The env KEY it is stored under is
EITHER an explicit key OR generated from key_hint — exactly one is given
({value, key | key_hint, manifest_pointer}). The server writes value to the env
store under that key (marked secret) and writes an !ENV ${KEY} MARKER at
manifest_pointer — so the secret lives only in the env store and the manifest carries
a placeholder. An explicit key that collides with an existing stored key holding a
DIFFERENT value is refused with a loud 400 naming the key (never a silent overwrite
of a live secret). manifest_pointer is a slash-delimited, no-leading-slash path (e.g.
mcp/0/config/headers/Authorization) whose HEAD segment MUST be mcp (the same
mcp-only authority set_mcp_config holds). The generated key is NOT returned.
Response
Success.
The standard mutation-op response: this worker's local reload result merged
with the fleet fan-out summary. env_keys is the count of env keys the
reload loaded.
Show child attributes
Show child attributes

