Talk to the house over MCP
curl --request POST \
--url https://api.example.com/v1/mcp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "<string>",
"id": "<string>",
"params": {
"protocolVersion": "<string>",
"name": "<string>",
"arguments": {}
}
}
'import requests
url = "https://api.example.com/v1/mcp"
payload = {
"jsonrpc": "2.0",
"method": "<string>",
"id": "<string>",
"params": {
"protocolVersion": "<string>",
"name": "<string>",
"arguments": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
method: '<string>',
id: '<string>',
params: {protocolVersion: '<string>', name: '<string>', arguments: {}}
})
};
fetch('https://api.example.com/v1/mcp', 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/v1/mcp",
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([
'jsonrpc' => '2.0',
'method' => '<string>',
'id' => '<string>',
'params' => [
'protocolVersion' => '<string>',
'name' => '<string>',
'arguments' => [
]
]
]),
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://api.example.com/v1/mcp"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"<string>\",\n \"id\": \"<string>\",\n \"params\": {\n \"protocolVersion\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {}\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/mcp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"<string>\",\n \"id\": \"<string>\",\n \"params\": {\n \"protocolVersion\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/mcp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"<string>\",\n \"id\": \"<string>\",\n \"params\": {\n \"protocolVersion\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {},
"error": {
"code": 123,
"message": "<string>"
}
}{
"message": "Unauthorized",
"statusCode": 401
}{
"code": "request.timeout",
"correlationId": "<string>"
}{
"code": "request.timeout",
"correlationId": "<string>"
}MCP
Talk to the house over MCP
The Model Context Protocol over HTTP, stateless: one JSON-RPC 2.0 message per request (initialize, tools/list, tools/call, ping), answered as application/json; a notification is answered 202 with no body. Four tools, by intent, each over the operation of a route here: week (GET /v1/week), questions (GET /v1/questions), list (GET /v1/shopping/items) and tell (POST /v1/conversation/messages, answered with its reply). A tool’s input schema is that route’s, and its result is that route’s body. A refusal is a tool result with isError and a text that says what to do next.
POST
/
v1
/
mcp
Talk to the house over MCP
curl --request POST \
--url https://api.example.com/v1/mcp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "<string>",
"id": "<string>",
"params": {
"protocolVersion": "<string>",
"name": "<string>",
"arguments": {}
}
}
'import requests
url = "https://api.example.com/v1/mcp"
payload = {
"jsonrpc": "2.0",
"method": "<string>",
"id": "<string>",
"params": {
"protocolVersion": "<string>",
"name": "<string>",
"arguments": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
method: '<string>',
id: '<string>',
params: {protocolVersion: '<string>', name: '<string>', arguments: {}}
})
};
fetch('https://api.example.com/v1/mcp', 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/v1/mcp",
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([
'jsonrpc' => '2.0',
'method' => '<string>',
'id' => '<string>',
'params' => [
'protocolVersion' => '<string>',
'name' => '<string>',
'arguments' => [
]
]
]),
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://api.example.com/v1/mcp"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"<string>\",\n \"id\": \"<string>\",\n \"params\": {\n \"protocolVersion\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {}\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/mcp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"<string>\",\n \"id\": \"<string>\",\n \"params\": {\n \"protocolVersion\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/mcp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"<string>\",\n \"id\": \"<string>\",\n \"params\": {\n \"protocolVersion\": \"<string>\",\n \"name\": \"<string>\",\n \"arguments\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {},
"error": {
"code": 123,
"message": "<string>"
}
}{
"message": "Unauthorized",
"statusCode": 401
}{
"code": "request.timeout",
"correlationId": "<string>"
}{
"code": "request.timeout",
"correlationId": "<string>"
}Authorizations
A personal API token (onss_live_…), created in Ajustes › Integrações. It acts as the person who created it, in the household it was created in, on the read routes that list it.
Body
application/json