Powerful AI integrations for the Zeal workflow orchestration platform, enabling GPT models and Claude to create, manage, and optimize workflows through natural language.
This repository contains two production-ready AI integration servers:
- OpenAI Functions Server - Exposes Zeal's capabilities as OpenAI function calls for GPT models
- Anthropic MCP Server - Implements Model Context Protocol for deep Claude integration
Both servers leverage the Zeal Integration Protocol (ZIP) to provide comprehensive workflow orchestration capabilities to AI models.
- ✅ Workflow Management - Create, update, delete, and execute workflows
- ✅ Node Operations - Add nodes, create connections, configure properties
- ✅ Execution Monitoring - Real-time status updates and flow traces
- ✅ Template Search - Semantic search for node templates
- ✅ Analytics - Query performance metrics and historical data
- ✅ Authentication - Secure API key and JWT support
- ✅ Rate Limiting - Configurable limits per user/organization
- 🤖 GPT-4 Optimized - Functions designed for GPT-4's capabilities
- 📊 Streaming Support - Real-time execution updates
- 🔄 Async Operations - Non-blocking workflow execution
- 📝 Detailed Schemas - Comprehensive parameter validation
- 🧠 Contextual Understanding - Deep workflow context for Claude
- 🎨 AI-Powered Design - Automatic workflow generation from descriptions
- 🔧 Intelligent Optimization - Performance analysis and improvements
- 🐛 Smart Debugging - AI-assisted error resolution
- 💡 Natural Language - Convert descriptions to workflows
- 🔍 Semantic Node Search - Find nodes by meaning, not just keywords
- 🎯 Service-Aware Selection - Won't mix competing services (e.g., Slack/Discord)
- 🔗 Intelligent Connections - Generates logical data flow automatically
- 📊 Graph-Based Analysis - Identifies redundancies and missing capabilities
- 🧪 Context-Aware Testing - Generates tests based on workflow structure
- Node.js 20+
- Zeal platform running (localhost:3000 by default)
- API keys for Zeal
- OPENROUTER_API_KEY (optional, enables GraphRAG AI features)
For enhanced AI capabilities, build the GraphRAG knowledge graph:
# Run setup script from Zeal root directory
./ai-integrations/setup-ai.sh
# Or manually build GraphRAG
OPENROUTER_API_KEY=your_key npm run graphrag:buildThis creates a semantic knowledge graph enabling:
- Intelligent node selection based on context
- Automatic duplicate prevention
- Optimal connection generation
- Context-aware workflow optimization
cd ai-integrations/openai-functions
npm install
npm run build
npm startcd ai-integrations/mcp-server
npm install
npm run build
npm startCreate a .env file:
# Server Configuration
PORT=3456
NODE_ENV=production
# Zeal Integration
ZEAL_API_URL=http://localhost:3000
ZEAL_API_KEY=your-zeal-api-key
# GraphRAG AI Features (optional but recommended)
OPENROUTER_API_KEY=your-openrouter-key
OPENROUTER_MODEL=anthropic/claude-3-haiku-20240307
# Authentication
JWT_SECRET=your-jwt-secret
API_KEY_HEADER=X-API-Key
# Rate Limiting
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=100
# Redis (optional, for caching)
REDIS_URL=redis://localhost:6379Create a .env file:
# Server Configuration
MCP_TRANSPORT=stdio # or 'sse' for server-sent events
PORT=3457 # Only for SSE transport
# Zeal Integration
ZEAL_API_URL=http://localhost:3000
ZEAL_API_KEY=your-zeal-api-key
# GraphRAG AI Features (optional but recommended)
OPENROUTER_API_KEY=your-openrouter-key
OPENROUTER_MODEL=anthropic/claude-3-haiku-20240307
# GraphRAG AI Features (optional but recommended)
OPENROUTER_API_KEY=your-openrouter-key
OPENROUTER_MODEL=anthropic/claude-3-haiku-20240307
# AI Features
ENABLE_AI_OPTIMIZATION=true
ENABLE_AUTO_DESIGN=true
ENABLE_SMART_DEBUG=true
# Caching
CACHE_TTL=3600
MAX_CACHE_SIZE=100from openai import OpenAI
client = OpenAI()
# Create a workflow using GPT-4
response = client.chat.completions.create(
model="gpt-4-turbo-preview",
messages=[
{
"role": "user",
"content": "Create a workflow that fetches data from an API, transforms it, and saves to a database"
}
],
tools=load_tools_from_server("http://localhost:3456/tools"),
tool_choice="auto"
)
# Process function calls
for tool_call in response.choices[0].message.tool_calls:
result = execute_function(tool_call.function.name, tool_call.function.arguments)
print(f"Executed: {tool_call.function.name}")// Create an assistant with Zeal functions
const assistant = await openai.beta.assistants.create({
name: "Workflow Designer",
instructions: "You help users design and execute workflows",
tools: await loadZealFunctions(),
model: "gpt-4-turbo-preview"
});
// Use the assistant
const thread = await openai.beta.threads.create();
await openai.beta.threads.messages.create(thread.id, {
role: "user",
content: "Create a data processing pipeline"
});
const run = await openai.beta.threads.runs.create(thread.id, {
assistant_id: assistant.id
});- Add to Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"zeal": {
"command": "node",
"args": ["/path/to/mcp-server/dist/index.js"],
"env": {
"ZEAL_API_KEY": "your-key"
}
}
}
}-
Restart Claude Desktop
-
Use natural language:
"Create a workflow that monitors a website for changes and sends notifications"
import { MCPClient } from '@modelcontextprotocol/sdk';
const client = new MCPClient({
name: 'zeal-client',
version: '1.0.0'
});
// Connect to MCP server
await client.connect({
transport: 'stdio',
command: 'node',
args: ['path/to/mcp-server/dist/index.js']
});
// Use tools
const result = await client.callTool('workflow_create', {
name: 'Data Pipeline',
requirements: 'Process CSV files and store in database',
auto_design: true
});
// Access resources
const workflows = await client.readResource('workflow://list');# OpenAI Functions Server
cd openai-functions
npm test
# MCP Server
cd mcp-server
npm test# Test with actual Zeal instance
ZEAL_API_URL=http://localhost:3000 npm run test:integrationcreate_workflow- Create new workflowsupdate_workflow- Modify existing workflowsdelete_workflow- Remove workflowslist_workflows- Get all workflowsget_workflow- Get workflow details
add_node- Add nodes to workflowsupdate_node- Modify node propertiesdelete_node- Remove nodesconnect_nodes- Create connectionsdisconnect_nodes- Remove connections
execute_workflow- Run workflowsget_execution_status- Check execution statuscancel_execution- Stop running executionsstream_execution_events- Real-time updates
search_node_templates- Find node templatesget_template_details- Template informationregister_template- Add custom templates
query_flow_traces- Historical execution dataget_analytics- Performance metricsget_execution_logs- Detailed logs
workflow_optimize- Performance optimization (GraphRAG-enhanced when available)node_suggest- Smart node recommendations (uses semantic search with GraphRAG)debug_execution- AI debugging assistancegenerate_test_data- Test data generation (context-aware with GraphRAG)workflow_from_description- Natural language to workflow (GraphRAG-powered design)explain_workflow- Generate explanations with technical analysiscompare_workflows- Compare and suggest improvements
- API Key - Header-based authentication
curl -H "X-API-Key: your-key" http://localhost:3456/functions- JWT - Token-based authentication
curl -H "Authorization: Bearer your-jwt" http://localhost:3456/functions- OAuth 2.0 - For production deployments (optional)
Default limits:
- 100 requests per minute per API key
- 1000 requests per hour per organization
- Configurable via environment variables
- Function call frequency
- Response times (p50, p95, p99)
- Error rates by function
- Token usage (for cost tracking)
- Active connections
- Cache hit rates
# OpenAI Functions Server
GET http://localhost:3456/health
GET http://localhost:3456/metrics
# MCP Server
GET http://localhost:3457/health
GET http://localhost:3457/mcp/status# OpenAI Functions Server
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist ./dist
EXPOSE 3456
CMD ["node", "dist/index.js"]apiVersion: apps/v1
kind: Deployment
metadata:
name: zeal-ai-functions
spec:
replicas: 3
selector:
matchLabels:
app: zeal-ai-functions
template:
metadata:
labels:
app: zeal-ai-functions
spec:
containers:
- name: openai-functions
image: zeal/openai-functions:latest
ports:
- containerPort: 3456
env:
- name: ZEAL_API_KEY
valueFrom:
secretKeyRef:
name: zeal-secrets
key: api-keyWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Clone repository
git clone https://github.com/offbit-ai/zeal.git
cd zeal/ai-integrations
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm testThe GraphRAG system enhances AI capabilities through a knowledge graph:
Node Templates → LLM Analysis → Knowledge Graph → AI Features
- Template Nodes: Workflow components with capabilities
- Service Nodes: External services (Slack, GitHub, MongoDB, etc.)
- Capability Nodes: Actions (send_message, transform_data, etc.)
- Relationships:
- INTEGRATES_WITH: Template uses a service
- HAS_CAPABILITY: Template provides capability
- CAN_CONNECT_TO: Compatible connections
- ALTERNATIVE_TO: Interchangeable nodes
- COMMONLY_USED_WITH: Frequently paired nodes
- Intent Extraction: Analyzes requests to identify services and capabilities
- Semantic Search: Finds relevant nodes using embeddings
- Duplicate Prevention: Ensures no redundant nodes
- Connection Generation: Creates logical data flow
- Optimization Analysis: Identifies improvements
- Connection refused - Ensure Zeal is running on the correct port
- Authentication failed - Check your API key is valid
- Rate limit exceeded - Implement exponential backoff
- Function not found - Update function definitions from server
- GraphRAG not working - Run
./ai-integrations/setup-ai.shto build knowledge graph - AI features limited - Set OPENROUTER_API_KEY for full capabilities
Enable debug logging:
DEBUG=zeal:* npm startApache License 2.0 - See LICENSE for details.
- GitHub Issues: Create an issue
- Discord: Join our community
- Email: support@offbit.ai