AAnvio
Reference ArchiveSource Docs

Integration Architecture

Vendor-agnostic integration framework for external services. **MCP-first** — use MCP servers whenever possible; fall back to direct adapters only when MCP is unavailable.

3 min read

This is a migrated reference document from the original Anvio source repo. Content is preserved as-is; canonical documentation lives in the sections above in the sidebar.

Original path: docs/38-integration-architecture.md

Vendor-agnostic integration framework for external services. MCP-first — use MCP servers whenever possible; fall back to direct adapters only when MCP is unavailable.

Supported Integrations

IntegrationPrimaryFallback
GitHubMCP (github)REST adapter
GitLabMCPREST adapter
JiraMCP (atlassian)REST adapter
NotionMCPREST adapter
PostgreSQLMCPDirect driver
SlackMCPBot API adapter
TelegramChannel adapter—
DiscordChannel adapter—
EmailMCP / SMTP hook—

Architecture

Rendering diagram…

Configuration

# workspace/mcp/servers.yaml
apiVersion: anvio.io/v1
kind: McpConfig
spec:
  servers:
    github:
      command: npx
      args: ["-y", "@modelcontextprotocol/server-github"]
      env:
        GITHUB_TOKEN: ${GITHUB_TOKEN}
      enabled: true

    atlassian:
      command: npx
      args: ["-y", "@atlassian/mcp-server"]
      env:
        ATLASSIAN_TOKEN: ${ATLASSIAN_TOKEN}
      enabled: false

    postgres:
      command: npx
      args: ["-y", "@modelcontextprotocol/server-postgres"]
      env:
        DATABASE_URL: ${DATABASE_URL}
      enabled: false
# workspace/integrations/registry.yaml (planned)
apiVersion: anvio.io/v1
kind: IntegrationRegistry
spec:
  integrations:
    github:
      type: mcp
      server: github
      tools:
        - create_issue
        - create_pull_request
        - search_code

    email:
      type: smtp
      config:
        host: smtp.example.com
        port: 587
        from: anvio@example.com
      credentials: credentials/pools.yaml#smtp

Integration Port

interface Integration {
  readonly integrationId: string;
  readonly capabilities: IntegrationCapability[];

  connect(): Promise<void>;
  disconnect(): Promise<void>;
  healthCheck(): Promise<{ ok: boolean }>;

  // Unified tool surface
  invoke(action: string, params: Record<string, unknown>): Promise<unknown>;
}

MCP-First Policy

  1. Check if MCP server exists for the service
  2. Configure in workspace/mcp/servers.yaml
  3. Expose tools via MCP bridge to agent runtime
  4. Direct adapter only when: no MCP server, MCP lacks required capability, or offline requirement

Channel vs Integration

LayerPurposeExamples
ChannelUser communication ingress/egressTelegram, Discord, CLI, Web
IntegrationBackend service connectivityGitHub, Jira, PostgreSQL

Channels use integrations internally (e.g., Slack channel + Slack MCP).

Blueprint & Automation Integration

Blueprints invoke integrations via step types:

steps:
  - id: triage
    type: mcp
    server: github
    tool: list_issues
    args:
      repo: "{{repository}}"
      state: open

Extension Guide

Status (2026-10-25): items below that mention a plugin or plugin manifest describe design intent. Anvio has no plugin system (ROADMAP T-058); extending this subsystem today means changing the package code.

  1. Add MCP server to workspace/mcp/servers.yaml
  2. For custom services: implement Integration port as plugin
  3. Register tools in workspace/tools/

Operational Runbook

ScenarioAction
Test MCP connectionanvio mcp test github
List available toolsanvio mcp tools github
Rotate integration tokenUpdate env + anvio credentials rotate
Disable integrationSet enabled: false in servers.yaml

Package Boundaries

  • Registry: packages/integrations/src/integration-registry.ts
  • MCP Bridge: packages/integrations/src/mcp-bridge.ts (wraps existing MCP client)
  • Adapters: packages/integrations/src/adapters/\{smtp,rest\}/

See also 07-mcp.md and 10-channels.md.

Edit on GitHub

Last updated on

On this page