MCP server proxy endpoint
curl --request GET \
--url https://{organization_id}.platform.barndoor.ai/mcp/{mcp_server_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 1
}
'import requests
url = "https://{organization_id}.platform.barndoor.ai/mcp/{mcp_server_name}"
payload = {
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 1
}
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({jsonrpc: '2.0', method: 'tools/list', params: {}, id: 1})
};
fetch('https://{organization_id}.platform.barndoor.ai/mcp/{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/mcp/{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([
'jsonrpc' => '2.0',
'method' => 'tools/list',
'params' => [
],
'id' => 1
]),
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/mcp/{mcp_server_name}"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"tools/list\",\n \"params\": {},\n \"id\": 1\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/mcp/{mcp_server_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"tools/list\",\n \"params\": {},\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/mcp/{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 \"jsonrpc\": \"2.0\",\n \"method\": \"tools/list\",\n \"params\": {},\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"result": {
"tools": [
{
"name": "get_accounts",
"description": "Get Salesforce accounts",
"parameters": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"description": "Maximum number of accounts"
}
}
}
}
]
},
"id": 1
}{
"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 API"
}MCP
MCP server proxy endpoint
Proxies MCP JSON-RPC requests to third-party servers with automatic authentication.
This endpoint supports both regular Streamable HTTP requests and Server-Sent Events (SSE) for real-time MCP protocol communication.
Usage
- JSON-RPC: Send MCP protocol requests as JSON
- SSE Streaming: Use
Accept: text/event-streamfor real-time communication - 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 to proxy MCP requests with automatic credential injection
GET
/
mcp
/
{mcp_server_name}
MCP server proxy endpoint
curl --request GET \
--url https://{organization_id}.platform.barndoor.ai/mcp/{mcp_server_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 1
}
'import requests
url = "https://{organization_id}.platform.barndoor.ai/mcp/{mcp_server_name}"
payload = {
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 1
}
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({jsonrpc: '2.0', method: 'tools/list', params: {}, id: 1})
};
fetch('https://{organization_id}.platform.barndoor.ai/mcp/{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/mcp/{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([
'jsonrpc' => '2.0',
'method' => 'tools/list',
'params' => [
],
'id' => 1
]),
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/mcp/{mcp_server_name}"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"tools/list\",\n \"params\": {},\n \"id\": 1\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/mcp/{mcp_server_name}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"tools/list\",\n \"params\": {},\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/mcp/{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 \"jsonrpc\": \"2.0\",\n \"method\": \"tools/list\",\n \"params\": {},\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"result": {
"tools": [
{
"name": "get_accounts",
"description": "Get Salesforce accounts",
"parameters": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"description": "Maximum number of accounts"
}
}
}
}
]
},
"id": 1
}{
"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 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
Pattern:
^[a-z0-9-]+$Body
application/json
MCP JSON-RPC request payload