curl --request GET \
--url https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_types": [
"data_update",
"status_change"
],
"filters": {
"object_type": "Account",
"limit": 100
}
}
'import requests
url = "https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}"
payload = {
"event_types": ["data_update", "status_change"],
"filters": {
"object_type": "Account",
"limit": 100
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_types: ['data_update', 'status_change'],
filters: {object_type: 'Account', limit: 100}
})
};
fetch('https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_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_URL => "https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'event_types' => [
'data_update',
'status_change'
],
'filters' => [
'object_type' => 'Account',
'limit' => 100
]
]),
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://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}"
payload := strings.NewReader("{\n \"event_types\": [\n \"data_update\",\n \"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_types\": [\n \"data_update\",\n \"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_types\": [\n \"data_update\",\n \"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotConnected",
"message": "Server 'salesforce' is not connected. Please initiate connection first."
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "UpstreamError",
"message": "Failed to connect to Salesforce streaming API"
}SSE server proxy endpoint
Server-Sent Events proxy endpoint for real-time streaming communication with third-party servers.
This endpoint provides dedicated SSE streaming capabilities separate from the MCP protocol, allowing for custom event streaming and real-time data flows.
Usage
- SSE Streaming: Optimized for
text/event-streamcommunication - Real-time Events: Custom event types and data streaming
- Session Management: Include
x-mcp-session-idheader for session tracking
Authentication Flow
- User must first connect to the server via
/api/servers/{server_id}/connect - Complete OAuth flow for the third-party service
- Use this endpoint for real-time event streaming with automatic credential injection
curl --request GET \
--url https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_types": [
"data_update",
"status_change"
],
"filters": {
"object_type": "Account",
"limit": 100
}
}
'import requests
url = "https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}"
payload = {
"event_types": ["data_update", "status_change"],
"filters": {
"object_type": "Account",
"limit": 100
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_types: ['data_update', 'status_change'],
filters: {object_type: 'Account', limit: 100}
})
};
fetch('https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_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_URL => "https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'event_types' => [
'data_update',
'status_change'
],
'filters' => [
'object_type' => 'Account',
'limit' => 100
]
]),
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://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}"
payload := strings.NewReader("{\n \"event_types\": [\n \"data_update\",\n \"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_types\": [\n \"data_update\",\n \"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/sse/{mcp_server_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_types\": [\n \"data_update\",\n \"status_change\"\n ],\n \"filters\": {\n \"object_type\": \"Account\",\n \"limit\": 100\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotConnected",
"message": "Server 'salesforce' is not connected. Please initiate connection first."
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "UpstreamError",
"message": "Failed to connect to Salesforce streaming API"
}Authorizations
JWT token obtained through Barndoor's OAuth 2.0 authorization-code flow with PKCE.
The token should be included in the Authorization header:
Authorization: Bearer <your-jwt-token>
Use the Barndoor SDK's loginInteractive() function to obtain tokens automatically.
Headers
MCP session identifier for request tracking
Path Parameters
MCP server name identifier
^[a-z0-9-]+$Body
Optional request payload for SSE initialization
Response
SSE event stream
Server-Sent Events stream for real-time communication.
Events follow the SSE format with optional event types and data payloads.
Example events:
event: connected
data: {"status": "ready", "timestamp": "2024-01-01T00:00:00Z"}
event: data_update
data: {"type": "Account", "id": "123", "changes": {...}}
event: error
data: {"error": "rate_limit", "message": "Rate limit exceeded"}