TERMINAL SWE AGENT BASH + MODEL CONTEXT PROTOCOL

Workshop-forged terminal agent with zero black-box bloat.

Peen-SWE pairs a transparent 100-line Python core with bare bash execution and standard Model Context Protocol (MCP) servers. No hidden prompt rewriting, no stateful shell corruption, and full support for local LLMs.

$ pip install "peen-swe[mcp]"
Get Started → CLI Docs
100 LOC
Core Loop Size
>74%
SWE-bench Verified
0.1s
Startup Latency
peen-swe-session ~ interactive REPL
State: Waiting for user confirmation

Three Simple Primitives

No multi-layer agent wrappers or complex graph state. Everything compiles down to plain execution.

PRIMITIVE 01

Stateless Shell Execution

Instead of holding a fragile pseudo-terminal open, every action executes via an independent subprocess.run or docker exec.

result = subprocess.run( cmd, shell=True, capture_output=True, text=True, timeout=timeout )
PRIMITIVE 02

Model Context Protocol

Connect any external tool server (Git, DB, Postgres, filesystem) via stdio JSON-RPC without adding agent-side custom dependencies.

peen -t "Inspect PR" \ --mcp-config mcp.json
PRIMITIVE 03

Strict Linear History

No hidden prompts or background summarization routines. The LLM messages match the execution trajectory step-for-step.

messages.append({ "role": "user", "content": f"<output>\n{res}\n</output>" })

Zero Bloat Architecture

Measured against traditional enterprise agents and legacy scaffolds.

Attribute Peen-SWE (peen) Claude Code Legacy SWE-agent
Core Agent Code ~100 lines (Python) Opaque bundle (TS) ~3,500 lines
Shell Management Stateless subprocess.run Stateful PTY Stateful session
Tool Protocol Native Bash + MCP 2.0 Hardcoded tool set Custom tool configs
Local Model Support Native (Ollama, vLLM, LM Studio) No (Anthropic only) Complex config
Startup Overhead < 100ms 1 - 2s 2 - 4s
Trajectory Inspection Built-in terminal TUI Web dashboard GUI viewer

Local & Offline Model Support

Run entirely on your own hardware without transmitting proprietary code to third-party APIs.

Ollama / LM Studio (Local OpenAI-compatible)

# Run offline with local Qwen2.5-Coder or Llama-3.3 export PEEN_MODEL_NAME="ollama/qwen2.5-coder:32b" export OPENAI_API_BASE="http://localhost:11434/v1" export MSWEA_COST_TRACKING="ignore_errors" peen -t "Refactor tests to pytest"

Zero latency, no rate limits, and zero dollar cost per token.

vLLM High-Throughput Cluster

# Launch dedicated vLLM server vllm serve Qwen/Qwen2.5-Coder-32B-Instruct --port 8000 # Connect Peen-SWE peen -m "hosted_vllm/Qwen2.5-Coder" \ -t "Fix bug in parser"

Batch evaluations at 400+ tokens/sec on local GPU instances.