Skip to main content
POST
/
mcp
/
{serverId}
Execute MCP request (API Key)
curl --request POST \
  --url https://mcp.runalloy.com/mcp/{serverId} \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'x-alloy-userid: <x-alloy-userid>' \
  --data '
{
  "jsonrpc": "2.0",
  "id": "<string>",
  "params": {}
}
'
import requests

url = "https://mcp.runalloy.com/mcp/{serverId}"

payload = {
"jsonrpc": "2.0",
"id": "<string>",
"params": {}
}
headers = {
"Content-Type": "<content-type>",
"Accept": "<accept>",
"x-alloy-userid": "<x-alloy-userid>",
"Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
Accept: '<accept>',
'x-alloy-userid': '<x-alloy-userid>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({jsonrpc: '2.0', id: '<string>', params: {}})
};

fetch('https://mcp.runalloy.com/mcp/{serverId}', 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://mcp.runalloy.com/mcp/{serverId}",
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',
'id' => '<string>',
'params' => [

]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"x-alloy-userid: <x-alloy-userid>"
],
]);

$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://mcp.runalloy.com/mcp/{serverId}"

payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Accept", "<accept>")
req.Header.Add("x-alloy-userid", "<x-alloy-userid>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://mcp.runalloy.com/mcp/{serverId}")
.header("Content-Type", "<content-type>")
.header("Accept", "<accept>")
.header("x-alloy-userid", "<x-alloy-userid>")
.header("Authorization", "Bearer <token>")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://mcp.runalloy.com/mcp/{serverId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Accept"] = '<accept>'
request["x-alloy-userid"] = '<x-alloy-userid>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"<string>\",\n \"params\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "2.0",
  "result": {},
  "error": {
    "code": 123,
    "message": "<string>"
  },
  "id": "<string>"
}

Authorizations

Authorization
string
header
required

Use either an Alloy API key or JWT token

Headers

Content-Type
string
default:application/json
required

Request content type

Accept
string
default:application/json, text/event-stream
required

Response format - must include text/event-stream for MCP

x-alloy-userid
string
required

User ID

x-alloy-user-token
string

JWT token for user isolation (optional)

x-credential-id
string

Specific credential to use (optional)

x-redirect-uri
string

OAuth redirect URI for credential creation (optional)

Path Parameters

serverId
string
required

Server ID

Body

application/json
jsonrpc
enum<string>
required
Available options:
2.0
method
enum<string>
required
Available options:
tools/list,
tools/call,
resources/list,
resources/read,
prompts/list,
prompts/get
id
string
required
params
object

Response

MCP response

jsonrpc
enum<string>
Available options:
2.0
result
object
error
object
id
string