This document describes the complete protocol specification for Peta Core Admin API. All admin operations are provided through a unified /admin endpoint using an action-based request routing mechanism.
- Endpoint:
POST /admin - Authentication: Bearer Token (Peta access token; opaque bearer token)
- Content Type:
application/json - Character Encoding: UTF-8
All admin requests use a unified AdminRequest structure:
interface AdminRequest<T = any> {
action: AdminActionType; // Operation type (numeric enum)
data: T; // Operation data (specific type depends on action)
}Admin operation type enum - uses numeric values for performance
export enum AdminActionType { // User operations (1000-1999) DISABLE_USER = 1001, // Disable access for specified user UPDATE_USER_PERMISSIONS = 1002, // Update user permissions CREATE_USER = 1010, // Create user GET_USERS = 1011, // Query user list UPDATE_USER = 1012, // Update user DELETE_USER = 1013, // Delete user DELETE_USERS_BY_PROXY = 1014, // Batch delete users by proxy COUNT_USERS = 1015, // Count users GET_OWNER = 1016, // Get Owner information
// Server operations (2000-2999) START_SERVER = 2001, // Start specified server STOP_SERVER = 2002, // Stop specified server UPDATE_SERVER_CAPABILITIES = 2003, // Update server capability configuration UPDATE_SERVER_LAUNCH_CMD = 2004, // Update launch command CONNECT_ALL_SERVERS = 2005, // Connect all servers CREATE_SERVER = 2010, // Create server GET_SERVERS = 2011, // Query server list UPDATE_SERVER = 2012, // Update server DELETE_SERVER = 2013, // Delete server DELETE_SERVERS_BY_PROXY = 2014, // Batch delete servers by proxy COUNT_SERVERS = 2015, // Count servers GET_SERVER_OAUTH_REAUTH_CONTEXT = 2016, // Get OAuth reauthorization context for a server REAUTHORIZE_SERVER_OAUTH = 2017, // Reauthorize OAuth for a server
// Query operations (3000-3999) GET_AVAILABLE_SERVERS_CAPABILITIES = 3002, // Get all server capability configurations GET_USER_AVAILABLE_SERVERS_CAPABILITIES = 3003, // Get user accessible server capability configurations GET_SERVERS_STATUS = 3004, // Get all server status GET_SERVERS_CAPABILITIES = 3005, // Get specified server capability configuration
// IP whitelist operations (4000-4999) UPDATE_IP_WHITELIST = 4001, // Replace mode: delete all existing IPs, save new IP list to database and load to memory GET_IP_WHITELIST = 4002, // Query IP whitelist DELETE_IP_WHITELIST = 4003, // Delete specified IP whitelist ADD_IP_WHITELIST = 4004, // Append mode: add IPs to whitelist (without deleting existing IPs) SPECIAL_IP_WHITELIST_OPERATION = 4005, // IP filter switch: allow-all disable filter/deny-all enable filter
// Proxy operations (5000-5099) GET_PROXY = 5001, // Query proxy information CREATE_PROXY = 5002, // Create proxy UPDATE_PROXY = 5003, // Update proxy DELETE_PROXY = 5004, // Delete proxy STOP_PROXY = 5005, // Stop all proxy servers
// Backup and restore (6000-6099) BACKUP_DATABASE = 6001, // Full database backup RESTORE_DATABASE = 6002, // Full database restore
// Log operations (7000-7099) SET_LOG_WEBHOOK_URL = 7001, // Set log sync webhook URL GET_LOGS = 7002, // Get log records
// Cloudflared operations (8000-8099) UPDATE_CLOUDFLARED_CONFIG = 8001, // Update cloudflared configuration GET_CLOUDFLARED_CONFIGS = 8002, // Query cloudflared configuration list DELETE_CLOUDFLARED_CONFIG = 8003, // Delete cloudflared configuration RESTART_CLOUDFLARED = 8004, // Restart cloudflared STOP_CLOUDFLARED = 8005, // Stop cloudflared
// Result cache operations (11000-11099) CACHE_GET_HEALTH = 11001, CACHE_GET_POLICY = 11002, CACHE_PURGE_GLOBAL = 11010, CACHE_PURGE_SERVER = 11011, CACHE_PURGE_TOOL = 11012, CACHE_PURGE_PROMPT = 11013, CACHE_PURGE_RESOURCE = 11014, CACHE_PURGE_EXACT = 11015,
// Policy operations (9100-9199) CREATE_POLICY_SET = 9101, // Create policy set GET_POLICY_SETS = 9102, // Get policy sets UPDATE_POLICY_SET = 9103, // Update policy set DELETE_POLICY_SET = 9104, // Delete policy set GET_EFFECTIVE_POLICY = 9105, // Get effective policy
// Approval operations (9200-9299) LIST_APPROVAL_REQUESTS = 9201, // List approval requests GET_APPROVAL_REQUEST = 9202, // Get approval request DECIDE_APPROVAL_REQUEST = 9203, // Decide approval request COUNT_PENDING_APPROVALS = 9204 // Count pending approvals
// Discovery / Progressive Disclosure operations (9300-9399) GET_DISCOVERY_CONFIG = 9301, // Get global discovery enablement + default profile SET_DISCOVERY_CONFIG = 9302, // Update global discovery enablement + default profile CREATE_DISCOVERY_PROFILE = 9310, // Create a discovery profile GET_DISCOVERY_PROFILES = 9311, // List discovery profiles GET_DISCOVERY_PROFILE = 9312, // Get one discovery profile UPDATE_DISCOVERY_PROFILE = 9313, // Update a discovery profile DELETE_DISCOVERY_PROFILE = 9314, // Delete a discovery profile PREVIEW_DISCOVERY = 9320, // Preview direct vs catalog-only tools for a profile REINDEX_CATALOG = 9330, // Rebuild the persistent catalog index from live managed servers GET_CATALOG_STATS = 9331, // Get catalog row / server count / last-indexed stats }
curl example:
curl -X POST http://localhost:3002/admin \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_PETA_ACCESS_TOKEN" \
-d '{
"action": 1011,
"data": {
"proxyId": 0
}
}'TypeScript example:
const response = await fetch('http://localhost:3002/admin', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({
action: 1011, // GET_USERS
data: {
proxyId: 0,
},
}),
});
const result = await response.json();
if (!result.success) {
console.error('Operation failed:', result.error);
}All admin requests return a unified AdminResponse structure:
interface AdminResponse<T = any> {
success: boolean; // Whether operation succeeded
data?: T; // Return data on success
error?: {
// Error information on failure
code: AdminErrorCode; // Error code (numeric)
message: string; // Error message
};
}Success response example:
{
"success": true,
"data": {
"users": [...]
}
}Error response example:
{
"success": false,
"error": {
"code": 2001,
"message": "User user123 not found"
}
}UserStatus
0Disabled1Enabled2Pending3Suspended
UserRole
1Owner2Admin3User
ServerCategory
1Template2CustomRemote3RestApi4Skills5CustomStdio
ServerAuthType
1ApiKey2GoogleAuth3NotionAuth4FigmaAuth5GoogleCalendarAuth6GithubAuth7ZendeskAuth8CanvasAuth9CanvaAuth10GmailAuth11GoogleDocsAuth12GoogleSheetsAuth13GoogleFormsAuth14PipedriveAuth15HubSpotAuth16IntercomAuth
ServerStatus
0Online1Offline2Connecting3Error4Sleeping (lazy start; currently no active connection but can be woken up again)
DiscoveryMode
FLATAll tools are directly exposed to the AI client (no catalog overlay)HYBRIDSome tools are directly exposed, others are catalog-only (based on profile directExposureRules)STRICTAll tools are catalog-only; AI must use catalog tools to discover and execute
- The discovery catalog is an index/cache, not the runtime source of truth for executing tools.
PREVIEW_DISCOVERY,REINDEX_CATALOG, andGET_CATALOG_STATSoperate on that catalog/index layer.- Runtime execution still resolves through the live MCP session and the current
ServerContext. - Temporary or user-scoped server contexts are excluded from the global catalog index.
type DiscoveryProfileConfig = {
directExposureRules?: Array<{
match: {
serverIds?: string[];
riskLevels?: Array<'low' | 'high'>;
};
directCallable: boolean;
}>;
};directExposureRules evaluation:
- Rules are evaluated in order; the first matching rule wins
- A rule matches when all non-empty
matchfields match the action - Rules with an empty or missing
matchobject are skipped (they do not act as catch-all) - If no rule matches, the action defaults to catalog-only (not directly callable)
- Only used in
HYBRIDmode;FLATexposes everything,STRICThides everything - Risk level inference:
riskLevelscurrently supports onlylow(fromreadOnlyHint) andhigh(fromdestructiveHint).
DangerLevel
0Silent1Notification2Approval
type Permissions = {
[serverId: string]: {
enabled: boolean; // required
serverName?: string;
allowUserInput?: boolean;
authType?: number; // ServerAuthType
category?: number; // ServerCategory
configTemplate?: string; // JSON string
configured?: boolean;
status?: number; // ServerStatus
tools?: {
[toolName: string]: { enabled: boolean; description?: string; dangerLevel?: 0 | 1 | 2 };
};
resources?: {
[resourceName: string]: { enabled: boolean; description?: string };
};
prompts?: {
[promptName: string]: { enabled: boolean; description?: string };
};
};
};Minimum valid structure:
enabledmust be booleantools/resources/promptsmust be objects when present- Invalid structure will fail authentication (
INVALID_PERMISSIONS)
type ServerConfigCapabilities = {
tools: { [name: string]: { enabled: boolean; description?: string; dangerLevel?: 0 | 1 | 2 } };
resources: { [name: string]: { enabled: boolean; description?: string } };
prompts: { [name: string]: { enabled: boolean; description?: string } };
};encryptedToken / launchConfig are JSON strings with this structure:
type EncryptedData = {
data: string; // Base64
iv: string; // Base64
salt: string; // Base64
tag: string; // Base64
};stdio
{ "type": "stdio", "command": "node", "args": ["server.js"], "env": { "A": "B" }, "cwd": "/path" }http
{ "type": "http", "url": "https://example.com/mcp", "headers": { "Authorization": "Bearer xxx" } }sse
{ "type": "sse", "url": "https://example.com/sse" }custom-stdio (category=5; type field is optional — auto-detected when command is present)
{
"command": "/usr/local/bin/my-mcp-server",
"args": ["--config", "/etc/config.json"],
"env": { "API_KEY": "xxx" }
}Admin API supports two role permissions:
- Owner + Admin: Most operations allow Owner and Admin roles to execute
- Owner only: Some sensitive operations only allow Owner role to execute (specially marked in API list)
Permission verification is performed in ConfigController. Requests that do not meet permission requirements will return FORBIDDEN (1003) error.
All Admin API requests that are not listed below require a valid Authorization: Bearer <Peta access token> for an Owner or Admin. A present malformed or invalid Authorization header is rejected, including on the no-header actions. The following no-header actions are retained for initial setup and Console login:
GET_OWNER (1016)andGET_PROXY (5001)support the Console login/setup flow.CREATE_PROXY (5002)is available only while no proxy exists;RESTORE_DATABASE (6002)is available only while the proxy, users, and servers are empty.CREATE_USER (1010)is available without a header only whendata.roleisOwner; the handler permits exactly one Owner and only as the first user.
Bootstrap eligibility and creation are serialized by the database, so concurrent first-owner and first-proxy requests cannot both succeed. Restore rechecks all three empty-state tables under the same database lock after shutdown completes; a bootstrap write that arrives during shutdown is preserved and causes restore to fail.
COUNT_USERS (1015) and COUNT_SERVERS (2015) require Owner or Admin authorization.
publicAccess and permissions merge logic:
- If
permissionsdoes not include aserverId, availability falls back toserver.publicAccess(true allows access) - If
permissionsincludes aserverId,permissions[serverId].enabledtakes precedence overpublicAccess - Final tool/resource/prompt visibility is the merge of server capabilities and admin permissions; you can only override
enabledfor existing capability items - Empty
tools/resources/promptsmaps mean "no per-capability overrides"; an enabled server entry with empty maps still grants the server's enabled capabilities
Permission: Owner + Admin Function: Disable access for specified user, disconnect all active sessions for that user
Request Parameters (data):
targetId(string, required): User ID
Return Result (data):
nullFunction Description:
- Update user status to
Disabled - Disconnect all active MCP sessions for that user
- User can no longer establish new connections
Permission: Owner + Admin Function: Update server permission configuration for specified user
Request Parameters (data):
targetId(string, required): User IDpermissions(string or object, required): Permission configuration (Permissions object or its JSON string)
Return Result (data):
nullFunction Description:
- Replace semantics:
permissionsreplaces the user's existing permissions (not a patch) - If only some serverIds are provided, others are removed and fall back to
publicAccess - Update permissions field in user database
- Adding, removing, enabling, or disabling a server entry is persisted even when its capability maps are empty
- Server-entry additions/removals invalidate all three capability lists, while capability-override additions/removals invalidate the affected list regardless of
enabled; omitted entries inherit server defaults - If user has active sessions, push permission change notifications in real-time:
- Send
tools/list_changedwhen tools change - Send
resources/list_changedwhen resources change - Send
prompts/list_changedwhen prompts change
- Send
Minimal example (disable a single server):
{
"targetId": "user123",
"permissions": {
"filesystem": {
"enabled": false,
"tools": {},
"resources": {},
"prompts": {}
}
}
}Permission: Owner only. The first Owner may be created without an Authorization header only when role is UserRole.Owner and the database is empty.
Function: Create new user
Request Parameters (data):
userId(string, required): User ID (unique identifier)status(number, optional): User status, defaults toUserStatus.Enabled (1)role(number, optional): User role, defaults toUserRole.User (3)permissions(string or object, optional): Permission configuration, defaults to{}expiresAt(number, optional): Expiration time (Unix timestamp, seconds), defaults to0(never expires)createdAt(number, optional): Creation time (Unix timestamp, seconds), defaults to current timeupdatedAt(number, optional): Update time (Unix timestamp, seconds), defaults to current timeratelimit(number, optional): Rate limit, defaults to100name(string, optional): User name, defaults to empty stringencryptedToken(string, required): Encrypted tokenproxyId(number, optional): Associated proxy ID, defaults to0notes(string, optional): Notes, defaults tonull
Return Result (data):
{
"user": {
"userId": "user123",
"status": 1,
"role": 3,
"permissions": "{}",
...
}
}Important Notes:
encryptedTokenmust be anEncryptedDataJSON string (see Data Structures Overview)- For non-Owner creation, the admin token is used to decrypt
encryptedToken, anduserIdmust equal the first 32 chars ofSHA-256(token) - Owner can be created only once, and must be the first user (empty database)
Permission: Owner + Admin Function: Query user list, supports multiple filter conditions
Request Parameters (data):
userId(string, optional): Exact query for specified user IDproxyId(number, optional): Filter by proxyIdrole(number, optional): Filter by roleexcludeRole(number, optional): Exclude specified role
Return Result (data):
{
"users": [
{
"userId": "user123",
"status": 1,
"role": 3,
"permissions": "{}",
"serverApiKeys": "[]",
...
}
]
}Function Description:
- If
userIdis provided, returns single user (in array form) or empty array - Other filter conditions can be combined
- Returns all users if no filter conditions provided
Permission: Owner + Admin Function: Update user information
Request Parameters (data):
userId(string, required): User IDname(string, optional): User namenotes(string, optional): Notespermissions(string or object, optional): Permission configurationstatus(number, optional): User statusencryptedToken(string, optional): Encrypted user access token
Return Result (data):
{
"user": {
"userId": "user123",
...
}
}Function Description:
- If
permissionsis updated, will push to user's active sessions in real-time - If
statuschanges toDisabled, will disable user first (disconnect sessions)
Permission: Owner + Admin Function: Delete specified user
Request Parameters (data):
userId(string, required): User ID
Return Result (data):
{
"message": "User deleted successfully"
}Function Description:
- Disable user before deletion (disconnect all sessions)
- Permanently delete user record from database
Permission: Owner + Admin Function: Batch delete users by proxyId
Request Parameters (data):
proxyId(number, required): Proxy ID
Return Result (data):
{
"deletedCount": 10
}Function Description:
- Disable all matching users before deletion (disconnect sessions)
- Returns actual number of deleted users
Permission: Owner + Admin Function: Count users
Request Parameters (data):
excludeRole(number, optional): Exclude specified role
Return Result (data):
{
"count": 50
}Permission: Public without an Authorization header for Console login/bootstrap. A supplied Authorization header must be valid. Function: Get the system Owner information needed for Console login
Request Parameters (data):
{}Return Result (data):
{
"owner": {
"userId": "owner123",
"status": 1,
"role": 1,
"expiresAt": 0,
"createdAt": 1729431234,
"encryptedToken": "..."
}
}Function Description:
- Without an Authorization header, returns only
userId,encryptedToken,role,status,expiresAt, andcreatedAt. The encrypted token envelope is required for Console master-password login; it is not the plaintext access token. - Authenticated Owner/Admin requests receive the full Owner record. Anonymous responses omit permissions, preferences, launch configurations, notes, and other unrelated account fields.
- If no Owner user exists in the system, returns error (code: 2001, USER_NOT_FOUND)
Permission: Owner only Function: Start specified MCP server
Request Parameters (data):
targetId(string, required): Server ID
Return Result (data):
nullFunction Description:
- Set server's
enabledfield totrue - Start MCP server process and establish connection
- Notify all active user sessions using this server of capability changes
Permission: Owner + Admin Function: Stop specified MCP server
Request Parameters (data):
targetId(string, required): Server ID
Return Result (data):
nullFunction Description:
- Disconnect MCP server connection
- Set server's
enabledfield tofalse - Notify all active user sessions using this server of capability changes
Permission: Owner + Admin Function: Update server capability configuration (tools/resources/prompts)
Request Parameters (data):
targetId(string, required): Server IDcapabilities(string or object, required): Capability configuration (ServerConfigCapabilities object or its JSON string)
Return Result (data):
nullFunction Description:
- Update server capability configuration in database
- If server is running, reload configuration and notify related user sessions
Permission: Owner only Function: Update server launch command configuration
Request Parameters (data):
targetId(string, required): Server IDlaunchConfig(string, required): Launch configuration (contains command/args/env, etc.), string encrypted with owner token
Return Result (data):
nullFunction Description:
- Update launchConfig in database
- If server is running, reconnect server (restart)
- Notify related user sessions of capability changes
Permission: Owner only Function: Connect all enabled MCP servers
Request Parameters (data):
{}Return Result (data):
{
"successServers": [
{
"serverId": "server1",
"serverName": "Server 1",
...
}
],
"failedServers": [
{
"serverId": "server2",
"serverName": "Server 2",
...
}
]
}Function Description:
- Attempt to connect all servers with
enabled = true - Returns lists of successful and failed servers
Permission: Owner only Function: Create new MCP server configuration
Request Parameters (data):
serverId(string, required): Server ID (unique identifier)serverName(string, optional): Operator-managed display name, defaults to empty string. A custom downstream may fill an empty name fromserverInfo.name, but reconnects do not overwrite a non-empty configured nameenabled(boolean, optional): Whether enabled, defaults totruelaunchConfig(string, required): Encrypted launch configuration JSON (EncryptedData); must be non-empty and not{}; encrypted with Owner tokencapabilities(string or object, optional): ignored on create; useUPDATE_SERVER_CAPABILITIES (2003)to set capabilitiescreatedAt(number, optional): Creation time (Unix timestamp, seconds), defaults to current timeupdatedAt(number, optional): Update time (Unix timestamp, seconds), defaults to current timeallowUserInput(boolean, optional): Whether to allow user input, defaults tofalseproxyId(number, optional): Associated proxy ID, defaults to0toolTmplId(string, optional): Tool template ID, defaults tonullauthType(number, required): Server authorization type, defaults to1(ApiKey); seeServerAuthTypeenum above for all supported valuesconfigTemplate(string, required): JSON config template string; must be non-empty and not{}(validated regardless of allowUserInput)category(number, required): Server category.1: Template,2: CustomRemote,3: RestApi,4: Skills,5: CustomStdiolazyStartEnabled(boolean, optional): Enable lazy loading for this server. When true, server stays managed in memory, delays startup until first use, and idle/unexpected closes can return it toSleepingso it can be started again later. Defaults totruepublicAccess(boolean, optional): Whether public access is enabled. If true, users without explicit permissions can still access this server. Defaults tofalseanonymousAccess(boolean, optional): Whether anonymous access (no authentication token) is enabled. Defaults tofalseanonymousRateLimit(number, optional): Rate limit for anonymous access (requests per minute per source IP). Must be an integer between 1 and 1000. Defaults to10
Return Result (data):
{
"server": {
"serverId": "server123",
"serverName": "My Server",
"enabled": true,
...
}
}ConfigTemplate notes (by category)
- Template (1): must include
mcpJsonConfandcredentials, optionaloAuthConfig - CustomRemote (2): must include base URL info (used to assemble launchConfig for user config)
- RestApi (3): must include a non-empty
apisarray with an object atapis[0]; the system injectslaunchConfig.authintoapis[0].authwhen the server starts. Create and template-update requests reject malformed JSON or an invalid shape withINVALID_REQUEST (1001)before saving the server. - Skills (4): must include
typeandserverName - CustomStdio (5): must include
command; optionalargs(array) andenv(object). WhenallowUserInput=true, users override env viastdioEnvin User API- Docker deployment behavior: if
PETA_CORE_IN_DOCKER=trueandcommandis notdocker, peta-core wraps execution intodocker run ... petaio/mcp-runner:latest ...internally. Stored configuration format remains unchanged.
- Docker deployment behavior: if
OAuth Template note:
- If
configTemplate.oAuthConfig.clientIdexists, the decryptedlaunchConfigmust includeoauthfields (clientId,clientSecret,code,redirectUri, etc.); system exchanges and persists tokens. - For later owner-managed OAuth reauthorization, use
2016 GET_SERVER_OAUTH_REAUTH_CONTEXTand2017 REAUTHORIZE_SERVER_OAUTHinstead of2012 UPDATE_SERVER. - Intercom OAuth templates (
authType=16) additionally persistoauth.intercomRegionafter exchanging the authorization code. Intercom does not return refresh tokens, so Core stores a compatibility placeholder value internally and validates the access token through Intercom's/meendpoint at runtime. - If Intercom later reports that a stored token is invalid, owner-managed servers are disabled after Core clears the dynamic OAuth state. For
allowUserInput=trueservers, Core unconfigures the affected user's saved server configuration instead of keeping a stale temporary OAuth payload around.
Input examples (by category):
Template (1) - ApiKey (Postgres):
{
"action": 2010,
"data": {
"serverId": "postgres",
"serverName": "Postgres",
"category": 1,
"authType": 1,
"allowUserInput": true,
"configTemplate": "{\"toolId\":\"5f2504e04f8911d39a0c0331222c312\",\"name\":\"Postgres\",\"description\":\"PostgreSQL MCP server running in Docker with full read-write access.\",\"credentials\":\"[{\\\"name\\\":\\\"POSTGRES URL\\\",\\\"description\\\":\\\"\\\",\\\"dataType\\\":1,\\\"key\\\":\\\"YOUR_POSTGRES_URL\\\"}]\",\"mcpJsonConf\":\"{\\\"command\\\":\\\"docker\\\",\\\"args\\\":[\\\"run\\\",\\\"-i\\\",\\\"--rm\\\",\\\"--pull=always\\\",\\\"-e\\\",\\\"POSTGRES_URL\\\",\\\"-e\\\",\\\"ACCESS_MODE\\\",\\\"ghcr.io/dunialabs/mcp-servers/postgres:latest\\\"],\\\"env\\\":{\\\"POSTGRES_URL\\\":\\\"YOUR_POSTGRES_URL\\\",\\\"ACCESS_MODE\\\":\\\"readwrite\\\"}}\",\"authType\":1,\"authConfig\":\"\",\"toolDefaultConfig\":\"{\\\"postgresListSchemas\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"postgresListTables\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"postgresDescribeTable\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"postgresGetTableStats\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"postgresExecuteQuery\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"postgresExecuteWrite\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":2},\\\"postgresExplainQuery\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":2}}\"}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}Template (1) - OAuth (Notion):
{
"action": 2010,
"data": {
"serverId": "notion",
"serverName": "Notion",
"category": 1,
"authType": 3,
"allowUserInput": true,
"configTemplate": "{\"toolId\":\"a7c3f8e9b2d64a5891f3c7b0e4d2a8f6\",\"name\":\"Notion\",\"description\":\"Model Context Protocol (MCP) server for Notion integration.\",\"credentials\":\"[{\\\"name\\\":\\\"ClientId\\\",\\\"description\\\":\\\"An identifier for your integration, found in the integration settings.\\\",\\\"dataType\\\":1,\\\"key\\\":\\\"YOUR_CLIENT_ID\\\"},{\\\"name\\\":\\\"ClientSecret\\\",\\\"description\\\":\\\"Client Secret\\\",\\\"dataType\\\":1,\\\"key\\\":\\\"YOUR_CLIENT_SECRET\\\"},{\\\"name\\\":\\\"OAuth Code\\\",\\\"description\\\":\\\"OAuth Authorization Code\\\",\\\"dataType\\\":1,\\\"key\\\":\\\"YOUR_OAUTH_CODE\\\"},{\\\"name\\\":\\\"OAuth Redirect URI\\\",\\\"description\\\":\\\"OAuth Redirect URI\\\",\\\"dataType\\\":1,\\\"key\\\":\\\"YOUR_OAUTH_REDIRECT_URL\\\"}]\",\"mcpJsonConf\":\"{\\\"command\\\":\\\"docker\\\",\\\"args\\\":[\\\"run\\\",\\\"--pull=always\\\",\\\"-i\\\",\\\"--rm\\\",\\\"-e\\\",\\\"notionToken\\\",\\\"ghcr.io/dunialabs/mcp-servers/notion:latest\\\"],\\\"oauth\\\":{\\\"clientId\\\":\\\"YOUR_CLIENT_ID\\\",\\\"clientSecret\\\":\\\"YOUR_CLIENT_SECRET\\\",\\\"accessToken\\\":\\\"YOUR_ACCESS_TOKEN\\\",\\\"code\\\":\\\"YOUR_OAUTH_CODE\\\",\\\"redirectUri\\\":\\\"YOUR_OAUTH_REDIRECT_URL\\\"}}\",\"authType\":3,\"authConfig\":\"\",\"oAuthConfig\":{\"authorizationUrl\":\"https://api.notion.com/v1/oauth/authorize\",\"tokenUrl\":\"https://api.notion.com/v1/oauth/token\",\"clientId\":\"2b1d872b-594c-80c7-a98e-0037f2066ebe\",\"userClientId\":\"2ced872b-594c-80d5-a0c5-0037f162006c\",\"responseType\":\"code\",\"extraParams\":{\"owner\":\"user\"}},\"toolDefaultConfig\":\"{\\\"notionGetPage\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionCreatePage\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionUpdatePage\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionGetPageProperties\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionGetDatabase\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionQueryDatabase\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionCreateDatabase\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionUpdateDatabase\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionGetBlockChildren\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionAppendBlocks\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionGetBlock\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionUpdateBlock\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionDeleteBlock\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":2},\\\"notionSearch\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0},\\\"notionCreateComment\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":1},\\\"notionGetComments\\\":{\\\"enabled\\\":true,\\\"dangerLevel\\\":0}}\"}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}CustomRemote (2):
{
"action": 2010,
"data": {
"serverId": "custom-remote",
"serverName": "Custom Remote",
"category": 2,
"authType": 1,
"allowUserInput": true,
"configTemplate": "{\"url\":\"https://example.com/mcp\"}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}RestApi (3):
{
"action": 2010,
"data": {
"serverId": "rest-api",
"serverName": "REST API",
"category": 3,
"authType": 1,
"allowUserInput": true,
"configTemplate": "{\"baseUrl\":\"https://api.example.com\",\"apis\":[{\"path\":\"/\",\"auth\":{}}]}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}CustomStdio (5) — admin defines command/args/default env; user overrides env at configure time:
{
"action": 2010,
"data": {
"serverId": "custom-stdio-server",
"serverName": "Custom Stdio MCP",
"category": 5,
"authType": 1,
"allowUserInput": true,
"configTemplate": "{\"command\":\"/usr/local/bin/my-mcp-server\",\"args\":[\"--verbose\"],\"env\":{\"LOG_LEVEL\":\"info\"}}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}Permission: Owner + Admin Function: Query server list, supports multiple filter conditions
Request Parameters (data):
serverId(string, optional): Exact query for specified server IDproxyId(number, optional): Filter by proxyIdenabled(boolean, optional): Filter by enabled status
Return Result (data):
{
"servers": [
{
"serverId": "server123",
"serverName": "My Server",
"enabled": true,
"launchConfig": "{}",
"capabilities": "{}",
...
}
]
}Permission: Owner only Function: Update server configuration
Request Parameters (data):
serverId(string, required): Server IDserverName(string, optional): Operator-managed display name; downstreamserverInfo.namedoes not overwrite a non-empty configured valuelaunchConfig(string or object, optional): Launch configuration encrypted with owner token. Not updatable for Template with allowUserInput=truecapabilities(string or object, optional): Capability configuration. Merge semantics; omitted fields are not removedenabled(boolean, optional): Whether enabledconfigTemplate(string, optional): Only RestApi/CustomRemote/CustomStdio can updatelazyStartEnabled(boolean, optional): Enable lazy loading for this server. When true, server stays managed in memory, delays startup until first use, and idle/unexpected closes can return it toSleepingso it can be started again laterpublicAccess(boolean, optional): Public access flaganonymousAccess(boolean, optional): Anonymous access flaganonymousRateLimit(number, optional): Rate limit for anonymous access (requests per minute per source IP). Must be an integer between 1 and 1000
Return Result (data):
{
"server": {
"serverId": "server123",
...
}
}Function Description:
allowUserInputis immutable after creationconfigTemplateis only updatable for RestApi/CustomRemote/CustomStdio; Template updates will errorcapabilitiesuses merge semantics; explicitly setenabled=falseto disable- If server is running and
capabilitiesorlaunchConfigis updated, will trigger reload or restart - If
enabledchanges tofalse, will stop server
Input examples (by category):
Template (1) - update name/enable only:
{
"action": 2012,
"data": {
"serverId": "notion",
"serverName": "Notion Personal",
"enabled": true
}
}CustomRemote (2) - update configTemplate and launchConfig:
{
"action": 2012,
"data": {
"serverId": "custom-remote",
"configTemplate": "{\"url\":\"https://example.com/mcp\"}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}RestApi (3) - update capabilities (merge):
{
"action": 2012,
"data": {
"serverId": "rest-api",
"capabilities": {
"tools": {
"write_record": { "enabled": false, "description": "Disable write" }
},
"resources": {},
"prompts": {}
}
}
}CustomStdio (5) - update configTemplate and launchConfig:
{
"action": 2012,
"data": {
"serverId": "custom-stdio",
"configTemplate": "{\"command\":\"/usr/local/bin/my-mcp-server\",\"args\":[\"--verbose\"],\"env\":{\"LOG_LEVEL\":\"debug\"}}",
"launchConfig": "{\"data\":\"...\",\"iv\":\"...\",\"salt\":\"...\",\"tag\":\"...\"}"
}
}Note:
commandandargsinconfigTemplatedefine the base server binary. WhenallowUserInput=true, users can only overrideenvviastdioEnvin CONFIGURE_SERVER; thecommandandargsremain immutable to users. Admin edits do not automatically reconfigure existing user instances — users must reconfigure to pick up changes.
Permission: Owner + Admin Function: Delete specified server
Request Parameters (data):
serverId(string, required): Server ID
Return Result (data):
{
"message": "Server deleted successfully"
}Function Description:
- Remove server from ServerManager (stop connection)
- Permanently delete server record from database
Permission: Owner + Admin Function: Batch delete servers by proxyId
Request Parameters (data):
proxyId(number, required): Proxy ID
Return Result (data):
{
"deletedCount": 5
}Function Description:
- Stop connections for all matching servers
- Returns actual number of deleted servers
Permission: Owner + Admin Function: Count servers
Request Parameters (data):
{}Return Result (data):
{
"count": 10
}Permission: Owner only Function: Return the persisted OAuth configuration needed to reauthorize an existing owner-managed Template server
Request Parameters (data):
serverId(string, required): Server ID
Return Result (data):
{
"serverId": "zendesk",
"credentialSource": "custom",
"clientId": "your-client-id",
"oAuthConfig": {
"authorizationUrl": "https://example.zendesk.com/oauth/authorizations/new",
"tokenUrl": "https://example.zendesk.com/oauth/tokens",
"responseType": "code",
"scopes": "read write",
"extraParams": {
"access_type": "offline"
},
"applyUrl": "https://example.com/oauth-docs",
"pkce": {
"required": true,
"method": "S256"
}
},
"reauthorizeAvailable": true,
"missingFields": []
}Function Description:
- This action does not start browser authorization. It only returns the server-specific OAuth metadata that Console or an external caller needs before sending the user to the provider.
credentialSourceis derived from the persistedusePetaOauthConfigflag:peta: use Peta-managed OAuth app credentialscustom: use credentials already stored inside the encrypted server launch config
oAuthConfigis read from the server's persistedconfigTemplate.oAuthConfig, not from the latest cloud template. This avoids template drift during reauthorization.- For
customservers, Core decrypts the currentlaunchConfig.oauthto verify thatclientIdandclientSecretare present.clientSecretnever appears in the response. - Availability rules:
- Only
Templateservers are eligible - Only owner-managed servers (
allowUserInput=false) are eligible ApiKeyservers are not eligible- Placeholder endpoints such as
YOUR_OAUTH_*make the flow unavailable
- Only
- If any prerequisite is missing, the action still succeeds and returns
reauthorizeAvailable=false; callers must inspectmissingFieldsto decide whether to disable the UI or fall back to manual remediation.
Permission: Owner only Function: Complete OAuth reauthorization for an existing owner-managed Template server and persist the refreshed OAuth state
Request Parameters (data):
serverId(string, required): Server IDcode(string, required): OAuth authorization code returned by the providerredirectUri(string, required): Redirect URI used in the browser authorization steppkceVerifier(string, optional): PKCE verifier when the provider requires PKCE
Return Result (data):
{
"server": {
"serverId": "zendesk",
"serverName": "Zendesk",
"enabled": true,
"...": "..."
},
"message": "OAuth reauthorized successfully"
}Function Description:
- This action reuses persisted server state. It does not accept raw
authConf,clientSecret, or cloud template data from the caller. - Parameter sources are fixed:
credentialSourcecomes fromusePetaOauthConfig- OAuth endpoints, response type, scopes, extra params, and PKCE metadata come from persisted
configTemplate.oAuthConfig - For
custom,clientId/clientSecretcome from the decryptedlaunchConfig.oauth
- Execution rules:
petaservers use the existing Peta-managed OAuth exchange pathcustomservers exchange the code with the stored app credentials and preserve provider-specific runtime metadata where applicable
- Success behavior:
- Core replaces the relevant token fields inside the encrypted
launchConfig.oauth - Core then reuses the standard launch-config update / reconnect path so the managed server picks up the new OAuth state
- Core replaces the relevant token fields inside the encrypted
- Failure behavior:
- If the exchange fails, the previously stored token state remains unchanged
- Invalid category / auth mode / missing fields return an invalid-request style error rather than partially mutating the server
Permission: Owner + Admin Function: Get capability configurations of all available servers
Request Parameters (data):
{}Return Result (data):
{
"capabilities": {
"server1": {
"enabled": true,
"tools": {
"toolName": {
"enabled": true,
"description": "Tool description",
"dangerLevel": 0
}
},
"resources": {
"resourceName": {
"enabled": true,
"description": "Resource description"
}
},
"prompts": {
"promptName": {
"enabled": true,
"description": "Prompt description"
}
}
}
}
}Function Description:
- Returns capability configurations of all running servers
Permission: Owner + Admin Function: Get capability configurations of servers accessible to specified user
Request Parameters (data):
targetId(string, required): User ID
Return Result (data):
{
"capabilities": {
"server1": {
"enabled": true,
"tools": { ... },
"resources": { ... },
"prompts": { ... }
}
}
}Function Description:
- Prioritizes getting capability configuration from user's active sessions
- If user has no active sessions, calculates capabilities based on user permission configuration
- The returned
enabledfield reflects user's permission for that server
Permission: Owner + Admin Function: Get current status of all servers
Request Parameters (data):
{}Return Result (data):
{
"serversStatus": {
"server1": 0,
"server2": 1,
"server3": 2
}
}ServerStatus Enum:
0: Online1: Offline2: Connecting3: Error
Permission: Owner + Admin Function: Get capability configuration of specified server
Request Parameters (data):
targetId(string, required): Server ID
Return Result (data):
{
"capabilities": {
"tools": {
"toolName": {
"enabled": true,
"description": "Tool description",
"dangerLevel": 0
}
},
"resources": { ... },
"prompts": { ... }
}
}Function Description:
- If server is running, returns real-time capability configuration
- If server is not running, returns configuration stored in database
Permission: Owner + Admin Function: Replace mode update IP whitelist (delete all existing IPs, save new IP list to database and load to memory)
Request Parameters (data):
whitelist(array, required): IP address array (supports single IP or CIDR format)
Return Result (data):
{
"whitelist": ["192.168.1.0/24", "10.0.0.1"],
"message": "IP whitelist updated successfully. 2 IPs loaded."
}Function Description:
- Delete all existing IP records and insert new records in database transaction
- Automatically reload from database to memory, takes effect immediately
- Supported IP formats:
- Single IP:
"192.168.1.100" - CIDR:
"192.168.1.0/24" - Special value:
"0.0.0.0/0"means allow all IPs (disable filtering)
- Single IP:
Permission: Owner + Admin Function: Query current IP whitelist
Request Parameters (data):
{}Return Result (data):
{
"whitelist": ["192.168.1.0/24", "10.0.0.1"],
"count": 2
}Permission: Owner + Admin Function: Delete specified IP whitelist records
Request Parameters (data):
ips(array, required): Array of IP addresses to delete
Return Result (data):
{
"deletedCount": 2,
"message": "2 IP(s) deleted from whitelist"
}Function Description:
- Delete specified IPs from database
- Automatically reload to memory, takes effect immediately
- If specified IPs don't exist, returns
deletedCount: 0
Permission: Owner + Admin Function: Append mode add IPs to whitelist (without deleting existing IPs)
Request Parameters (data):
ips(array, required): Array of IP addresses to add
Return Result (data):
{
"addedIds": [10, 11, 12],
"addedCount": 3,
"skippedCount": 1,
"message": "3 IP(s) added to whitelist, 1 skipped (duplicates)"
}Function Description:
- Validates IP format (invalid format returns
INVALID_IP_FORMAT (5102)error) - Automatically skips duplicate IPs that already exist
- Automatically reloads to memory, takes effect immediately
Permission: Owner + Admin Function: IP filter switch operation (allow-all disable filter / deny-all enable filter)
Request Parameters (data):
operation(string, required): Operation type, optional values"allow-all"or"deny-all"
Return Result (data):
nullFunction Description:
allow-all operation (disable IP filtering):
- Add
"0.0.0.0/0"record to database (if already exists, don't add duplicate) - Effect: Allow all IP access
deny-all operation (enable IP filtering):
- Delete all
"0.0.0.0/0"records from database - Prerequisite: Database must have other IP configurations, otherwise returns error
- Effect: Enable strict IP whitelist filtering
Usage Recommendations:
- First use ADD_IP_WHITELIST (4004) to add allowed IPs
- Then use deny-all operation to enable IP filtering
- Use allow-all operation when temporarily disabling filtering
Permission: Public without an Authorization header for Console setup/login. A supplied Authorization header must be valid. Function: Query proxy information (system only supports single proxy)
Request Parameters (data):
{}Return Result (data):
{
"proxy": {
"id": 1,
"name": "My MCP Server",
"proxyKey": "xxx",
"addtime": 1234567890,
"startPort": 3002
}
}Function Description:
- If no proxy exists, returns
proxy: null - Without an Authorization header, returns only
id,name,proxyKey,startPort, andaddtime.proxyKeyis the public proxy identifier used by Console setup/login. - Authenticated Owner/Admin requests receive the full proxy record. Anonymous responses omit
logWebhookUrlandlastSyncedLogId.
Permission: Public without an Authorization header during empty-system setup. A supplied Authorization header must be valid. Function: Create proxy (system only allows one proxy)
Request Parameters (data):
name(string, required): Proxy nameproxyKey(string, required): Proxy key
Return Result (data):
{
"proxy": {
"id": 1,
"name": "My MCP Server",
"proxyKey": "xxx",
"startPort": 3002,
"addtime": 1234567890
}
}Function Description:
- System only allows one proxy to exist
- If proxy already exists, returns
PROXY_ALREADY_EXISTS (5002)error startPortautomatically reads environment variableBACKEND_PORT
Permission: Owner + Admin Function: Update proxy information
Request Parameters (data):
proxyId(string, required): Current Proxy key (for lookup)name(string, required): New Proxy name
Return Result (data):
{
"proxy": {
"id": 1,
"name": "Updated Name",
...
}
}Permission: Owner only Function: Delete proxy (will clear all related data)
Request Parameters (data):
proxyId(number, required): proxy Key
Return Result (data):
{
"message": "Proxy deleted successfully"
}Function Description:
- Delete proxy record
- Clear all users, servers, IP whitelist, logs
- Disconnect all active sessions
- Stop all MCP servers
Permission: Owner only Function: Stop proxy application (completely shut down application process)
Request Parameters (data):
{}Return Result (data):
{
"message": "Proxy shutdown initiated successfully"
}Function Description:
- Triggers complete application shutdown process (equivalent to SIGTERM/SIGINT signal)
- Stop HTTP/HTTPS server from accepting new connections
- Stop event cleanup service
- Close log sync service (flush remaining logs)
- Clean up all client sessions
- Close all downstream MCP server connections
- Call
process.exit(0)to exit application process
Important Notes:
⚠️ After executing this operation, the application will completely stop and requires manual service restart- Response will be sent to client before application closes
- Recommend notifying all users and saving important data before execution
Permission: Owner + Admin Function: Full database backup
Request Parameters (data):
{}Return Result (data):
{
"backup": {
"version": "1.0",
"timestamp": 1729431234,
"tables": {
"users": [ ... ],
"servers": [ ... ],
"proxies": [ ... ],
"ipWhitelist": [ ... ]
}
},
"stats": {
"usersCount": 50,
"serversCount": 10,
"proxiesCount": 1,
"ipWhitelistCount": 5
}
}Function Description:
- Export all user, server, proxy, IP whitelist data
- Returned backup data can be used for restore operations
Permission: Owner + Admin, or without an Authorization header when the proxy, users, and servers are all empty. A supplied Authorization header must be valid. Function: Full database restore
Request Parameters (data):
backup(object, required): Backup data object (format returned by BACKUP_DATABASE)
Return Result (data):
{
"message": "Database restored successfully",
"stats": {
"usersRestored": 50,
"serversRestored": 10,
"proxiesRestored": 1,
"ipWhitelistRestored": 5,
"serversStarted": 8,
"serversFailed": 2
}
}Restore Process:
- Stop all MCP server connections
- Disconnect all user sessions
- In database transaction: delete all existing data → insert backup data
- Reload IP whitelist to memory
- Reinitialize enabled MCP servers
Permission: Owner only Function: Set log sync webhook URL
Request Parameters (data):
proxyKey(string, required): Proxy keywebhookUrl(string or null, required): Webhook URL (nullmeans disable sync)
Return Result (data):
{
"proxyId": 1,
"proxyName": "My MCP Server",
"webhookUrl": "https://example.com/webhook",
"message": "Log webhook URL set successfully"
}Function Description:
- After setting webhook URL, logs will automatically sync to specified URL
- Set to
nullto disable log sync - URL must use http or https protocol
Permission: Owner only Function: Get log records
Request Parameters (data):
id(number, optional): Starting log ID (defaults to 0, starts from first record)limit(number, optional): Number of records to return (default 1000, max 5000)
Return Result (data):
{
"logs": [
{
"id": 1,
"action": 1,
"userid": "user123",
"serverId": null,
"createdAt": 1729431234,
"sessionId": "",
"upstreamRequestId": "",
"uniformRequestId": null,
...
}
],
"count": 1,
"startId": 1,
"limit": 1000
}Function Description:
- When
idis 0, starts from first log limitexceeding 5000 will be automatically limited to 5000createdAtfield is Unix timestamp (seconds, Int type)
Permission: Owner + Admin Function: Update or create cloudflared configuration and immediately restart container to apply configuration
Request Parameters (data):
proxyKey(string, required): Proxy key (for finding proxyId)tunnelId(string, required): Cloudflare Tunnel IDsubdomain(string, required): Subdomain (e.g.,xxx.trycloudflare.com)credentials(object or string, required): Tunnel credentials (object or JSON string, must containTunnelSecretfield)publicIp(string, optional): Public IP address (for record only), defaults to empty string
Return Result (data):
{
"dnsConf": {
"id": 1,
"tunnelId": "abc123",
"subdomain": "my-app.trycloudflare.com",
"type": 1,
"proxyId": 1,
"publicIp": "1.2.3.4",
"createdBy": 1,
"addtime": 1729431234,
"updateTime": 1729431235
},
"restarted": true,
"message": "Cloudflared config updated and restarted successfully",
"publicUrl": "https://my-app.trycloudflare.com"
}Function Description:
- If no configuration exists for this proxy in database, automatically creates new record
- If configuration already exists, updates existing record
- If old configuration was locally created (
createdBy = 0), automatically calls Cloud API to delete old tunnel - Externally created configurations (
createdBy = 1) will not delete old tunnel - Automatically writes credential files to
./cloudflared/{tunnelId}.jsonand./cloudflared/credentials.json - Calls
start-cloudflared-auto.cjsscript to restart cloudflared container - If restart fails, still returns success (data saved), but
restarted: falseand includes error information
credentials object example:
{
"AccountTag": "xxx",
"TunnelSecret": "xxx",
"TunnelID": "abc123",
"TunnelName": "my-tunnel"
}Permission: Owner + Admin Function: Query cloudflared configuration list (supports multi-condition filtering, AND relationship), and returns Docker container running status
Request Parameters (data, all parameters optional, AND relationship):
proxyKey(string, optional): Filter by Proxy keytunnelId(string, optional): Filter by Tunnel IDsubdomain(string, optional): Filter by subdomaintype(number, optional): Filter by type (usually 1)
Return Result (data):
{
"dnsConfs": [
{
"id": 1,
"tunnelId": "abc123",
"subdomain": "my-app.trycloudflare.com",
"type": 1,
"proxyId": 1,
"publicIp": "1.2.3.4",
"createdBy": 1,
"addtime": 1729431234,
"updateTime": 1729431235,
"status": "running"
}
]
}Function Description:
- All provided parameters must match simultaneously (AND relationship)
- Returns all configurations if no parameters provided
- Return result is an array, may be empty array
- Each record includes Docker container's real-time running status
Field Description:
type: Configuration type (1= Cloudflare Tunnel)createdBy: Creation source (0= locally auto-created,1= externally API created)proxyId: Associated Proxy IDaddtime: Creation time (Unix timestamp, seconds)updateTime: Last update time (Unix timestamp, seconds)status: Docker container status ("running"= running,"stopped"= stopped,"not_exist"= not exist)
Permission: Owner + Admin Function: Delete cloudflared configuration, stop and delete Docker container, clean up local files and database records
Request Parameters (data, at least one required):
id(number, optional): DNS configuration record IDtunnelId(string, optional): Tunnel ID
Return Result (data):
{
"success": true,
"message": "Cloudflared configuration deleted successfully",
"deletedConfig": {
"id": 1,
"tunnelId": "abc123",
"subdomain": "my-app.trycloudflare.com"
}
}Function Description:
- Stop Docker container (
docker stop peta-core-cloudflared) - Delete Docker container (
docker rm peta-core-cloudflared) - Delete local credential files:
cloudflared/{tunnelId}.jsoncloudflared/credentials.jsoncloudflared/config.yml
- Delete configuration record from database
- Will not call Cloud API to delete remote tunnel (remote tunnel remains in Cloudflare account)
- If container or files don't exist, doesn't affect deletion process (ignore errors and continue)
Error Cases:
- If corresponding configuration not found in database, returns
CLOUDFLARED_CONFIG_NOT_FOUND (8001)error - If container operation fails (and container actually exists), returns
TUNNEL_DELETE_FAILED (8004)error
Permission: Owner + Admin Function: Restart cloudflared service, verify configuration completeness then restart Docker container
Request Parameters (data):
{}Return Result (data):
{
"success": true,
"message": "Cloudflared restarted successfully",
"containerStatus": "running",
"config": {
"tunnelId": "abc123",
"subdomain": "my-app.trycloudflare.com",
"publicUrl": "https://my-app.trycloudflare.com"
}
}Function Description:
- Strictly verify local settings:
- Check if database has configuration record with
type=1 - Check if local credential file
cloudflared/{tunnelId}.jsonexists - Verify credential file contains required
TunnelSecretfield
- Check if database has configuration record with
- Execute restart:
- Call
start-cloudflared-auto.cjsscript to restart container - Verify container started successfully (status is
running)
- Call
- Return configuration information:
- Includes Tunnel ID, subdomain, and public access URL
Error Cases:
- If no configuration in database, returns
CLOUDFLARED_DATABASE_CONFIG_NOT_FOUND (8005)error - If local file missing or format error, returns
CLOUDFLARED_LOCAL_FILE_NOT_FOUND (8006)error - If restart script execution fails, returns
CLOUDFLARED_RESTART_FAILED (8003)error - If container status after startup is not
running, returnsCLOUDFLARED_RESTART_FAILED (8003)error
Important Notes:
- This operation will not automatically fix missing data or files
- If data is incomplete, please use
UPDATE_CLOUDFLARED_CONFIG (8001)to reconfigure first
Permission: Owner + Admin Function: Stop cloudflared service (stop Docker container, do not delete container and configuration)
Request Parameters (data):
{}Return Result (data):
{
"success": true,
"message": "Cloudflared stopped successfully",
"containerStatus": "stopped",
"alreadyStopped": false
}If container already stopped:
{
"success": true,
"message": "Cloudflared container is already stopped",
"containerStatus": "stopped",
"alreadyStopped": true
}Function Description:
- Check container current running status
- If container is not running (
stoppedornot_exist), directly return success - If container is running, execute
docker stop peta-core-cloudflared - Verify container has stopped
- Preserved:
- Docker container (stopped state)
- Local configuration files
- Database configuration records
Error Cases:
- If container stop command execution fails, returns
CLOUDFLARED_STOP_FAILED (8007)error - If container still running after executing stop command, returns
CLOUDFLARED_STOP_FAILED (8007)error
Important Notes:
- After stopping, can use
RESTART_CLOUDFLARED (8004)to quickly restore service - For complete cleanup, use
DELETE_CLOUDFLARED_CONFIG (8003)
Result-cache APIs are admin-facing controls used to inspect cache status/policies and purge cache entries by scope.
Permission: Owner + Admin Function: Get result-cache health and metric snapshot.
Request Parameters (data):
{}Return Result (data):
{
"enabled": true,
"health": {
"ok": true,
"backend": "db",
"details": "healthy"
},
"metrics": {
"lookup": 10,
"hit": 7,
"miss": 3,
"purge": 1
}
}Permission: Owner + Admin Function: Get cache policy configuration.
Request Parameters (data):
serverId(string, optional):- omitted → return global cache config only
- provided → return global config + server-level policy projection
Return Result (data):
{
"serverId": "github",
"globalConfig": {
"enabled": true,
"backend": "db",
"defaultTtlSeconds": 30,
"defaultAdmissionPolicy": "immediate",
"defaultAdmissionWindowSeconds": 300,
"maxEntryBytes": 262144
},
"tools": {
"create_issue": { "enabled": true, "ttlSeconds": 30 }
},
"prompts": {
"summarize": { "enabled": true, "ttlSeconds": 30 }
},
"resources": {
"exact": {
"repo://owner/repo": { "enabled": true, "ttlSeconds": 30 }
},
"inline": {
"repo://owner/repo": { "enabled": true, "ttlSeconds": 30 }
},
"patterns": [
{
"pattern": "repo://owner/*",
"enabled": true,
"cache": { "enabled": true, "ttlSeconds": 30 }
}
]
}
}Resource policy layers:
tools,prompts, andresourcesare projected fields and may be omitted when Core cannot load/parse stored capabilities forserverId.resources.exact: normalized projection ofresourceCachePolicies.exact(highest-priority exact match), returned as cache-policy objects ({ ...cache, enabled }) rather than raw{ enabled?, cache? }entries.resources.inline: fromcapabilities.resources[uri].cache(fallback per-resource cache)resources.patterns: fromresourceCachePolicies.patterns(pattern-based fallback)
Permission: Owner + Admin Function: Purge all cache entries.
Request Parameters (data):
reason(string, optional): optional audit context
Return Result (data):
{
"purged": true,
"scope": "global"
}Permission: Owner + Admin Function: Purge all cache entries for a server.
Request Parameters (data):
serverId(string, required)reason(string, optional)
Return Result (data):
{
"purged": true,
"scope": "server",
"serverId": "github"
}Permission: Owner + Admin Function: Purge cache for one tool on a server.
Request Parameters (data):
serverId(string, required)toolName(string, required)reason(string, optional)
Return Result (data):
{
"purged": true,
"scope": "tool",
"serverId": "github",
"toolName": "create_issue"
}Permission: Owner + Admin Function: Purge cache for one prompt on a server.
Request Parameters (data):
serverId(string, required)promptName(string, required)reason(string, optional)
Return Result (data):
{
"purged": true,
"scope": "prompt",
"serverId": "github",
"promptName": "summarize"
}Permission: Owner + Admin Function: Purge cache for one resource URI on a server.
Request Parameters (data):
serverId(string, required)uri(string, required)reason(string, optional)
Return Result (data):
{
"purged": true,
"scope": "resource",
"serverId": "github",
"uri": "repo://owner/repo"
}Permission: Owner + Admin Function: Purge a single exact cache key computed from operation/server/entity/scope/request params.
Request Parameters (data):
operation(string, required): one oftool,resource,promptserverId(string, required)entityId(string, required):tooloperation → tool namepromptoperation → prompt nameresourceoperation → resource URI
policy(object, optional): resolved cache policy object.- if omitted, server resolves effective policy from stored
server.capabilitiesin Core - explicit
policymust followResolvedCachePolicyshape:enabled(boolean)ttlSeconds(number)scope(global|user|tenant)admissionPolicy(immediate|second_hit)admissionWindowSeconds(number)denyFields(string[])allowFields(string[], optional)maxEntryBytes(number)
- this shape is different from
CACHE_GET_POLICYentity configs (CachePolicyConfig, including nestedkey.denyFields/key.allowFields)
- if omitted, server resolves effective policy from stored
scopeContext(object, optional):{ userId?: string, tenantId?: string }requestParams(unknown, optional): request payload used in cache-key canonicalizationreason(string, optional)
Scope validation rules:
- if resolved scope is
user,scopeContext.userIdis required - if resolved scope is
tenant,scopeContext.tenantIdis required - if
policyis omitted and server/policy cannot be resolved for the target entity, the request fails
Return Result (data):
{
"purged": true,
"scope": "exact",
"operation": "tool",
"serverId": "github",
"entityId": "create_issue"
}Permission: Owner + Admin
Function: Create a new tool policy set. If serverId is omitted, the policy set is global (applies to all servers).
Request Parameters (data):
serverId(string, optional): Server ID to scope this policy set. Omit for a global policy set.dsl(object, required): Policy DSL object defining the rules for this policy set.
Return Result (data):
{
"id": "clxxx...",
"serverId": "server-abc",
"version": 1,
"status": "active",
"dsl": { "schemaVersion": 1, "rules": [] },
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}DSL Schema Reference:
The dsl object follows this structure:
schemaVersion(number): Schema version, currently1rules(array): List of policy rules. Each rule contains:match(object): Criteria to match a tool call (e.g.,toolName,serverId)extract(object, optional): Fields to extract from tool arguments for condition evaluationwhen(object, optional): Conditions that must be true for the rule to applyeffect(string): Action to take —"allow","deny", or"require_approval"
Permission: Owner + Admin
Function: List policy sets. If serverId is provided, returns only policy sets for that server. Otherwise returns all policy sets.
Request Parameters (data):
serverId(string, optional): Filter by server ID.
Return Result (data):
{
"policySets": [
{
"id": "clxxx...",
"serverId": "server-abc",
"version": 1,
"status": "active",
"dsl": { "schemaVersion": 1, "rules": [] },
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
]
}Permission: Owner + Admin
Function: Update an existing policy set's DSL or status. The version field increments when dsl is updated.
Request Parameters (data):
id(string, required): Policy set ID.dsl(object, optional): New DSL object to replace the existing one.status(string, optional): New status —"active"or"archived".
Return Result (data):
{
"id": "clxxx...",
"serverId": "server-abc",
"version": 2,
"status": "active",
"dsl": { "schemaVersion": 1, "rules": [] },
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:01:00.000Z"
}Permission: Owner + Admin Function: Permanently delete a policy set by ID. Returns the deleted record.
Request Parameters (data):
id(string, required): Policy set ID to delete.
Return Result (data):
{
"id": "clxxx...",
"serverId": "server-abc",
"version": 2,
"status": "archived",
"dsl": { "schemaVersion": 1, "rules": [] },
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:01:00.000Z"
}Permission: Owner + Admin
Function: Get the effective (active) policy sets for a given server. Returns active server-specific policy sets combined with active global policy sets (where serverId is null). If serverId is omitted, returns only global active policy sets.
Request Parameters (data):
serverId(string, optional): Server ID to resolve effective policy for.
Return Result (data):
{
"policySets": [
{
"id": "clxxx...",
"serverId": "server-abc",
"version": 1,
"status": "active",
"dsl": { "schemaVersion": 1, "rules": [] },
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
]
}Function Description:
- Only returns policy sets with
status = "active" - Combines server-specific policy sets (matching
serverId) with global policy sets (serverIdis null) - Use this to determine which rules are currently enforced for a given server
Permission: Owner + Admin Function: List approval requests with optional filtering and pagination. All filter parameters are optional and combined with AND logic.
Request Parameters (data):
userId(string, optional): Filter by user ID.serverId(string, optional): Filter by server ID.toolName(string, optional): Filter by tool name.status(string, optional): Filter by approval status.page(number, optional): 1-based page number. Defaults to1.pageSize(number, optional): Number of items per page. Defaults to20, max100.
Return Result (data):
{
"page": 1,
"pageSize": 20,
"hasMore": true,
"requests": [
{
"id": "clxxx...",
"userId": "user-abc",
"serverId": "server-abc",
"toolName": "send_email",
"canonicalArgs": {},
"redactedArgs": {},
"requestHash": "sha256-hex",
"resumeToken": "clxxx...",
"status": "PENDING",
"decidedAt": null,
"decisionReason": null,
"decidedByUserId": null,
"decidedByRole": null,
"decisionChannel": null,
"executedAt": null,
"executionError": null,
"uniformRequestId": null,
"expiresAt": "2026-01-01T01:00:00.000Z",
"policyVersion": 1,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
]
}Permission: Owner + Admin Function: Get a single approval request by ID.
Request Parameters (data):
id(string, required): Approval request ID.
Return Result (data):
{
"id": "clxxx...",
"userId": "user-abc",
"serverId": "server-abc",
"toolName": "send_email",
"canonicalArgs": {},
"redactedArgs": {},
"requestHash": "sha256-hex",
"resumeToken": "clxxx...",
"status": "PENDING",
"decidedAt": null,
"decisionReason": null,
"decidedByUserId": null,
"decidedByRole": null,
"decisionChannel": null,
"executedAt": null,
"executionError": null,
"uniformRequestId": null,
"expiresAt": "2026-01-01T01:00:00.000Z",
"policyVersion": 1,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Field Description:
status: Current state —"PENDING","APPROVED","REJECTED","EXPIRED","EXECUTING","EXECUTED", or"FAILED"resumeToken: Stable resume handle (currently same value asid) for client retries and correlationdecidedAt: Timestamp when the decision was made, ornulldecisionReason: Optional reason provided when decided, ornulldecidedByUserId: User ID of the actor who approved/rejected the request, ornulldecidedByRole: NumericUserRolesnapshot of the deciding actor, ornulldecisionChannel: Decision source, currently"admin_api"or"socket"canonicalArgs: Normalized tool arguments used for hashing/comparisonredactedArgs: Redacted arguments safe for logging/displayrequestHash: Deterministic hash used for deduplicationexpiresAt: Timestamp after which the request automatically expirespolicyVersion: The policy set version that triggered this approval requestexecutedAt/executionError: Execution result metadata after approvaluniformRequestId: Optional correlation ID for upstream request mapping
Permission: Owner + Admin Function: Approve or reject a pending approval request. The deciding admin's identity is recorded.
Request Parameters (data):
id(string, required): Approval request ID.decision(string, required): Decision to apply —"APPROVED"or"REJECTED".reason(string, optional): Human-readable reason for the decision.
Return Result (data):
{
"id": "clxxx...",
"userId": "user-abc",
"serverId": "server-abc",
"toolName": "send_email",
"canonicalArgs": {},
"redactedArgs": {},
"requestHash": "sha256-hex",
"resumeToken": "clxxx...",
"status": "APPROVED",
"decidedAt": "2026-01-01T00:05:00.000Z",
"decisionReason": "Reviewed and approved",
"decidedByUserId": "owner-abc",
"decidedByRole": 1,
"decisionChannel": "admin_api",
"executedAt": null,
"executionError": null,
"uniformRequestId": null,
"expiresAt": "2026-01-01T01:00:00.000Z",
"policyVersion": 1,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:05:00.000Z"
}Error Cases:
- If the request is not in
PENDINGstatus, the decision cannot be applied
Permission: Owner + Admin Function: Count the number of pending approval requests, optionally scoped to a specific user.
Request Parameters (data):
userId(string, optional): User ID to scope the count to. If omitted, counts pending requests across all users.
Return Result (data):
{
"count": 5
}Permission: Owner + Admin Function: Get global discovery enablement and default profile
Request Parameters (data):
{}Return Result (data):
{
"enabled": true,
"defaultProfileId": "clxxx...",
"mode": "HYBRID"
}Function Description:
- Returns the current global discovery configuration
enabledindicates whether progressive disclosure is activedefaultProfileIdis the ID of the default profile (ornullif none)modeis the mode of the default profile (falls back toFLATif no profile exists)
Permission: Owner + Admin Function: Update global discovery enablement and default profile
Request Parameters (data):
enabled(boolean, required): Whether progressive disclosure is enableddefaultProfileId(string or null, optional): ID of the default discovery profile
Return Result (data):
{
"enabled": true,
"defaultProfileId": "clxxx..."
}Function Description:
- Updates the global discovery configuration
- The response contains
enabledanddefaultProfileIdonly (does not includemode) - If
defaultProfileIdis provided and non-null, the referenced profile is set as default - If
defaultProfileIdis omitted ornull, the existing default profile is not cleared - The
enabledflag is persisted on the active default profile record
Permission: Owner + Admin Function: Create a discovery profile
Request Parameters (data):
name(string, required): Profile name (must be non-empty)description(string, optional): Profile descriptionmode(string, required): Discovery mode —FLAT,HYBRID, orSTRICTenabled(boolean, optional): Whether profile is activeisDefault(boolean, optional): Whether this is the default profileconfig(object, optional): Profile configuration (DiscoveryProfileConfig)instructionText(string, optional): Instruction text for AI clients
Return Result (data):
{
"id": "clxxx...",
"name": "Production Profile",
"description": "Hybrid mode for production",
"mode": "HYBRID",
"enabled": true,
"isDefault": true,
"config": {
"directExposureRules": []
},
"instructionText": null,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Function Description:
- Creates a new discovery profile
- If
isDefaultis true, all other profiles are set to non-default - Invalidates the discovery config cache after creation
Permission: Owner + Admin Function: List all discovery profiles
Request Parameters (data):
{}Return Result (data):
{
"profiles": [
{
"id": "clxxx...",
"name": "Production Profile",
"description": "Hybrid mode for production",
"mode": "HYBRID",
"enabled": true,
"isDefault": true,
"config": {},
"instructionText": null,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
]
}Function Description:
- Returns all discovery profiles ordered by creation time ascending
Permission: Owner + Admin Function: Get one discovery profile by ID
Request Parameters (data):
id(string, required): Discovery profile ID
Return Result (data):
Profile object (same shape as items in GET_DISCOVERY_PROFILES response).
Function Description:
- Returns a single discovery profile
- Returns error if profile not found
Permission: Owner + Admin Function: Update a discovery profile
Request Parameters (data):
id(string, required): Discovery profile IDname(string, optional): Profile name (cannot be blank)description(string, optional): Profile descriptionmode(string, optional): Discovery mode —FLAT,HYBRID, orSTRICTenabled(boolean, optional): Whether profile is activeisDefault(boolean, optional): Whether this is the default profileconfig(object, optional): Profile configuration (DiscoveryProfileConfig)instructionText(string, optional): Instruction text for AI clients
Return Result (data):
The updated profile object.
Function Description:
- Updates an existing discovery profile
- If
isDefaultis set to true, all other profiles are set to non-default - Invalidates the discovery config cache after update
- Returns error if profile not found
Permission: Owner + Admin Function: Delete a discovery profile
Request Parameters (data):
id(string, required): Discovery profile ID
Return Result (data):
The deleted profile object.
Function Description:
- Permanently deletes a discovery profile
- Returns error if profile not found
- Invalidates the discovery config cache after deletion
Permission: Owner + Admin Function: Preview which tools are directly exposed vs catalog-only for a given profile
Request Parameters (data):
profileId(string, optional): Discovery profile ID. If omitted, uses the default profile. If no profile exists, uses FLAT mode.
Return Result (data):
{
"mode": "HYBRID",
"directTools": [
{
"name": "github::create_issue",
"serverId": "github"
}
],
"hiddenTools": [
{
"actionId": "act_xxx",
"displayName": "send_email",
"serverId": "email"
}
],
"catalogToolsIncluded": [
"peta.catalog.search",
"peta.catalog.describe",
"peta.catalog.execute"
],
"totalDirectCount": 5,
"totalHiddenCount": 10
}Function Description:
- Reads from the catalog index (not live runtime) to preview how tools would be partitioned
- In
FLATmode, all tools are direct andcatalogToolsIncludedis empty - In
STRICTmode, all tools are hidden - In
HYBRIDmode,directExposureRulesfrom the profile config determine the split - Use
REINDEX_CATALOG (9330)first to ensure the catalog index is current
Permission: Owner + Admin Function: Rebuild the persistent catalog index from live managed servers
Request Parameters (data):
{}Return Result (data):
Index build statistics (varies by implementation).
Function Description:
- Triggers a full reindex of the discovery catalog
- Scans all live managed server contexts and rebuilds the
CatalogActionrows - Temporary or user-scoped server contexts are excluded from the global catalog index
Permission: Owner + Admin Function: Get catalog row count, server count, and last-indexed timestamp
Request Parameters (data):
{}Return Result (data):
{
"totalActions": 42,
"serversIndexed": 5,
"lastIndexedAt": "2026-01-01T00:00:00.000Z"
}Function Description:
- Returns aggregate statistics about the discovery catalog index
lastIndexedAtisnullif no index build has occurred yet
| Error Code | Name | Trigger Condition |
|---|---|---|
| 1001 | INVALID_REQUEST | Request format error, missing required fields, parameter type error |
| 1002 | UNAUTHORIZED | No valid authentication Token provided |
| 1003 | FORBIDDEN | Insufficient permissions (e.g., non-Owner role attempting Owner-only operation) |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 2001 | USER_NOT_FOUND | Specified user ID does not exist |
| 2002 | USER_ALREADY_DISABLED | User is already disabled |
| 2003 | USER_ALREADY_EXISTS | When creating user, userId already exists |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 3001 | SERVER_NOT_FOUND | Specified server ID does not exist |
| 3002 | SERVER_ALREADY_RUNNING | Server is already in running state |
| 3003 | SERVER_ALREADY_EXISTS | When creating server, serverId already exists |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 4001 | INSUFFICIENT_PERMISSIONS | User permissions insufficient to execute operation |
| 4002 | INVALID_PERMISSION_FORMAT | Permission configuration format invalid |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 5001 | PROXY_NOT_FOUND | Specified proxy does not exist |
| 5002 | PROXY_ALREADY_EXISTS | System already has proxy (only one allowed) |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 5101 | IPWHITELIST_NOT_FOUND | Specified IP whitelist record does not exist |
| 5102 | INVALID_IP_FORMAT | IP address or CIDR format invalid |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 5201 | DATABASE_OPERATION_FAILED | Database operation failed |
| 5202 | TRANSACTION_FAILED | Database transaction failed |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 5301 | BACKUP_FAILED | Database backup failed |
| 5302 | RESTORE_FAILED | Database restore failed |
| 5303 | INVALID_BACKUP_DATA | Backup data format invalid |
| Error Code | Name | Trigger Condition |
|---|---|---|
| 8001 | CLOUDFLARED_CONFIG_NOT_FOUND | Specified cloudflared configuration not found in database |
| 8002 | INVALID_CREDENTIALS_FORMAT | Tunnel credentials format invalid or missing TunnelSecret field |
| 8003 | CLOUDFLARED_RESTART_FAILED | Cloudflared restart failed (script execution failed or container not started) |
| 8004 | TUNNEL_DELETE_FAILED | Failed to delete tunnel or container |
| 8005 | CLOUDFLARED_DATABASE_CONFIG_NOT_FOUND | Cloudflared configuration does not exist in database (during restart) |
| 8006 | CLOUDFLARED_LOCAL_FILE_NOT_FOUND | Local credential file does not exist or format error |
| 8007 | CLOUDFLARED_STOP_FAILED | Failed to stop cloudflared container |
- Protocol Version: 2.3
- Last Updated: April 3, 2026
- Update Content:
- Added Discovery / Progressive Disclosure operations (9300-9399): GET/SET_DISCOVERY_CONFIG, CRUD for discovery profiles, PREVIEW_DISCOVERY, REINDEX_CATALOG, GET_CATALOG_STATS
- Added DiscoveryMode enum and DiscoveryProfileConfig data structure to reference sections
Version History:
-
2.2 (March 13, 2026):
- Added ServerCategory
Skills (4)andCustomStdio (5)to enum reference - Fixed ServerAuthType enum:
CanvasAuthis8, addedCanvaAuth (9) - Added CustomStdio (category=5) input example for CREATE_SERVER (2010)
- Added ConfigTemplate notes for Skills and CustomStdio categories
- Added
anonymousAccessandanonymousRateLimitparameters to CREATE_SERVER (2010) and UPDATE_SERVER (2012) - Updated UPDATE_SERVER (2012):
configTemplateis now also updatable for CustomStdio servers - Added custom-stdio launchConfig format to Decrypted launchConfig Structure
- Added ServerCategory
-
2.1 (November 7, 2025):
- Added Cloudflared operation APIs:
- 8003 DELETE_CLOUDFLARED_CONFIG - Delete cloudflared configuration
- 8004 RESTART_CLOUDFLARED - Restart cloudflared service
- 8005 STOP_CLOUDFLARED - Stop cloudflared service
- Enhanced 8002 GET_CLOUDFLARED_CONFIGS - Added status field to return result (container running status)
- Added Cloudflared related error codes (8005-8007)
- Improved error handling and status management descriptions for Cloudflared operations
- Added Cloudflared operation APIs:
-
2.0 (October 20, 2025):
- Complete document rewrite, sorted by AdminActionType numbers (1001-7002)
- Added detailed request parameters and return result descriptions for each API
- Marked all Owner-only operations
- Unified error code reference table
- Added curl and TypeScript calling examples