Skip to content

spec: Define Adapter Element Type specification #61

@mickdarling

Description

@mickdarling

Summary

Define the Adapter Element Type as a first-class element in the MCP-AQL specification. Adapters are Markdown files with YAML front matter that declaratively describe how to translate MCP-AQL CRUDE operations to target API calls.

Background

MCP-AQL adapters enable LLMs to interact with any API using a consistent interface. Rather than generating per-adapter code, a universal adapter runtime interprets schema files at call time.

Format

Adapters follow the same pattern as other element types (consistent with DollhouseMCP):

  • YAML front matter containing all configuration and operation mappings
  • Markdown body for human-readable documentation

Critical: Explicit Type Identification

All adapter files MUST include a type field in the YAML front matter:

---
name: github-api
type: adapter          # REQUIRED - explicit element type identification
version: "1.0.0"
# ...
---

This explicit identification is required because:

  • Files may exist outside standard directory structures
  • Enables tooling to identify element types without path inspection
  • Supports collection/portfolio systems that aggregate multiple element types
  • Provides clear schema validation targets

Proposed Schema Structure

Required Fields

Field Type Description
name string Unique identifier for the adapter
type string MUST be "adapter"
version string Semver version
description string Human-readable purpose
target object API connection configuration
operations object CRUDE operation mappings

Target Configuration

target:
  base_url: "https://api.example.com"
  transport: http       # Plugin reference
  protocol: rest        # Plugin reference
  serialization: json   # Plugin reference

Operation Mapping

operations:
  create:
    - name: create_resource
      maps_to: POST /resources
      description: "Create a new resource"
      params:
        title: { type: string, required: true }
        body: { type: string }
      response:
        type: object
        fields: [id, title, created_at]
  
  read:
    - name: list_resources
      maps_to: GET /resources
      pagination:
        style: cursor
      supports_fields: true
  
  # ... update, delete, execute

Optional Fields

Field Type Description
author string Creator attribution
tags string[] Searchable keywords
triggers string[] Activation keywords for LLM discovery
created string ISO timestamp
modified string ISO timestamp
auth object Authentication configuration
trust object Trust level metadata (#59)
rate_limits object Quota management (#60)

Design Principles

  1. Schema IS the adapter - No separate code, no compilation
  2. Declarative over imperative - Runtime interprets, doesn't execute
  3. Introspection for free - Generated directly from schema
  4. Hot reloadable - Change schema, behavior changes immediately
  5. Human-readable - Markdown body provides documentation

Specification Deliverables

  • Define complete YAML front matter schema
  • Define operation mapping structure
  • Define parameter type system
  • Define response mapping structure
  • Define pagination style options
  • Define authentication configuration options
  • Document error mapping conventions
  • Create JSON Schema for validation (YAML-compatible)
  • Add adapter examples for common API patterns

Related Issues

Related Future Issues

  • Plugin Interface Specification (to be created)
  • Universal Adapter Runtime Specification (to be created)

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapterAdapter development relatedphase-3Adapter: Adapter specifications and interfacesspecCore specification content

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions