MCmidnight-coderlocal coding agent

Agent integration surfaces

Build with the Midnight Coder runtime

Choose a terminal workflow for direct use or an API surface for applications, automation, editors, and services.

Midnight Coder exposes four main interfaces: the interactive terminal, a JSON-RPC app server, a Python SDK, and a TypeScript SDK. They share the same underlying agent runtime and workspace controls.

Choose an integration surface

TerminalInteractive repository work
App serverRich clients over JSON-RPC
Python SDKScripts, services, and notebooks
TypeScript SDKNode.js applications and automation

App server and JSON-RPC

The app server exposes structured requests, responses, notifications, threads, turns, streamed items, configuration, authentication, and approval interactions. It is the appropriate surface for editor integrations or custom clients that need lifecycle control.

Clients initialize a connection, create or resume a thread, start turns, and react to server notifications. Experimental methods require explicit capability negotiation and should not be assumed stable.

Python and TypeScript SDKs

The Python SDK can start threads, run turns, stream progress, and control workspace access. The TypeScript SDK wraps the CLI, exchanges structured JSONL events, supports streamed runs, structured output, image inputs, and thread resume.

Use an SDK when your application needs a language-native API. Use the app server when you need the broad protocol surface or are building a standalone client.

Preserve the security boundary

An integration should expose approval requests instead of bypassing them, pass the intended working directory explicitly, and avoid sending secrets through prompts. Environment and network access should be limited to what the automation needs.

Read the AI coding agent security guide before deploying unattended workflows.

Primary sources: app-server protocol, Python SDK, and TypeScript SDK.

Build on the runtime

Choose a terminal, app-server, Python, or TypeScript integration surface.

Explore Midnight CoderReview source