std::slop logo

std::slop is a C++ monorepo for agentic tooling. It provides the std_slop interactive coding agent, the sl command-line tool, MCP client and server libraries with examples, and a Markdown parser and terminal renderer.

Components

ComponentPurposeGuide
std::slop coding agent (std_slop)Run interactive terminal sessions or batch prompts.Agent walkthrough
sl command-line toolRun prompts and inspect agent state from scripts.CLI guide
MCP client library and examplesConnect C++ applications to Streamable HTTP or modern local stdio MCP servers.Client API
MCP server library and exampleExpose explicitly registered tools over stdio.Server API
Agent database and schemaManage sessions, tools, model calls, and patch review state.Runtime data model
Markdown libraryParse Markdown and render styled terminal output using Tree-sitter.Parser and renderer

Implemented MCPs

A few MCP servers are implemented and documented:

  • Echo server: a small stdio MCP example. See the echo server guide.
  • Local workspace MCP: a bundled stdio server for worktree-aware file and shell tools. Shell commands are not sandboxed. See the local workspace tool guide.
  • run_js gateway: bounded JavaScript composition of downstream MCP tools. See the gateway guide.
  • Decision API MCP: typed noul, choice, and score evaluations for SystemOne models such as Jev from TypeSafe; OpenRouter is the default backend. See the Decision API guide.

Agent entry points

Build both interfaces:

bazel build //:std_slop //:sl

After model authentication and configuration, start the terminal UI or run a scripted prompt:

bazel-bin/app/std_slop
bazel-bin/app/sl --prompt "Summarize the repository structure"

Use the walkthrough for interactive sessions and the sl guide for scripts. Batch mode, configuration, and workflow details follow below.

Library quick starts

Build the MCP client examples:

bazel build //mcp/client:list_tools_example //mcp/client:call_tool_example

See the client guide for HTTP authorization, modern stdio connections, and argv configuration.

Build and test the stdio echo server:

bazel build //mcp/server:echo_server
bazel test //mcp/server:echo_server_test

See the server guide for requests, framing limits, and tool registration.

Build the Markdown parser and terminal renderer:

bazel build //markdown:parser //markdown:renderer

See the Markdown guide for parser and terminal renderer APIs.

Component boundaries

  • The Markdown library and echo server do not need a model, API key, or agent database. The echo integration test needs Python 3.
  • MCP clients support Streamable HTTP and modern MCP 2026-07-28 over local stdio. The inbound server package supports stdio only. Agent runtimes start enabled stdio commands as child processes; they do not use an HTTP wrapper or background daemon.
  • The server does not automatically expose agent tools. Applications must register tools and enforce their own access policy.
  • SQLite sessions, model authentication, personas, and mail workflows belong to the coding-agent runtime. They are not requirements for every library.
  • The Markdown renderer produces terminal output with ANSI styling. It is not an HTML renderer.

Build and test

Use a C++17 compiler and Bazel (Bazelisk is recommended). Build and test the monorepo:

bazel build //...
bazel test //...

The library quick starts above build selected components. Model credentials are needed for live agent/model calls, not for the library builds or local echo test.

Code conventions

  • C++ Standard: C++17.
  • Style: Google C++ Style Guide.
  • Exceptions: Disabled (-fno-exceptions).
  • Memory: RAII and std::unique_ptr exclusively.
  • Error Handling: absl::Status and absl::StatusOr.
  • Changes must remain ASan- and TSan-clean.

Documentation

Repository layout

PackageRole
markdown/Markdown parsing, syntax highlighting, and ANSI terminal rendering.
mcp/client/Outbound HTTP MCP client, authorization helpers, and examples.
mcp/server/Inbound stdio MCP server, dispatcher, and echo example.
mcp/Shared MCP types, JSON-RPC helpers, and schema validation.
app/Entry points for std_slop and sl.
interface/Interactive UI and application control.
core/Agent model orchestration, SQLite state, HTTP, and shell support.
tools/Agent tool implementations and argument validation.
docs/, site/, scripts/build_pages.pyDocumentation sources and generated website.

Agent runtime modules

The shared agent runtime includes:

  • database.h: Manages the SQLite-backed ledger. Handles persistence for messages, tools, skills, sessions, and usage data.
  • tool_dispatcher.h: Implements a thread-safe execution engine. It dispatches multiple tool calls concurrently while ensuring results are returned in the proper order for the LLM.
  • cancellation.h: Provides a mechanism for interrupting tasks. It supports registering callbacks to kill shell processes or abort HTTP requests.
  • orchestrator.h: high-level interface for model interaction. The Responses API orchestrator manages history windowing and response parsing.
  • shell_util.h: Executes shell commands in a separate process group, with support for live output polling and termination on cancellation.
  • http_client.h: A cancellation-aware HTTP client used for model API calls.

Agent interface and display

  • interface/: Implements the terminal UI with readline input, ANSI colors, and terminal control sequences.
  • markdown/: Uses Tree-sitter for Markdown parsing and code highlighting (C++, Python, Go, JavaScript, Rust, Bash). The agent UI uses it to render responses; C++ callers can use the library separately.
  • app/main.cpp: The primary event loop. Coordinates between the Orchestrator, ToolDispatcher, and UI.

Content is generated from the repository sources listed above. See the source files for the complete reference.