Skip to main content

MCP (Model Context Protocol) API

The RocketWave Pulse Admin exposes an MCP-compatible HTTP API that allows AI assistants and agents to interact with the platform programmatically. This enables tools like Claude Desktop, Cursor IDE, and custom agents to manage workflow entities, workflows, and other resources.

Overview

The MCP implementation follows a wrapper architecture - MCP endpoints forward requests to existing API routes, inheriting all authentication, validation, and business logic without duplication.

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│ MCP Client │────▶│ MCP Layer │────▶│ Existing API │
│ (Claude, etc.) │ │ (Thin Wrapper) │ │ Routes │
└─────────────────┘ └─────────────────┘ └─────────────────┘

Authentication

MCP endpoints require the same session cookie authentication as the regular API. The session cookie is forwarded to internal API calls.

POST /api/mcp/tools/call
Cookie: rocketwave_session=<session_token>
Content-Type: application/json

Endpoints

List Tools

Returns all available MCP tools with their input schemas.

GET /api/mcp/tools

Response:

{
"tools": [
{
"name": "entities_list",
"description": "List workflow entities with optional filtering",
"inputSchema": {
"type": "object",
"properties": {
"organizationId": { "type": "string", "description": "Organization UUID" },
"environmentId": { "type": "string", "description": "Environment UUID" },
"page": { "type": "number", "description": "Page number" },
"limit": { "type": "number", "description": "Items per page" }
},
"required": ["organizationId"]
}
}
]
}

Call Tool

Execute an MCP tool.

POST /api/mcp/tools/call
Content-Type: application/json
Cookie: rocketwave_session=<session_token>

{
"name": "entities_create",
"arguments": {
"organizationId": "uuid-here",
"environmentId": "uuid-here",
"name": "My Event Entity",
"workflowEntityTypeId": "event-type-uuid",
"condition": {
"type": "group",
"operator": "AND",
"conditions": [
{
"type": "rule",
"field": "message.type",
"comparison": "equals",
"value": "user.signup"
}
]
}
}
}

Success Response:

{
"content": [
{
"type": "text",
"text": "{ \"id\": \"created-entity-uuid\", \"name\": \"My Event Entity\", ... }"
}
],
"isError": false
}

Error Response:

{
"content": [
{
"type": "text",
"text": "Error (400): Missing required field: organizationId"
}
],
"isError": true
}

List Resources

Returns available resource templates.

GET /api/mcp/resources

Response:

{
"resources": [],
"resourceTemplates": [
{
"uriTemplate": "rocketwave://entities/{id}",
"name": "Workflow Entity",
"description": "Access a workflow entity by ID",
"mimeType": "application/json"
},
{
"uriTemplate": "rocketwave://workflows/{id}",
"name": "Workflow",
"description": "Access a workflow configuration by ID",
"mimeType": "application/json"
}
]
}

Read Resource

Read a specific resource by URI.

POST /api/mcp/resources/read
Content-Type: application/json
Cookie: rocketwave_session=<session_token>

{
"uri": "rocketwave://entities/entity-uuid-here"
}

Response:

{
"uri": "rocketwave://entities/entity-uuid-here",
"mimeType": "application/json",
"text": "{ \"id\": \"entity-uuid\", \"name\": \"My Entity\", ... }"
}

Available Tools

Workflow Entities

ToolDescription
entities_listList workflow entities with filtering
entities_getGet a workflow entity by ID
entities_createCreate a new workflow entity
entities_updateUpdate an existing entity
entities_deleteDelete a workflow entity
entities_usage_countGet workflows using this entity
entities_versionsList version history for a workflow entity
entities_version_getGet a specific version of a workflow entity

Workflows

ToolDescription
workflows_listList workflows
workflows_getGet a workflow by ID
workflows_createCreate a new workflow
workflows_updateUpdate a workflow
workflows_deleteDelete a workflow
workflows_triggerManually trigger a workflow execution
workflows_versionsList version history for a workflow
workflows_version_getGet a specific version of a workflow

Environments

ToolDescription
environments_listList environments for an organization
environments_getGet an environment by ID
environments_createCreate a new environment
environments_updateUpdate an environment
environments_deleteDelete an environment

Variables

ToolDescription
variables_listList variables (values hidden)
variables_getGet a variable by ID
variables_createCreate a variable (value encrypted)
variables_updateUpdate a variable
variables_deleteDelete a variable

Example: Create Variable

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'variables_create',
arguments: {
organizationId: 'org-uuid',
environmentId: 'env-uuid',
name: 'OPENAI_API_KEY',
value: 'sk-proj-xxxxxxxxxxxx'
}
})
});
note

Variable values are write-only - they're never returned in responses. The variables_list and variables_get tools return variable metadata without the actual value.

Models

ToolDescription
models_listList AI models
models_getGet a model by ID
models_createCreate a new model
models_updateUpdate a model
models_deleteDelete a model

Example: Create Model with Token Auth

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'models_create',
arguments: {
organizationId: 'org-uuid',
name: 'GPT-4 Turbo',
description: 'OpenAI GPT-4 for content generation',
modelUrl: 'https://api.openai.com/v1/chat/completions',
token: 'sk-proj-xxxxxxxxxxxx'
}
})
});

Example: Create Model with Client Key/Secret Auth (AWS Bedrock)

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'models_create',
arguments: {
organizationId: 'org-uuid',
name: 'Claude 3 Sonnet (Bedrock)',
description: 'AWS Bedrock Claude model',
modelUrl: 'https://bedrock-runtime.us-east-1.amazonaws.com/model/anthropic.claude-3-sonnet/invoke',
clientKey: 'AKIAXXXXXXXXXXXX',
secretKey: 'xxxxxxxxxxxxxxxxxxxxxxxx'
}
})
});
note

Model credentials are write-only. Responses include hasToken and hasClientKey boolean flags instead of actual credentials.

Organizations

ToolDescription
organizations_listList organizations (filtered by access)
organizations_getGet an organization by ID
organizations_createCreate organization (system only)
organizations_updateUpdate organization (system only)
organizations_deleteDelete organization (system only)

Prompt Templates

ToolDescription
prompt_templates_listList prompt templates for an organization/environment
prompt_templates_getGet a prompt template by ID
prompt_templates_createCreate a new prompt template
prompt_templates_updateUpdate a prompt template
prompt_templates_deleteDelete a prompt template
prompt_templates_executeExecute a prompt template against its model
prompt_templates_analyze_sentimentAnalyze sentiment of a prompt template
prompt_templates_versionsList version history for a prompt template
prompt_templates_version_getGet a specific version of a prompt template

Scheduled Events

ToolDescription
scheduled_events_listList scheduled workflow events
scheduled_events_getGet a scheduled event by ID
scheduled_events_createCreate a scheduled event (cron or datetime)
scheduled_events_updateUpdate a scheduled event
scheduled_events_deleteDelete a scheduled event

Example: Create a Cron Schedule

const response = await fetch('/api/mcp/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
name: 'scheduled_events_create',
arguments: {
workflowEntityId: 'event-entity-uuid',
workflowId: 'workflow-uuid',
organizationId: 'org-uuid',
environmentId: 'env-uuid',
scheduleType: 'cron',
cronExpression: '0 9 * * MON', // Every Monday at 9am
timezone: 'America/New_York'
}
})
});
note

Schedule status is determined by nextRunAt. Active schedules have a future timestamp; completed or disabled schedules have nextRunAt: null.

Processed Queue

ToolDescription
processed_queue_listList processed workflow execution results
processed_queue_getGet a specific processed queue item
processed_queue_deleteDelete a processed queue item

AI Assistant

ToolDescription
assistant_chatChat with the RAG-powered AI assistant for creating entities and getting help

Other Tools

ToolDescription
entity_types_listList entity types (event, action, prompt)
roles_listList available roles
documentation_searchSearch documentation (RAG)
healthcheck_listList healthcheck records

Security

The MCP layer inherits all security from existing API routes:

  1. Session Authentication - Cookies are forwarded to internal API calls
  2. RBAC Permissions - Each tool respects permission requirements (e.g., entities:create)
  3. Organization Validation - Users can only access resources in their organizations
  4. Environment Scoping - Resources are scoped to the specified environment
  5. Input Validation - All inputs are validated against JSON schemas

Usage Examples

Claude Desktop Configuration

Add to your Claude Desktop MCP configuration:

{
"mcpServers": {
"rocketwave": {
"url": "https://your-admin-domain.com/api/mcp",
"headers": {
"Cookie": "rocketwave_session=<your_session_token>"
}
}
}
}

Creating a Workflow Entity

// Using fetch
const response = await fetch('https://admin.example.com/api/mcp/tools/call', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cookie': 'rocketwave_session=...'
},
body: JSON.stringify({
name: 'entities_create',
arguments: {
organizationId: 'org-uuid',
environmentId: 'env-uuid',
name: 'New Signup Event',
workflowEntityTypeId: 'event-type-uuid',
description: 'Triggers when a new user signs up',
condition: {
type: 'group',
operator: 'AND',
conditions: [
{
type: 'rule',
field: 'message.type',
comparison: 'equals',
value: 'user.signup'
}
]
},
script: 'return { userId: message.data.userId };'
}
})
});

const result = await response.json();
console.log(result.content[0].text); // Created entity JSON

Searching Documentation

const response = await fetch('https://admin.example.com/api/mcp/tools/call', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cookie': 'rocketwave_session=...'
},
body: JSON.stringify({
name: 'documentation_search',
arguments: {
query: 'How do I create a condition with multiple rules?',
limit: 5
}
})
});

Using the AI Assistant

The assistant_chat tool provides a conversational interface that can create entities and answer questions:

const response = await fetch('https://admin.example.com/api/mcp/tools/call', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cookie': 'rocketwave_session=...'
},
body: JSON.stringify({
name: 'assistant_chat',
arguments: {
organizationId: 'org-uuid',
environmentId: 'env-uuid',
message: 'Create an event entity that triggers when a user signs up, filtering for message.type equals "user.signup"',
history: [] // Optional: previous messages for context
}
})
});

const result = await response.json();
// result.content contains the assistant's response and any created entities

The assistant can:

  • Create workflow entities (events, prompts, actions)
  • Search documentation for relevant guidance
  • Explain platform concepts and best practices
  • Generate scripts with proper syntax

Error Handling

MCP responses include an isError flag to indicate failures:

HTTP StatusMeaning
200Success (check isError for tool-level errors)
400Invalid request (missing/invalid tool name or arguments)
401Authentication required
403Permission denied
404Resource not found
500Internal server error

Rate Limiting

The MCP endpoints share rate limits with the regular API. Consider implementing client-side caching and batching for high-frequency operations.