mini-swe-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mini-swe-mcp
A mini-swe-agent harness exposed as a stateless MCP server with a built-in single-user OAuth 2.0 backend and optional RTK output filtering.
Instead of bundling its own LLM loop, your MCP client (e.g. Claude) acts as the model while this server provides mini-swe-agent's exact environment, tool, and observation format:
MCP client ──OAuth──▶ /authorize (one password) ──▶ bearer token ──▶ POST /mcp
│
tool "bash" ──▶ (optional rtk rewrite) ──▶ bash -lc (detached pgid)
│
JSON observation { returncode, output } ◀─────────┘What makes it mini-swe-agent
Single
bashtool: matchesmini-swe-agent'sBASH_TOOL({ command }, plus optionaltimeoutand optionalrawwhenrtk_enabledis on). No custom file-edit tools — files are viewed and edited via standard bash (nl,sed,cat <<'EOF').LocalEnvironmentexecution: every command runs in a fresh, non-persistent subshell (bash -lc) in its own process group (detached: true+kill(-pid, SIGKILL)on timeout so child processes are never orphaned), withmini.yaml's environment variables (PAGER=cat,MANPAGER=cat,LESS=-R,PIP_PROGRESS_BAR=off,TQDM_DISABLE=1, plusGIT_PAGER=cat,TERM=dumb,NO_COLOR=1).mini.yamlJSON observation format: returns{ "returncode": 0, "output": "..." }, or{ "returncode": 0, "output_head": "...", "output_tail": "...", "elided_chars": N, "warning": "Output too long." }when output exceedsMAX_OUTPUT_CHARS(default10000, keeping 5,000 head + 5,000 tail chars in bounded memory), plusexception_infoon timeout/spawn errors.Same OAuth 2.0 backend: one password in
.env, one baked OAuth client, PKCE S256, dynamic client registration, refresh token rotation, brute-force lockout, stateless Streamable HTTP/mcp.
Related MCP server: AKIMCP
Quick start
Requires Bun and bash. RTK is optional (rtk_enabled in config.json).
bun install
cp .env.example .env # set MCP_PASSWORD, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET
bun run start # listens on 0.0.0.0:8080 per config.jsonPoint an MCP client at http://localhost:8080/mcp (or your public tunnel origin). The client receives 401 with resource_metadata, discovers the OAuth endpoints, renders the password login form, and returns with a bearer token.
Scripts: bun run start, bun run dev (watch mode), bun run typecheck.
The bash tool
argument | ||
| required | Bash command executed in a fresh subshell ( |
| optional | Bypass RTK and return unfiltered output with a larger character cap ( |
| optional | 1–600 seconds; default from |
Observation format
Normal output (< MAX_OUTPUT_CHARS, default 10000):
{
"returncode": 0,
"output": "hello world\n"
}Truncated output (> MAX_OUTPUT_CHARS):
{
"returncode": 0,
"output_head": "...",
"output_tail": "...",
"elided_chars": 42000,
"warning": "Output too long."
}Timeout or execution error (also sets MCP isError: true; ordinary non-zero exit codes set isError: false and report returncode in the JSON payload):
{
"returncode": -1,
"output": "partial output before timeout\n",
"exception_info": "An error occurred while executing the command: Command '...' timed out after 5 seconds"
}Optional RTK integration
When "rtk_enabled": true in config.json:
Before running a command (unless
raw: true), the server runsrtk rewrite "<command>". If RTK provides a filtered equivalent, that command runs instead andrtk_commandis included in the JSON observation.If RTK elides output and prints
rtk recall <hash>, the JSON observation includes"rtk_recall": ["rtk recall <hash>"]so the model can retrieve full output using the samebashtool.Passing
raw: trueskips RTK and sets"rtk_bypassed": true.
Setting "rtk_enabled": false removes RTK completely from execution, the bash tool schema, and JSON observations.
OAuth backend
Unchanged from shell-mcp:
POST /mcp → 401 + WWW-Authenticate: Bearer resource_metadata="…"
GET /.well-known/oauth-protected-resource → resource, authorization_servers
GET /.well-known/oauth-authorization-server → endpoints, S256, grant types
POST /oauth/register → 201, baked client_id (DCR)
GET /oauth/authorize → password login form
POST /oauth/authorize → 302 redirect_uri?code=…&state=…
POST /oauth/token → access_token + refresh_token
POST /oauth/revoke → drops the tokenAuthorization codes: single-use, 60s TTL, bound to
redirect_uriand PKCE S256 challenge.Tokens: in-memory opaque bearer tokens (
TOKEN_TTL, default 12h) with rotating refresh tokens.Brute-force protection: 8 failed logins within 5 minutes triggers a 60s lockout.
Configuration
config.json (override path with CONFIG_PATH):
{
"url": "https://shell.example.com",
"host": "0.0.0.0",
"port": 8080,
"allowed_redirects": [],
"allow_any_redirect": false,
"rtk_enabled": true
}Optional keys in config.json: cwd, timeout, max_output_chars, max_raw_output_chars, descriptions.
descriptions lets you override the bash tool and parameter descriptions exposed to the MCP client (each key is optional and falls back to the built-in default):
key | |
| Base description of the |
| Suffix appended to |
| Description of the |
| Description of the |
| Description of the |
Environment variables (.env):
variable | default | |
| required | Single user password for |
| required | Baked OAuth client credentials. |
|
| Alternate config file. |
|
| Working directory for subshells. |
|
| Default per-command timeout in seconds. |
|
| Path to RTK binary when |
|
| Observation truncation threshold (head + tail). |
|
| Truncation threshold when |
|
| Access token lifetime in seconds. |
|
| Label shown on the login form. |
Project layout
src/config.ts config.json + env loading & validation
src/environment.ts LocalEnvironment execution, process-group kill, RTK rewrite, JSON observation formatter
src/mcp.ts McpServer with bash tool
src/oauth.ts OAuth 2.0 authorization server (PKCE S256, DCR, tokens, lockout)
src/index.ts Bun.serve HTTP router, bearer auth, stateless Streamable HTTP MCP transportTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Multi-tenant backend your coding agent configures over MCP: auth, RBAC, data, workflows, deploy.
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
A full backend your AI coding agent can set up over MCP
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables any MCP-compatible AI, whether in the browser or running locally, to create and edit projects, run terminal commands and long-running jobs, and optionally use Docker, all guarded by a policy engine, workspace jail, authentication, and audit logging.23MIT
- AlicenseNot gradedqualityAmaintenanceEnables web-based AI clients like Claude, ChatGPT, and Grok to securely operate a local machine through OAuth-gated MCP tools covering files, shell, Git, databases, browser automation, and background tasks.MIT
- AlicenseNot gradedqualityAmaintenanceEnables web-based AI clients like Claude, ChatGPT, and Grok to securely operate a local machine through an OAuth-gated MCP endpoint, covering files, shell commands, search, Git, SQLite, browser automation, DevTools, background tasks, ports, clipboard, notifications, and Postman. Exposes 38 governed tools with a strict command whitelist, folder allowlisting, and rate limiting so browser chats can build projects, inspect databases and local APIs, and manage long-running jobs without granting unrestricted shell access.MIT
- AlicenseNot gradedqualityAmaintenancePublishes an OAuth-gated MCP endpoint with 38 governed tools that let web-based AI clients read and edit local files, run whitelisted shell commands, search code, use read-only Git and SQLite, drive browser and DevTools automation, manage background tasks, ports, clipboard, and localhost services. It keeps that broad control safe by default through a strict command whitelist and configurable allowed folders instead of unrestricted shell access.MIT