Skip to main content
CORE integrations connect external services to provide activity sync and MCP tools for AI agents. This reference covers integration architecture and event types.

Integration Capabilities

  1. Activity Sync - Capture events into knowledge graph
  2. MCP Tools - Expose service actions to AI agents (required)

File Structure

  • index.ts - Event router (SETUP, SYNC/PROCESS, GET_TOOLS, CALL_TOOL)
  • account-create.ts - OAuth handler
  • schedule.ts OR create-activity.ts + identify.ts - Activity sync
  • mcp/index.ts - MCP tool definitions and implementations

Integration Types

Webhook-Based - Real-time events (Slack, Discord)
  • Events: SETUP, IDENTIFY, PROCESS, GET_TOOLS, CALL_TOOL
  • Best for: Chat, real-time notifications
Schedule-Based - Periodic polling (GitHub, Linear)
  • Events: SETUP, SYNC, GET_TOOLS, CALL_TOOL
  • Best for: APIs without webhooks, batch processing
  • Frequency: 5-15 minute cron schedule

Spec Configuration

Returned by getSpec() in your CLI class:

Event Types

All integrations handle:
Schedule-based adds:
Webhook-based adds:

Return Types

SETUP - Account creation:
SYNC - Activity list + state:
PROCESS - Activity list:
IDENTIFY - User identifier:
GET_TOOLS - Tool list:
CALL_TOOL - Tool result:

MCP Tools

All integrations must implement custom MCP tools using type: 'cli':

Best Practices

Activity Messages:
  • Be descriptive with context
  • Always include sourceURL
  • Filter noise (only relevant events)
State Management:
  • Save lastSyncTime after each sync
  • Default to 24 hours on first sync
  • Use pagination for large datasets
Error Handling:
  • Return empty arrays on errors (don’t throw)
  • Continue processing if one item fails
  • Validate tokens early
MCP Tools:
  • Use clear descriptions
  • Validate all inputs
  • Return structured responses
  • Handle rate limiting

Reference Examples

Contributing

Want to build an integration? See our step-by-step contributor guide.