Content-Type: application/json
Accept: application/json, text/event-stream
Important: The Accept
header with text/event-stream
is REQUIRED. Without it, you will receive a 406 Not Acceptable error.
With Token URL (Self-sufficient)
POST /mcp/:serverId/:accessToken
GET /mcp/:serverId/:accessToken
Required Headers:
Content-Type: application/json
Accept: application/json, text/event-stream
Optional Headers:
x-alloy-user-token
: JWT token for user isolation
x-alloy-userid
: Override user ID when needed
x-credential-id
: Use specific credential for operations
x-redirect-uri
: OAuth redirect URI for credential creation
With API Authentication
Requires standard API authentication headers.
POST /mcp/:serverId
GET /mcp/:serverId
Required Headers:
Content-Type: application/json
Accept: application/json, text/event-stream
Authorization
: Bearer YOUR_API_KEY
x-alloy-userid
: Your user ID
Optional Headers:
x-alloy-user-token
: JWT token for user isolation
x-credential-id
: Use specific credential for operations
x-redirect-uri
: OAuth redirect URI for credential creation
x-mcp-server-id
: Alternative way to specify server ID
Complete Examples
Example with Token URL
curl -X POST https://mcp.runalloy.com/mcp/your-server-id/your-access-token \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}'
Example with API Authentication
curl -X POST https://mcp.runalloy.com/mcp/your-server-id \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-alloy-userid: YOUR_USER_ID" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "execute_action_alloy",
"arguments": {
"connectorId": "slack",
"actionId": "chat_postMessage",
"parameters": {
"channel": "#general",
"text": "Hello from MCP!"
}
}
},
"id": 1
}'
All MCP requests follow the JSON-RPC 2.0 specification:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "tool_name",
"arguments": {
// Tool-specific arguments
}
},
"id": 1
}
Successful responses:
{
"jsonrpc": "2.0",
"result": {
// Tool-specific result
},
"id": 1
}
Error responses:
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Error description"
},
"id": 1
}
Available Methods
Lists all available tools for the server.
{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 1
}
Executes a specific tool.
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "execute_action_alloy",
"arguments": {
"connectorId": "slack",
"actionId": "chat_postMessage",
"parameters": {
"channel": "#general",
"text": "Hello!"
}
}
},
"id": 1
}
resources/list
Lists available resources.
{
"jsonrpc": "2.0",
"method": "resources/list",
"id": 1
}
resources/read
Reads a specific resource.
{
"jsonrpc": "2.0",
"method": "resources/read",
"params": {
"uri": "resource://workflows/my-workflow"
},
"id": 1
}
prompts/list
Lists available prompts.
{
"jsonrpc": "2.0",
"method": "prompts/list",
"id": 1
}
prompts/get
Gets a specific prompt.
{
"jsonrpc": "2.0",
"method": "prompts/get",
"params": {
"name": "workflow_builder"
},
"id": 1
}