
agent-godmode
io.github.mdvohraPublished by GitHub account mdvohrav0.1.9Updated Oct 24, 2026
Sandboxed workspace MCP: file ops, argv-only run_command, list_files; BYO LLM prompts.
Overview
Sandboxed workspace MCP server that gives an assistant file read/write/edit, directory listing and argv-only command execution confined to one root directory.
- What you can do
- Read UTF-8 text files, optionally with a line range and byte cap
- Create, overwrite or append text files, creating parent directories
- Search-and-replace inside an existing file, with an exact single-match rule unless replace_all is set
- List directory entries with recursion, glob, depth and dotfile options
- Run subprocesses from an argv list only, with an optional working directory under the root
- When to use it
- Useful when you want an assistant to work on a local code or document project while staying inside one directory, for example Cursor-style editing and running build or test commands. It also ships versioned system prompts and OpenAI-style tool definitions for wiring your own LLM loop in Python.
- Requirements
- Runs locally as a stdio process installed from PyPI (pip install agent-godmode). Requires an absolute workspace root, passed as the AGENT_GODMODE_ROOT environment variable or the --root CLI flag. Optional variables tune read size, command timeout, output truncation, listing caps and an allowed-command list. No API key is needed for the server itself; the README's OpenAI examples need OPENAI_API_KEY in your own app.
Installation
In SourceWeft
- Open agent-godmode in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
agent-godmode
Workspace-scoped MCP tools for building Cursor-style agents: read_file, write_file, edit_file, run_command, list_files. Includes strict, versioned system prompts (SYSTEM_PROMPT_V1) and OpenAI-style tool definitions so your app can wire any LLM with one import.
The LLM and API keys stay in your app. This package provides tool execution, sandboxing, and prompts—not a hosted model.
OpenAI + in-process tools: the Tier B section below is self-contained—copy the Python into a script, module, or REPL; no separate artifact is required.
Install
Editable / dev:
Migrating from mcp-agent-tools: uninstall the old package, install agent-godmode, change Python imports from mcp_agent_tools to agent_godmode, the CLI from mcp-agent-tools to agent-godmode, and environment variables from MCP_AGENT_TOOLS_* to AGENT_GODMODE_* (for example AGENT_GODMODE_ROOT).
Tools
All tools are scoped to a single workspace root. Paths are relative to that root (or absolute only if they resolve under it). The same operations are available over MCP (the agent-godmode server) and in-process via AgentWorkspace / WorkspaceTools.
For LLM integrations, tool shapes and descriptions are centralized in OPENAI_TOOL_DEFINITIONS and TOOL_DESCRIPTIONS; agent behavior is guided by SYSTEM_PROMPT_V1.
Tier A — Cursor (or any MCP client)
1. Pick a workspace directory (only paths under this root are allowed).
2. Add a server entry (stdio). Example for a global MCP config (paths use forward slashes on Windows):
Or with an explicit CLI root (overrides env for that process):
3. Paste SYSTEM_PROMPT_V1 (from agent_godmode.prompts or below) into your host’s system prompt if the client does not load server instructions automatically.
Environment variables
Tier B — Python app (in-process + OpenAI)
Design notes
- Workspace root — Examples use
D:\Avi-assignas a placeholder; pointWORK_DIRat any directory you control. - API key policy —
OPENAI_API_KEYis required only for Chat Completions. Imports setclient = OpenAI() if HAS_OPENAI_KEY else None; workspace setup and directedit_filerun without a key. - Model-authored I/O — For
write_file, persist only text returned by the model. Foredit_file, the model must copyold_stringexactly fromread_file(seeSYSTEM_PROMPT_V1).
1. Install dependencies
In a shell or any interactive Python session:
If your environment supports line magics (for example %pip in IPython), you can run the same installs there; do not place shell comments on the same line as %pip.
2. Imports and API key handling
3. Workspace bootstrap and seed file
4. LLM-authored file body (no tool calls)
Requires OPENAI_API_KEY. Skip if you are only exercising tools without the API.
5. Direct edit_file (no Chat Completions)
No API key required. The next lines create ws if you have not run the workspace section yet (same root).
6. Agent loop: model calls write_file
Requires OPENAI_API_KEY.
7. Agent loop: model calls edit_file
Requires OPENAI_API_KEY and the complete function from §6.
8. Optional: custom tool loop without run_agent_loop
Use OPENAI_TOOL_DEFINITIONS, call the Chat Completions API with tools=..., parse tool_calls, and route each call through ws.dispatch(name, json.loads(arguments)) (requires import json). For write_file, the content field should be whatever the model authored; for edit_file, pass old_string, new_string, and replace_all exactly as the model returned.
Optional limits on AgentWorkspace
Lower-level (WorkspaceTools + OPENAI_TOOL_DEFINITIONS)
Same sandbox without AgentWorkspace: use config_from_root(...) and WorkspaceTools. Pass OPENAI_TOOL_DEFINITIONS to your provider as tools= when you implement your own loop instead of run_agent_loop.
Compose the system message:
Imports reference
AgentWorkspace— pass a directory path; useread_file/write_file/edit_file/list_files/run_commandon that tree onlySYSTEM_PROMPT_V1,SYSTEM_PROMPT_CHANGELOG,TOOL_DESCRIPTIONSOPENAI_TOOL_DEFINITIONS— same shapes as MCP tools (fortools=in chat completions)build_server(config)— build aFastMCPapp (stdio viabuild_server(cfg).run())run_agent_loop— minimal multi-turn executor with yourcompletecallable (acceptsWorkspaceConfigorAgentWorkspace)
Safety model
- Python: all paths are resolved under the directory you passed to
AgentWorkspace(...)orconfig_from_root(...). - MCP / CLI: same rule via
AGENT_GODMODE_ROOTor--root(no..escape). read_file,write_file, andedit_fileonly touch UTF-8 text paths under that root;edit_filerequires valid UTF-8 (strict decode).run_commandusesargvonly (no shell). Optional allowlist viaAGENT_GODMODE_ALLOWED_COMMANDS.- Subprocess inherits the current environment; avoid passing secrets you do not want child processes to see.
CLI
Runs the MCP server on stdio (default for Cursor).
Agent loop (conceptual)
- System =
SYSTEM_PROMPT_V1(+ optional suffix). - User message +
OPENAI_TOOL_DEFINITIONS→ your LLM. - For each
tool_call, runWorkspaceTools.dispatch(or MCPcall_tool) — includingread_file,write_file,edit_file,list_files, andrun_commandas defined by the server. - Append tool results; repeat until the model returns text without tools.
run_agent_loop implements steps 2–4 given your complete() function.
License
MIT
Source: README.md at commit 2763967
Tools
0Version history
1- v0.1.9LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.
