Spectron integrates with agents through HTTP, MCP, official SDKs, and harness adapters that batch conversation turns into /facts/batch, using the same provenance and trust model as the server.
The REST surface is described by an OpenAPI specification. Python, TypeScript, and Swift clients track that spec so request and response shapes stay aligned with the server.
MCP server (coding assistants)
Native MCP at /mcp on the api port — same Authorization: Bearer auth as REST. Prefer this when the client already speaks MCP (Claude Desktop, Cursor, Windsurf, VS Code, Claude Code).
Python SDK
Spectron ships inside the surrealdb package on PyPI — the same install as the SurrealDB Python driver. Do not install the unrelated spectron package.
JavaScript and TypeScript SDK
Separate npm package under the SurrealDB scope:
Swift SDK
The Spectron product ships alongside the SurrealDB Swift driver in surrealdb.swift. Add the Spectron library product to your target, then import it:
Kotlin SDK
The Spectron client for Kotlin is bundled in the SurrealDB Kotlin SDK (com.surrealdb:kotlin) under the com.surrealdb.kotlin.spectron package — no separate dependency. It is Kotlin Multiplatform (JVM, Android, iOS) with a suspend-based API.
REST API
Direct HTTP from any language. End-user routes: /api/v1/{context_id}/…. Management: /api/v1/contexts/….
→ REST integration guide · Full reference
Harness adapters (automatic turn capture)
Thin packages that mirror agent runtime traffic into POST /api/v1/{ctx}/facts/batch without changing your prompts:
| Platform | Package |
|---|---|
| LangChain (Python) | spectron-langchain |
| OpenAI Agents (Python) | spectron-openai |
| Vercel AI SDK (TS) | @surrealdb/spectron-vercel-ai |
| n8n | n8n-nodes-spectron |
| Claude Code | npx install-spectron-hook |
Not shipped yet
Semantic Kernel and CrewAI adapters — no packages in the repo; pages are placeholders.
Embedded in-process library — use REST or SDK against a deployed instance (Embedded quickstart).