Skip to main content
Glama

๐Ÿ’ก What is Arrgon?

Arrgon is a local Model Context Protocol (MCP) server that gives Google Gemini the ability to read, write, search, and patch code files โ€” and run developer commands like flutter analyze, pytest, git diff, npm test, etc. โ€” all inside a sandboxed, zero-shell environment on your machine.

Use Gemini as a free AI coding agent. No API keys. No subscriptions. Just connect Arrgon to the Gemini Desktop App and start prompting.

What can you do with it?

  • ๐Ÿ” "Read lib/main.dart and find all TODO comments in the project"

  • โœ๏ธ "Add error handling to the fetchUser() function and run flutter analyze to check for issues"

  • ๐Ÿงช "Write a unit test for the auth module, then run pytest to verify it passes"

  • ๐Ÿ”„ "Refactor utils.py to use dataclasses and check git diff to review the changes"

Gemini autonomously loops through read โ†’ edit โ†’ verify cycles until the task is done.


Related MCP server: MCP ToolHub

๐Ÿš€ Quickstart (2 Minutes)

Prerequisites

Step 1: Clone & Install

git clone https://github.com/omkar-ukirde/Arrgon.git
cd Arrgon

python3 -m venv .venv
source .venv/bin/activate      # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

Step 2: Connect to Gemini Desktop App

Open the Gemini Desktop App โ†’ Settings (gear icon) โ†’ Connected Apps โ†’ Add custom connected app.

You will see two setup methods. Use Local MCP (recommended):

The Gemini app launches and manages the server process for you. Zero maintenance.

Field

Value

Setup method

Local MCP

Server name

Arrgon

Description

AI coding agent with file tools and safe command runner

Command

See below ๐Ÿ‘‡

Sandbox

Full access

Command โ€” paste the full path to start_mcp.sh:

/full/path/to/Arrgon/start_mcp.sh

Example (on macOS):

/Users/yourname/Arrgon/start_mcp.sh

๐Ÿ’ก Changing your project folder:

  • Edit DEFAULT_WORKSPACE inside start_mcp.sh to point to whatever project directory you want to work on (e.g., /Users/yourname/MyProject), or

  • Pass the directory directly as an argument in the Command field: /Users/yourname/Arrgon/start_mcp.sh /Users/yourname/MyProject

  • Always choose Full access under Sandbox settings so Arrgon can read and write to your workspace without permission errors.

Click Next โ†’ Connect, and you're done!

Option B: Cloud MCP (HTTP Mode)

If you prefer running the server yourself in a terminal (useful for debugging or switching projects):

1. Start the server:

cd Arrgon
./run_server.sh /path/to/your/project

2. In Gemini Desktop App, choose Cloud MCP and enter:

Field

Value

URL

http://127.0.0.1:8000/mcp

Note: You must keep the terminal running. Closing it stops the server.

Step 3: Start Coding with Gemini

Go back to the Gemini chat and try:

"List all files in my project and give me an overview of the codebase structure"

Gemini will call Arrgon's tools to browse your files, read code, and respond with a structured overview. From there, you can ask it to make changes, run tests, debug errors โ€” anything a coding assistant would do.


โš™๏ธ How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        MCP (stdio or HTTP)        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Gemini Desktop    โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚       Arrgon         โ”‚
โ”‚   App (free)        โ”‚    JSON-RPC tool calls            โ”‚   MCP Server         โ”‚
โ”‚                     โ”‚                                    โ”‚                      โ”‚
โ”‚  "Fix the bug in    โ”‚  โ”€โ”€โ–บ read_file("src/app.py")      โ”‚  Reads files         โ”‚
โ”‚   src/app.py and    โ”‚  โ—„โ”€โ”€ file content with line #s    โ”‚  Writes atomically   โ”‚
โ”‚   run the tests"    โ”‚  โ”€โ”€โ–บ patch_file(search, replace)  โ”‚  Searches code       โ”‚
โ”‚                     โ”‚  โ—„โ”€โ”€ "Successfully patched"       โ”‚  Runs safe commands  โ”‚
โ”‚                     โ”‚  โ”€โ”€โ–บ run_command("pytest")        โ”‚                      โ”‚
โ”‚                     โ”‚  โ—„โ”€โ”€ test results                 โ”‚  All sandboxed to    โ”‚
โ”‚                     โ”‚                                    โ”‚  your workspace dir  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Arrgon exposes 8 MCP tools that Gemini calls autonomously. Gemini decides which tools to call and in what order โ€” forming edit โ†’ verify loops on its own.


๐Ÿ›ก๏ธ Security

Arrgon is designed to be safe for autonomous AI usage on your local machine. Every operation is sandboxed.

run_command โ€” Zero-Shell Terminal Runner

The run_command tool is the most security-critical component. Here's what makes it safe:

Layer

Protection

shell=False execution

Commands are parsed with shlex.split() and executed as an OS argument vector (subprocess.run(..., shell=False)). Shell chaining (&& rm -rf, ;, |, `, $()) is impossible.

Binary whitelist

Only pre-approved developer tools are allowed: flutter, dart, git, pytest, ruff, flake8, black, python3, npm, gradle. Everything else is rejected.

Subcommand whitelist

Even allowed binaries are restricted to safe subcommands. For example, git status โœ… but git push โŒ, flutter analyze โœ… but flutter run โŒ.

Destructive token blocklist

Tokens like --force, -f, push, reset, rm, sudo, eval, exec are intercepted and blocked regardless of position.

Hard timeout

Commands are killed after 60 seconds (configurable 5sโ€“180s) to prevent hangs from interactive prompts.

Output truncation

Massive outputs are truncated to 15,000 characters so they don't crash Gemini's context window.

Filesystem Sandbox

Layer

Protection

Path traversal defense

All paths are resolved against WORKSPACE_DIR. Attempts like ../../etc/passwd raise security violations.

Symlink escape detection

Paths are fully resolved with .resolve() and validated with .is_relative_to() โ€” symlinks pointing outside the workspace are blocked.

Atomic writes

Files are written to a temporary file first, then atomically swapped via os.replace to prevent 0-byte corruption on crash.

Single-match patching

patch_file requires the search text to appear exactly once, preventing accidental mass replacements.


๐Ÿ”ง Available Tools

Tool

Description

list_files

Lists workspace files with sizes, filtering out .git, node_modules, build, __pycache__, etc.

read_file

Reads file content with numbered lines. Supports start_line/end_line slicing for large files.

write_file

Creates or replaces a file atomically. Auto-creates parent directories.

patch_file

Exact search-and-replace on code. Requires a unique match to prevent unintended edits.

search_code

Regex or text search across all code files. Returns file paths, line numbers, and snippets.

move_or_rename_file

Moves or renames files/directories within the workspace.

delete_file

Deletes a single file (directory deletion is blocked for safety).

run_command

Sandboxed CLI runner for whitelisted dev commands (see Security).


๐ŸŽ›๏ธ Customization

Environment Variables

Variable

Default

Description

MCP_WORKSPACE_DIR

./my_coding_workspace

Root directory for all file operations

MCP_HOST

127.0.0.1

Host to bind HTTP server (Cloud MCP mode only)

MCP_PORT

8000

Port for HTTP server (Cloud MCP mode only)

Adding More Commands

Edit the ALLOWED_COMMANDS dictionary in mcp_coding_agent.py to allow more tools:

ALLOWED_COMMANDS: dict[str, Optional[set[str]]] = {
    # Add your own:
    "cargo": {"build", "test", "check", "clippy"},
    "go":    {"build", "test", "vet", "fmt"},
    "make":  {"test", "build", "lint"},
    # ... existing entries ...
}

Set a value of None to allow any subcommand for a binary (only for trusted tools like test runners):

"mypy": None,  # Any arguments are allowed

Switching Projects

Local MCP: Edit the command in Gemini Desktop App settings to point to a different workspace directory.

Cloud MCP: Stop the server (Ctrl+C) and restart with a new path:

./run_server.sh /path/to/different/project

๐Ÿงช Running Tests

Arrgon includes 18 automated tests covering command validation, path security, file operations, and HTTP endpoint integration:

source .venv/bin/activate
pytest -v
test_mcp_coding_agent.py::test_validate_command_allowed PASSED
test_mcp_coding_agent.py::test_validate_command_shell_operators_blocked PASSED
test_mcp_coding_agent.py::test_validate_command_blocked_tokens PASSED
test_mcp_coding_agent.py::test_validate_command_unauthorized_binaries_and_subcommands PASSED
test_mcp_coding_agent.py::test_validate_command_empty PASSED
test_mcp_coding_agent.py::test_resolve_safe_path_valid PASSED
test_mcp_coding_agent.py::test_resolve_safe_path_traversal_blocked PASSED
test_mcp_coding_agent.py::test_write_and_read_file PASSED
test_mcp_coding_agent.py::test_read_file_errors PASSED
test_mcp_coding_agent.py::test_patch_file PASSED
test_mcp_coding_agent.py::test_search_code PASSED
test_mcp_coding_agent.py::test_list_files PASSED
test_mcp_coding_agent.py::test_move_or_rename_file PASSED
test_mcp_coding_agent.py::test_delete_file PASSED
test_mcp_coding_agent.py::test_run_command_allowed_execution PASSED
test_mcp_coding_agent.py::test_run_command_blocked PASSED
test_mcp_coding_agent.py::test_run_command_invalid_directory PASSED
test_mcp_coding_agent.py::test_streamable_http_initialization_and_tool_list PASSED

============================== 18 passed ==============================

๐Ÿ“ Project Structure

Arrgon/
โ”œโ”€โ”€ mcp_coding_agent.py        # Main MCP server (all tools + security)
โ”œโ”€โ”€ test_mcp_coding_agent.py   # Automated test suite (18 tests)
โ”œโ”€โ”€ run_server.sh              # Helper script for HTTP mode
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ LICENSE                    # MIT License
โ””โ”€โ”€ README.md                  # This file

๐Ÿค Contributing

Contributions are welcome! Some ideas:

  • Add more tool commands (Rust/Cargo, Go, Make, Docker, etc.)

  • Add a create_directory tool for scaffolding projects

  • Add undo_patch with file backup/restore

  • Windows support improvements (PATH handling, shell detection)

  • Multi-workspace support for monorepos

# Fork, clone, and run tests
git clone https://github.com/YOUR_USERNAME/Arrgon.git
cd Arrgon
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pytest -v

๐Ÿ“„ License

MIT License โ€” use it however you want, free forever.


Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to develop within a local project workspace by reading and modifying files, running commands and tests, checking Git state, and persisting progress as history sessions that can be restored in later conversations.
    Apache 2.0
  • F
    license
    A
    quality
    A
    maintenance
    Enables coding agents to perform workspace-confined file operations, read-only Git inspection, and structured shell commands, while requiring out-of-band human approval for mutations and external executions and maintaining an audit trail.
    14
    3
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI clients to safely read, search, understand, and edit local project code and files, with Git inspection, code indexing, and controlled command execution within permissioned workspaces.
    1 npm
    6
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables coding agents to safely inspect and modify project files within explicitly allowed workspace roots, with controls for file operations, git status/diff, and optionally allowlisted command execution.
    11
    Apache 2.0