Blog

  • MCP Servers: How AIOS Connects to External Services

    MCP Servers: How AIOS Connects to External Services

    An AI Operating System needs to talk to other software. Airtable for data. WordPress for publishing. Blotato for social distribution. DataForSEO for research. The Model Context Protocol (MCP) is what makes these connections work inside an AIOS built on Claude Code — and it replaces a surprising amount of custom integration code.

    TL;DR: MCP servers give your AIOS standardized connectors to external services. Each service exposes tools that Claude Code can call directly. No SDK wrappers, no middleware, no glue code. You configure the server, and the tools appear.

    What MCP Actually Does

    TL;DR: MCP turns external APIs into callable tools inside Claude Code’s environment.

    MCP — the Model Context Protocol — is a standard for connecting AI models to external data and services. In practice, it works like this: you run an MCP server for a service (say, Airtable), and that server exposes a set of tools that Claude Code can call natively.

    The tool calls look like namespaced functions:

    mcp__airtable__list_records
    mcp__airtable__create_record
    mcp__airtable__update_records
    mcp__airtable__search_records

    Claude Code doesn’t need to know how to authenticate with Airtable’s REST API, handle pagination, or manage rate limits. The MCP server handles all of that. Claude Code just calls the tool with the right parameters.

    This is fundamentally different from the old approach of writing API wrapper functions, managing tokens in environment variables, and building error handling for each service. MCP collapses that entire layer into a protocol.

    The Services in Content Engine AIOS

    TL;DR: Five external services power the system. Four connect via MCP. One uses a REST API directly.

    Here’s what each service does and how it connects:

    Service Role Connection Tool Prefix
    Airtable Data layer, pipeline tracking MCP server mcp__airtable__
    DataForSEO Keyword research, SERP analysis, AI visibility MCP server mcp__dfs-mcp__
    Blotato Social publishing (Twitter, LinkedIn, YouTube, TikTok) MCP server mcp__blotato__
    WordPress Website publishing (headless CMS) REST API (curl) n/a
    HeyGen AI avatar video generation REST API (curl) n/a

    Airtable is the core. Every content piece, every plan, every source record lives there. It’s the single source of truth the entire system reads from and writes to.

    DataForSEO powers the research layer — keyword data, SERP results, AI platform mentions, content analysis. Its MCP server exposes dozens of tools organized by category:

    mcp__dfs-mcp__serp_organic_live_advanced
    mcp__dfs-mcp__dataforseo_labs_google_keyword_overview
    mcp__dfs-mcp__ai_opt_llm_ment_search
    mcp__dfs-mcp__backlinks_summary

    Blotato handles the last mile — getting approved content published to social platforms. One MCP call creates a post, another checks its status, another schedules it.

    WordPress and HeyGen connect via REST API (curl) rather than MCP. WordPress uses its native JSON API for headless publishing. HeyGen’s video generation API is called directly with curl. Both work fine — MCP isn’t required for every integration. It just makes the ones it supports cleaner.

    Why MCP Beats Custom Integrations

    TL;DR: MCP eliminates glue code, makes services interchangeable, and lets the AI handle tool selection.

    Before MCP, connecting an AI system to an external service meant writing a custom integration layer. You’d build functions to authenticate, format requests, parse responses, handle errors, and expose the results in a format the AI could use. Every service was a bespoke project.

    MCP changes three things:

    No glue code. The MCP server is the integration. You configure it once — point it at the service, provide credentials — and it exposes the full tool surface. No wrapper functions to maintain. No response parsers to debug.

    Service awareness. Claude Code can see all available MCP tools and their descriptions. It picks the right tool for the job. You don’t need to map user intent to API calls — the orchestration layer handles that.

    Standardized interface. Every MCP tool follows the same pattern: namespaced name, typed parameters, structured response. Whether you’re querying Airtable or DataForSEO, the calling convention is identical. This matters when your AIOS architecture has multiple layers that all need to interact with services.

    The practical result: adding a new service to the AIOS means configuring one MCP server, not writing an integration library.

    How MCP Servers Get Configured

    TL;DR: MCP servers are declared in a settings file. Each entry specifies the server command, environment variables, and transport.

    In Claude Code, MCP servers are configured in the project’s settings. Each server declaration looks roughly like this:

    {
      "mcpServers": {
        "airtable": {
          "command": "npx",
          "args": ["-y", "@airtable/mcp-server"],
          "env": {
            "AIRTABLE_API_KEY": "pat_xxxxx"
          }
        }
      }
    }

    When Claude Code starts, it launches each configured MCP server as a subprocess. The server connects, registers its tools, and Claude Code can call them immediately.

    You can add or remove services without touching any application code. The app-in-a-folder pattern means the entire system — including its service connections — lives in a directory structure. No deployment pipeline. No infrastructure. Just configuration.

    Progressive Readiness: Services Are Optional

    TL;DR: The system works with whatever services are configured. Missing a service reduces capability but doesn’t break anything.

    This is a design principle in Content Engine AIOS, and MCP makes it easy to enforce. Every service except Airtable is optional.

    No Blotato configured? Content still gets written and saved to Airtable — you just publish manually. No DataForSEO? You skip automated keyword research but can still plan content from other sources. No HeyGen? Scripts get written but videos don’t render.

    The system degrades gracefully because each service is a discrete connector, not a dependency baked into application logic. This matters for AIOS vs traditional automation — brittle integrations are the main reason automation pipelines break. MCP’s loose coupling avoids that.

    What MCP Doesn’t Solve

    TL;DR: MCP handles tool calls, not workflows. Sequencing, validation, and error recovery still need an orchestration layer.

    MCP gives you the tools. It doesn’t tell you when to use them, in what order, or what to do when a call fails.

    In Content Engine AIOS, that’s the job of commands and agents — the orchestration layer that sequences tool calls into workflows. MCP handles “create this Airtable record.” The agent handles “create the source record first, then the content plan, then link them together” — the write order rules that keep linked records consistent.

    MCP also doesn’t handle authentication rotation, usage tracking, or cost management. You still need to manage API keys, monitor rate limits, and watch costs — especially with services like DataForSEO and HeyGen where every call has a price.

    What to Build Next

    MCP is the service layer of an AIOS. It turns external APIs into native tools. But the tools are only useful inside a system that knows when and how to use them.

    Start with the full AIOS guide for the complete architecture. If you’re building the orchestration layer, read Claude Code as an AIOS Orchestrator. For the broader system design — layers, skills, memory — see AIOS Architecture: Layers, Skills, and Memory.

  • Claude Code as an AIOS Orchestrator: Why a CLI Beats a GUI

    Claude Code as an AIOS Orchestrator: Why a CLI Beats a GUI

    Claude Code as an AIOS Orchestrator: Why a CLI Beats a GUI

    TL;DR: Claude Code works as an AIOS orchestrator because it combines file system access, tool use via MCP, reasoning capability, and extensibility through plain files. A CLI gives you transparency that GUIs hide — and when you’re building a system that makes decisions, transparency isn’t optional.

    This is part of the AIOS guide, which covers the full architecture. This article focuses on the orchestration layer — why Claude Code specifically, and why a CLI interface matters more than it seems.

    What an Orchestrator Actually Does

    TL;DR: The orchestrator is the component that reads context, decides what to do, calls tools, and produces output. In an AIOS, the AI model fills this role.

    A traditional application has a runtime that executes code. An AIOS has an orchestrator that executes judgment. It reads the project state, loads relevant context, reasons about the task, and calls external services to get things done.

    The orchestrator needs four capabilities:

    1. File system access — read instructions, write output, maintain state
    2. Tool use — call external services (databases, APIs, publishing platforms)
    3. Reasoning — make decisions based on context, not just follow a script
    4. Extensibility — gain new capabilities without rewriting the system

    Most AI interfaces give you one or two of these. A chatbot gives you reasoning but no file access. A no-code builder gives you tool use but limited reasoning. Claude Code gives you all four.

    Why Claude Code Fits

    TL;DR: Claude Code provides native file I/O, MCP tool calling, strong reasoning, and a project-folder model that aligns perfectly with the AIOS architecture.

    File system as memory. Claude Code reads and writes files as a core capability. In an AIOS, the project folder is the system’s persistent memory — CLAUDE.md for instructions, learnings/ for feedback, context/ for session state. The AI reads these files at session start and writes updates when things change. No external database needed for system state. This is the app-in-a-folder pattern — the entire system lives in one directory.

    MCP as the service layer. Model Context Protocol gives Claude Code access to external tools through a standardized interface. Each MCP server wraps a service — Airtable, WordPress, DataForSEO — and exposes named functions the AI can call. The AI doesn’t write HTTP requests. It calls mcp__airtable__create_record and gets structured results back.

    Reasoning at the core. Content strategy, editorial decisions, brand voice adaptation, deciding whether a keyword cluster is worth pursuing — these aren’t mechanical tasks. They require judgment informed by context. The AI model provides that judgment. The AIOS architecture provides the context.

    Extensibility through files. Adding a new command to an AIOS means adding a markdown file to .claude/commands/. Adding a new skill means adding a markdown file to .claude/skills/. No compilation. No deployment. No code changes. The system’s capabilities grow by adding files to a folder.

    The CLI Advantage

    TL;DR: A CLI keeps you close to the system’s actual behavior — you see what files get read, what tools get called, what decisions get made. GUIs abstract that away, which is fine until something breaks.

    The argument for GUIs is convenience. The argument for CLIs is transparency. When you’re building a system that makes decisions on your behalf, transparency wins.

    You see the work happening. In a CLI, every file read, every tool call, every decision is visible. You watch the AI load brand/profile.md, call the Airtable MCP to fetch a content plan, reason about which angle to take, and produce the draft. In a GUI, you click a button and get output. The steps in between are hidden.

    Debugging is direct. When something goes wrong in a GUI-based AI tool, you’re guessing. Was it the prompt? The context? A service timeout? In a CLI, you see exactly what the AI read, what it called, and where the process broke. The fix is usually obvious.

    The file system is the interface. An AIOS stores its state in files. A CLI works natively with files. There’s no translation layer between the system’s state and how you interact with it. Open learnings/write.md in your editor and you see exactly what the AI will read before its next write session. Try that with a GUI tool’s internal state.

    Composability. CLI tools chain together. You can pipe output, script sequences, integrate with git hooks, run commands in CI/CD pipelines. A GUI is a closed loop — you interact with it through the interface it gives you, nothing else.

    What You Give Up

    TL;DR: CLIs have a steeper learning curve and no visual dashboards. These are real tradeoffs, not dealbreakers.

    Honesty about tradeoffs matters. A CLI-first approach has real costs:

    No visual dashboard. You don’t get a drag-and-drop content calendar or a visual pipeline board. The AIOS compensates by using Airtable as the visual layer — pipeline status, content review, and approval all happen in Airtable’s interface. The CLI handles production; Airtable handles visibility.

    Learning curve. Terminal comfort is a prerequisite. If you’ve never used a CLI, the initial friction is real. But the audience for building an AIOS — AI makers — generally lives in terminals already.

    No persistent UI state. Each CLI session starts fresh in terms of interface. The AIOS compensates with the Context layer — active-work.md ensures the system knows where it left off, even if the terminal doesn’t.

    These tradeoffs are manageable because the AIOS architecture already has answers for them. The CLI handles what CLIs do best (execution, transparency, composability), and external services handle what they do best (visual interfaces, persistent state, collaboration).

    Compared to the Alternatives

    TL;DR: No-code AI builders, custom agent frameworks, and chat interfaces each solve part of the problem. None combine file access, tool use, reasoning, and extensibility the way Claude Code does.

    No-code AI builders (Zapier, Make, n8n with AI nodes) give you tool connections and visual workflow design. But the AI reasoning is limited to individual nodes — the system can’t reason across the entire workflow. And the state lives in the platform, not in files you control. For a deeper comparison, see AIOS vs Traditional Automation.

    Custom agent frameworks (LangChain, CrewAI, AutoGen) give you programmatic control and reasoning chains. But you’re writing code — Python classes, configuration objects, deployment pipelines. Every new capability requires code changes. The AIOS approach of “add a markdown file” is faster for iteration.

    Chat interfaces (ChatGPT, Claude.ai) give you reasoning but no persistent state and limited tool access. Every session starts from zero. You can’t build a system on top of a chat interface because there’s no file layer, no commands, no project structure.

    Claude Code isn’t the only possible AIOS orchestrator. But right now, the combination of native file access, MCP tool calling, strong reasoning, and the project-folder model makes it the most practical one for this architecture.

    What Makes It Work Long-Term

    TL;DR: The orchestrator choice matters less than the architecture. If the five-layer pattern is sound, the orchestrator can be swapped.

    The AIOS architecture is designed to be orchestrator-portable. The five layers — Brain, Skills, Learnings, Context, Services — are all files on disk. Any AI model with file access and tool calling capability could read them.

    Claude Code is the right choice today because it provides the best combination of the four requirements. If a better orchestrator emerges — one with larger context, faster execution, or more capable reasoning — the migration path is straightforward: point the new orchestrator at the same folder.

    That’s the real argument for the CLI approach. It’s not about Claude Code specifically. It’s about building on files and standards rather than proprietary interfaces. Files are portable. MCP is a protocol. The system survives its orchestrator.

    For the full AIOS guide — all five layers, step-by-step build instructions, and real examples — see AIOS: What an AI Operating System Is and How to Build One.

  • AIOS Architecture: Layers, Skills, and Memory in an AI Operating System

    AIOS Architecture: Layers, Skills, and Memory in an AI Operating System

    AIOS Architecture: Layers, Skills, and Memory in an AI Operating System

    TL;DR: An AIOS separates concerns into five layers — Brain, Skills, Learnings, Context, and Services — so the AI loads only what it needs, remembers what worked, and picks up where it left off. This article covers how each layer works, what goes in it, and why the separation matters.

    This is part of the AIOS guide, which covers what an AIOS is and how to build one. This article goes deeper on the architecture — the specific design decisions that make a folder of markdown files behave like an operating system.

    Why Layers Matter

    TL;DR: Without layers, every session dumps the entire system into the AI’s context window. That’s expensive, slow, and degrades output quality.

    An AI model has a finite context window. Everything it reads — instructions, schema definitions, brand guidelines, conversation history — competes for space in that window. A system that loads everything on every session wastes context on irrelevant information and crowds out the actual work.

    Layers solve this by separating concerns. The Brain layer loads every session because it defines how the system works. Skills load on demand because you only need the Airtable schema when you’re writing to Airtable. Learnings load per-command because /write doesn’t need to know what /signals learned last week.

    The result: a system that stays lean in context but deep in capability. The AI always knows what it can do. It only loads the details when it needs them.

    Layer 1: Brain — The Instruction Set

    TL;DR: The Brain layer is a single file (CLAUDE.md) plus shared rules that the AI reads at the start of every session. It defines what the system does and how it behaves.

    CLAUDE.md is the kernel. It contains:

    • System purpose — one paragraph on what this AIOS does
    • Architecture overview — folder structure, available commands, how layers connect
    • Command reference — what each command does, in a table
    • Content types — what content the system produces and where it publishes
    • Status flow — how content moves from Draft to Published
    • Table references — Airtable base and table IDs for quick access
    • Conventions — date formats, timezone, model selection, naming patterns

    Rules live in .claude/rules/ as separate files. They enforce specific behaviors across all commands:

    .claude/rules/
    ├── airtable-writes.md    # Record creation order, batch limits
    └── content-creation.md   # Brand loading sequence, quality requirements
    

    Rules are the guardrails. “Always create Sources before Content Plans” is a rule. “Load brand profile before writing any content” is a rule. Without them, the AI makes reasonable but inconsistent decisions. With them, the system behaves predictably.

    The Brain layer should be concise. Every token in CLAUDE.md loads on every session. If a piece of information is only relevant to one command, it belongs in a skill, not the Brain. The entire system — Brain, skills, rules, and all — lives in a single project directory. For more on why that works, see App-in-a-Folder: The Simplest Way to Build an AI System.

    Layer 2: Skills — Context on Demand

    TL;DR: Skills are context containers that load only when relevant. They use progressive disclosure — small frontmatter loads first, full content loads only when matched.

    Skills hold specialized knowledge the system needs sometimes but not always. The Airtable schema. Content type specifications. Service connection details. Brand context loading instructions.

    The key pattern is progressive disclosure. Each skill has two parts:

    1. Frontmatter (~100 tokens) — name, description, when to load
    2. Body (hundreds to thousands of tokens) — the actual knowledge

    The AI reads all frontmatter at session start. When a task matches a skill’s description, the full body loads. A /write command triggers the content-types skill. A /plan command triggers the airtable-schema skill. A /status command triggers neither.

    .claude/skills/
    ├── airtable-schema/      # Table IDs, field definitions, relationships
    │   ├── SKILL.md          # Frontmatter + full schema
    │   └── references/       # Deep reference files
    ├── brand-context/        # Brand loading instructions
    ├── content-types/        # Specs for each content format
    └── services-context/     # MCP server details, API parameters
    

    Skills can also reference external files. The brand-context skill doesn’t contain the brand profile — it tells the AI to read brand/profile.md and the relevant platform voice guide. This keeps the skill itself small while pointing to rich context that lives elsewhere in the project.

    The discipline is simple: if the information is needed every session, it goes in the Brain. If it’s needed for specific tasks, it goes in a skill. This distinction keeps context budgets manageable as the system grows.

    Layer 3: Learnings — The Feedback Loop

    TL;DR: Each command has its own learnings file. The command reads its learnings before running, so past feedback shapes future behavior without changing the model.

    Learnings are the simplest layer and arguably the most important. Each command gets a file at learnings/.md. The file has three sections: What Works, What Doesn’t Work, and Do Differently.

    learnings/
    ├── plan.md       # Content strategy learnings
    ├── write.md      # Content production learnings
    ├── status.md     # Pipeline status learnings
    ├── publish.md    # Publishing learnings
    └── signals.md    # DailySignals learnings
    

    Here’s a real entry from learnings/write.md:

    > First pillar page written — “AIOS: What an AI Operating System Is and How to Build One” (~3,800 words). Approved as-is on first review. Full brand stack loaded: profile + website voice guide + website playbook.

    And another:

    > Never include --- (horizontal rules) in content. Frontend CSS handles section spacing. Horizontal rules create visual noise.

    The first entry reinforces a pattern that worked. The second prevents a mistake from repeating. Both load before the next /write session runs.

    This isn’t fine-tuning. The model doesn’t change. What changes are the instructions the model reads before acting. It’s the difference between training someone and giving them better notes.

    The feedback loop closes through /wrap — a session wrap-up command that combines system self-diagnosis with user feedback to update the relevant learnings files. Over time, the learnings accumulate into a practical operations manual written by the system about itself.

    Layer 4: Context — Session Continuity

    TL;DR: Two files track what’s happening across sessions — active-work.md for current state and session-log.md for history. This lets the system pick up where it left off.

    Without context, every session starts from zero. The AI doesn’t know what was published yesterday, what’s in review, or what the user decided to skip. Context fixes this with two files:

    context/active-work.md — the current state. Pipeline snapshot, published content, platform status, next priorities. Updated at the end of each session by /status or /wrap.

    context/session-log.md — the history. A brief record of each session: date, what happened, what changed. Not a transcript — a summary.

    When /status runs at the start of a session, it reads active-work.md and reports the current state. The user sees immediately: 73 pieces across 3 plans, 6 in review, 2 approved, ready to publish. No re-explaining. No “where were we?”

    Context files should be factual and compact. They’re loaded frequently, so bloated context files waste the same budget that the layer system is designed to protect.

    Layer 5: Services — External Connections

    TL;DR: MCP servers connect the AIOS to external platforms. Each server exposes tools the AI calls by name — no custom API code required.

    The Services layer is where the AIOS touches the outside world. Each external platform gets an MCP server that wraps its API and exposes named tools. For the full deep dive on how this works, see MCP Servers: How AIOS Connects to External Services.

    Service What the AI Can Do
    Airtable Read/write records, query pipeline status, manage content metadata
    WordPress Create posts and pages, upload media, update published content
    Blotato Schedule and publish to Twitter, LinkedIn, TikTok, YouTube
    DataForSEO Pull keyword data, SERP analysis, backlink profiles, AI visibility checks
    HeyGen Generate avatar videos from scripts, check render status, download files

    The AI doesn’t manage HTTP requests or parse JSON responses. It calls mcp__airtable__list_records with a filter formula and gets structured data back. It calls mcp__blotato__blotato_create_post with content and a platform account ID and the post gets scheduled.

    MCP servers are interchangeable. Swap WordPress for Ghost — as long as the new MCP server exposes similar tools, the commands adapt. The AI references tool names, not implementation details.

    This matters for resilience too. If a service is down or not configured, the rest of the system still works. The /status command checks service health and reports what’s available. Missing a service reduces capability but doesn’t break the system. This is a key difference from traditional automation, where a broken integration breaks the whole pipeline.

    How the Layers Interact

    TL;DR: Layers flow downward — Brain governs everything, Skills add depth, Learnings refine behavior, Context provides continuity, Services execute.

    A concrete example: the user runs /write to produce a cluster article.

    1. Brain — the AI reads CLAUDE.md, knows the command exists, loads the content creation rule
    2. Skillscontent-types and brand-context skills load, providing article specs and brand voice
    3. Learningslearnings/write.md loads, telling the AI to load the full brand stack and avoid horizontal rules
    4. Contextactive-work.md confirms the article’s status and its parent pillar
    5. Services — Airtable MCP fetches the article shell, then saves the finished draft

    Each layer adds information without duplicating what the others provide. The Brain says “load brand before writing.” The Skills say how. The Learnings say what worked last time. The Context says what’s in the pipeline. The Services execute the read and write.

    Claude Code is the orchestrator that ties this together — reading each layer, reasoning about the task, and calling the right tools in the right order.

    That’s the architecture. Five layers, clear boundaries, minimal overlap. The system scales by adding files, not by adding complexity.

    For the complete guide to AIOS — what it is, when you need one, and how to build yours — see AIOS: What an AI Operating System Is and How to Build One.