Skip to main content
POST
/
api
/
servers
Create a new MCP server
curl --request POST \
  --url https://mcp.runalloy.com/api/servers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Production Server",
  "description": "Main production MCP server with restricted access",
  "tokenExpiresInDays": 90,
  "restrictions": {
    "connectors": {
      "mode": "allowlist",
      "allowedIds": [
        "slack",
        "notion",
        "hubspot"
      ]
    }
  }
}'
{
  "serverId": "production-server-a1b2c3d4",
  "name": "Production Server",
  "description": "Main production MCP server",
  "url": "https://mcp.runalloy.com/mcp/production-server-a1b2c3d4",
  "accessUrl": "https://mcp.runalloy.com/mcp/production-server-a1b2c3d4/mcp_token_xyz789",
  "accessToken": "mcp_token_xyz789",
  "restrictions": {
    "connectors": {
      "mode": "allowlist",
      "allowedIds": [
        "slack",
        "notion",
        "hubspot"
      ]
    }
  },
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}

Authorizations

Authorization
string
header
required

Use either an Alloy API key or JWT token

Headers

x-alloy-userid
string

User ID for server ownership (optional with API key)

Body

application/json
name
string
required

Server name (1-100 characters)

Required string length: 1 - 100
description
string

Server description

customInstructions
string

Custom instructions for AI assistants (beta)

tokenExpiresInDays
integer

Token expiration in days (1-365)

Required range: 1 <= x <= 365
restrictions
object

Response

Server created successfully

serverId
string

Unique server identifier

name
string

Server name

description
string

Server description

url
string

Base URL for API-authenticated access

accessUrl
string

Self-sufficient URL with embedded token

restrictions
object
hasRestrictions
boolean

Whether server has active restrictions

createdAt
string<date-time>
updatedAt
string<date-time>
accessToken
string

Access token (only returned on creation)

I