SSyncropel Docs

AI clients, three integration patterns

Connect Syncropel to AI clients including Claude Desktop, Claude Code, Cursor, Cline, Zed, Kiro, OpenCode, Gemini CLI and Codex CLI. Three patterns (MCP, shell and programmatic) cover the main ways to connect.

The three patterns

Different AI clients take different approaches to tool use. Syncropel has a matching way to connect for each. Pick the one that fits the client you already use.

PatternForWhat you installWhat you configure
MCP serverClaude Desktop, Cursor, Cline, Zed, Kiro, OpenCode, Gemini CLIspl mcp serve (ships with spl)One JSON entry in the client's config file
Shell-integratedClaude Code, Codex CLI, any agent that can run shell commandsNothing extra, since spl is on your PATHA copy-paste system-prompt recipe
ProgrammaticAny agent that writes and runs code (models with code execution, agents on serverless platforms, custom agent frameworks)@syncropel/sdk (npm) or syncropel (PyPI)A token passed when you create the Client

None of these require the agent to know what Syncropel is. They connect, and records are written as the agent works.

Pattern 1: Traditional MCP (stdio)

For AI clients that support the Model Context Protocol. The agent calls Syncropel tools directly, and results come back into the model's context. This is the simplest option.

Quickstart: spl mcp setup-<client>

There are nine setup commands. Each finds the client's config file for your operating system, reads it (keeping any other entries), adds a syncropel entry and writes it back in one step, so a failure never leaves a half-written file.

# File-based clients: edit the client's JSON config
spl mcp setup-claude-desktop     # Claude Desktop (macOS + Windows only)
spl mcp setup-cursor             # Cursor (global, all OS)
spl mcp setup-cline              # Cline VS Code extension
spl mcp setup-zed                # Zed editor (macOS + Linux)
spl mcp setup-kiro               # Kiro (AWS)
spl mcp setup-opencode           # OpenCode
spl mcp setup-gemini             # Gemini CLI

# Clients with their own command: run the client's mcp add
spl mcp setup-claude-code        # calls `claude mcp add ...`
spl mcp setup-codex              # calls `codex mcp add ...`

Common flags (all setup commands):

  • --dry-run: print the planned change without writing the file
  • --force: replace an existing syncropel entry instead of stopping
  • --create: create the config file (and parent folders) if it doesn't exist yet
  • -o json: print JSON instead of text, for scripts

Scope flags (file-based clients with both global and per-project configs):

  • --project: write to the project's own config (<cwd>/.cursor/mcp.json and so on) instead of the global one
  • --flavor code|cursor|windsurf: Cline only. Tells the installer where Cline is installed, not which client you're targeting. The Cline extension itself is always the target:
    • --flavor code → Cline extension in VS Code (default)
    • --flavor cursor → Cline extension in Cursor (Cursor can host VS Code extensions)
    • --flavor windsurf → Cline extension in Windsurf (Codeium's VS Code fork)

Once the command returns ✓, restart the client and the syncropel tools appear in its tool panel.

Manual configuration

If you'd rather edit the config by hand (for a scripted setup, or when spl isn't on the client's machine):

Claude Desktop

Add this to claude_desktop_config.json. Claude Desktop is not available on Linux; use setup-claude-code, setup-cursor, setup-cline, or setup-zed instead.

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "syncropel": {
      "command": "spl",
      "args": ["mcp", "serve"]
    }
  }
}

Restart Claude Desktop. The Syncropel tools appear in the Tools panel.

Claude Code

No file edit needed. Claude Code keeps its own list of MCP servers, managed with its mcp subcommand:

claude mcp add syncropel -- spl mcp serve

spl mcp setup-claude-code runs exactly that command.

Cursor

Global at ~/.cursor/mcp.json (all operating systems); per-project at <project-root>/.cursor/mcp.json (the project file takes precedence):

{
  "mcpServers": {
    "syncropel": {
      "command": "spl",
      "args": ["mcp", "serve"]
    }
  }
}

Cursor reloads the file when you save it.

Cline (VS Code extension)

Cline stores its MCP config in its own file under VS Code's globalStorage folder, not in settings.json:

  • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json

Replace Code with Cursor or Windsurf if Cline is installed in those editors (use --flavor cursor|windsurf with the setup command).

{
  "mcpServers": {
    "syncropel": {
      "command": "spl",
      "args": ["mcp", "serve"]
    }
  }
}

Zed

Add this to ~/.config/zed/settings.json. Zed calls MCP servers "context servers" (not mcpServers):

{
  "context_servers": {
    "syncropel": {
      "source": "custom",
      "command": "spl",
      "args": ["mcp", "serve"],
      "env": {}
    }
  }
}

Zed quirk: the "source": "custom" field is required. Without it, Zed silently ignores the entry: no error, no log message, and the tools never appear. If spl mcp setup-zed seems to have worked but the tools aren't showing up in Zed, verify your settings.json has this field under each context_servers.* entry.

Zed runs on macOS and Linux only (there is no official Windows build).

Kiro (AWS)

Global at ~/.kiro/settings/mcp.json; per-project at <project-root>/.kiro/settings/mcp.json:

{
  "mcpServers": {
    "syncropel": {
      "command": "spl",
      "args": ["mcp", "serve"]
    }
  }
}

OpenCode

Global at ~/.config/opencode/opencode.json; per-project at <project-root>/opencode.json. OpenCode uses the top-level key mcp (not mcpServers) and requires a "type": "stdio" field:

{
  "mcp": {
    "syncropel": {
      "type": "stdio",
      "command": "spl",
      "args": ["mcp", "serve"],
      "enabled": true
    }
  }
}

Gemini CLI

Global at ~/.gemini/settings.json; per-project at <project-root>/.gemini/settings.json:

{
  "mcpServers": {
    "syncropel": {
      "command": "spl",
      "args": ["mcp", "serve"]
    }
  }
}

Codex CLI

Codex stores its MCP config in TOML at ~/.codex/config.toml. Don't edit it by hand; use Codex's own codex mcp add command, which manages the file format:

codex mcp add syncropel -- spl mcp serve

spl mcp setup-codex runs exactly that command.

The 8 tools

Every MCP client sees the same tools:

  • find: one text search across file names, file contents and conversations (see the Find guide)
  • create_thread: create a new thread with an INTEND record
  • emit_record: write a record (INTEND, DO, KNOW or LEARN)
  • read_thread: read records from a thread (most recent first)
  • fold_thread: get the current state of a thread (status, participants, latest records)
  • trust_query: query trust scores by actor or domain
  • dispatch: send work to an actor
  • fan_out: split work across several actors with a join rule

All 8 tools are available over both stdio and HTTP. Dispatch through MCP over HTTP is simpler than POST /v1/dispatch (no budget check and no lifecycle events), so clients that need those should call POST /v1/dispatch directly.

Remote MCP over HTTP

For hosted setups, sandboxed agents, or whenever you want MCP tools reachable over the network, spl serve exposes MCP over HTTP at /v1/mcp, with the same message format as stdio.

curl -X POST https://your-host.example.com/v1/mcp \
  -H "Authorization: Bearer $SPL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Response format

There are two response formats, chosen by the Accept header:

  • Accept: application/json (or no Accept header): a single JSON body. This is the default.
  • Accept: text/event-stream: a streamed response. The reply arrives in a single data: event, then the connection closes.
# Ask for a streamed (SSE) response; the JSON-RPC body inside is the same
curl -X POST https://your-host.example.com/v1/mcp \
  -H "Authorization: Bearer $SPL_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# Returns: data: {"jsonrpc":"2.0","id":1,"result":{"tools":[...]}}\n\n

See Authentication & Service Accounts for how to create SPL_TOKEN.

When to choose this pattern

  • You use an AI client with native MCP support (any of the nine above)
  • You want the least setup: one command and it works
  • Your workflow has fewer than about 10 tool calls per session (MCP handles many tools well, and Syncropel has 8)

Pattern 2: Shell-integrated (no MCP needed)

For AI clients that can run shell commands, such as Claude Code and Cursor's agent mode. This pattern doesn't need MCP. The agent runs spl as a shell command and reads its output, as plain text or with -o json. The only setup is an optional system-prompt recipe.

Quickstart

spl mcp recipe claude-code     # recipe for Claude Code
spl mcp recipe cursor          # recipe for Cursor agent mode
spl mcp recipe generic         # recipe for any AI client that can run shell commands

Each command prints a system-prompt block you can paste. Put it in your client's custom-instructions field, or save it to a file and reference it with @.

What the recipe does

The recipe teaches your agent the basic Syncropel steps:

  • Open a thread with spl intend "<goal>"
  • For each meaningful step, run spl do, spl know or spl learn
  • Close the thread with spl know "<summary>" --fulfills <intend_record_id>
  • Record outcomes and artifacts, not internal reasoning

See spl mcp recipe generic for the full default recipe.

Why this works

For simple operations, coding agents (Claude Code, Cursor agent mode) tend to use command-line tools more efficiently than MCP: fewer tokens in context and no tool definitions to load. Every spl command has -o json and -o stream-json output, so the agent can parse results without scraping text.

When to choose this pattern

  • Your AI client can run shell commands (Claude Code, Cursor agent mode), with or without MCP support
  • You want the agent's actions visible in both your terminal history and your Syncropel records (one shell line, one record)
  • You're writing custom agents driven by shell scripts

Pattern 3: Programmatic Agents (for agents that write code)

For agents that get tasks done by writing code: models with code execution, agents on serverless platforms, or custom frameworks that run code in a sandbox. The agent writes a short program using @syncropel/sdk (TypeScript) or syncropel (Python) that does multi-step work entirely in the sandbox. Only the final result goes back into the model's context.

Why this pattern

Cloudflare and Anthropic both argue the same case: LLMs are trained on far more code than tool-call protocols. Offering tools as a typed SDK in a sandbox saves a lot of tokens in multi-step workflows: 20 writes take one round-trip through the model's context instead of 20.

See the Programmatic Agents guide for worked examples in Python and TypeScript.

When to choose this pattern

  • Your agent can run code (a model with code execution, a serverless platform, a custom Python or Node sandbox)
  • Your workflow has more than 10 coordinated operations per session
  • You want writes that never crash the agent on a passing network error (the SDK returns an error value instead of throwing)
  • You care about token use at scale

Choosing between patterns

A rough decision tree:

Does your client support MCP natively?
├── Yes → Pattern 1 (MCP server): one `spl mcp setup-<client>` command
└── No → Can the client run shell commands?
    ├── Yes, for simple operations → Pattern 2 (`spl mcp recipe <client>`)
    └── Yes, and the agent writes code for the task → Pattern 3 (SDK in sandbox)

Many teams use all three: MCP for interactive sessions, shell for coding agents and the SDK for production workers.

Authentication across all three patterns

All three patterns sign in to your workspace the same way: with a bearer token. See the security model for the full setup. Quick path:

# One-time per install
spl service-account create --bootstrap --name local --with-token
# Copy the printed token. `spl`, @syncropel/sdk and syncropel (Python)
# all read it from ~/.syncro/token automatically.
spl token save <token>

A workspace that only listens on your own machine can skip sign-in with --insecure-localhost, for local testing. Real workspaces, and any remote MCP use, should always require a token.

What's next

On this page