Skip to main content
Glama
README.md
# šŸ¤– AI Dev Assistant — MCP Server

> A production-ready **Model Context Protocol (MCP) Server** that bridges Claude Desktop directly to your local Windows 10 development environment. Give Claude the ability to read your code, run scripts, search docs, and execute safe terminal commands — all without leaving the chat.

---

## ✨ What It Does

This server extends Claude Desktop with four powerful developer tools:

| Tool | What It Does |
|------|-------------|
| `github_repo_reader` | Recursively reads any local repo (ignores `.git`, `node_modules`, binaries) |
| `code_executor` | Runs Python or Node.js snippets in isolated child processes |
| `doc_search` | Full-text keyword search across your local `docs/` folder |
| `terminal_commander` | Executes safe CMD/PowerShell commands via a strict allowlist |

---

## šŸ—ļø Project Structure

```
ai-dev-assistant-mcp/
ā”œā”€ā”€ main.py                      ← MCP server entry point & tool implementations
ā”œā”€ā”€ pyproject.toml               ← Python project configuration
ā”œā”€ā”€ claude_desktop_config.json   ← Example Claude Desktop config block
└── README.md
```

---

## āš™ļø Setup (Windows 10)

### Prerequisites

- [Python 3.8+](https://python.org/) — verify with `python --version`
- [Node.js](https://nodejs.org/) (optional, only needed for the `code_executor` Node.js runtime)
- [Claude Desktop](https://claude.ai/download) installed
- [uv](https://github.com/astral-sh/uv) (optional, for faster installs) or pip

### Step 1 — Clone / Place the Project

Place this project folder somewhere permanent, for example:

```
C:\ai-dev-assistant-mcp\
```

> āš ļø **Do not move the folder later** — Claude Desktop will reference the script path.

### Step 2 — Install Dependencies

Open a terminal in the project root and run:

```cmd
cd C:\ai-dev-assistant-mcp
pip install -e .
```

Or with uv:

```cmd
uv pip install -e .
```

### Step 3 — Configure Claude Desktop

Open (or create) the Claude Desktop config file at:

```
%APPDATA%\Claude\claude_desktop_config.json
```

Paste in the following block (adjust the path if you placed the project elsewhere):

```json
{
  "mcpServers": {
    "ai-dev-assistant": {
      "command": "python",
      "args": [
        "C:\\ai-dev-assistant-mcp\\main.py"
      ],
      "env": {}
    }
  }
}
```

> šŸ’” **Already have other MCP servers?** Just add the `"ai-dev-assistant"` key inside your existing `"mcpServers"` object.

### Step 4 — Restart Claude Desktop

Fully quit and relaunch Claude Desktop. You should see the šŸ”§ tools icon in the chat input bar — click it to confirm all four tools appear.

---

## šŸ”’ Security Architecture

### Terminal Commander Safe List

The `terminal_commander` tool will **refuse to run any command** whose base name is not on the explicit allowlist in `main.py`:

```python
SAFE_COMMANDS_ALLOWLIST = {
    "dir", "ls", "git", "node", "npm", "npx", "python",
    "tsc", "docker", "ipconfig", "ping", "whoami", ...
}
```

**Additionally**, even allowlisted commands are blocked if they match any dangerous pattern:

```
rm -rf     del /s     format C:     shutdown
taskkill   net user   netsh         Invoke-Expression
curl | bash           registry edits   UAC elevation ...
```

To **add a new command**, edit `SAFE_COMMANDS_ALLOWLIST` in `main.py`.

### Code Executor Sandbox

- Scripts run in **isolated temp files** — no persistent state between calls
- **15-second hard timeout** — runaway processes are killed automatically
- **64 KB output cap** — prevents memory exhaustion from verbose output
- Temp files are **deleted immediately** after execution

### Repo Reader Limits

- Ignores: `.git`, `node_modules`, `.next`, `dist`, `__pycache__`, `.venv`, etc.
- Skips: binary files, images, archives, `.lock` files
- **500 KB per-file cap** — large generated files are skipped automatically
- **500 file maximum** per call

---

## šŸ› ļø Usage Examples

Once connected to Claude Desktop, you can ask Claude:

```
"Read my repo at C:\Projects\my-api and explain the architecture."

"Run this Python script and tell me the output:
  import json; print(json.dumps({'status': 'ok', 'count': 42}))"

"Search my docs folder at C:\Projects\my-api\docs for 'authentication'"

"Run git status in C:\Projects\my-api"

"What files are in C:\Projects? Run dir."
```

---

## šŸ”§ Development

### Run Directly

```cmd
python main.py
```

### Add a New Tool

1. Add a new `@Tool()` decorated function in `main.py`
2. The server will automatically register it

---

## 🪟 Windows Path Notes

Windows paths use backslashes. In JSON config files, **always double-escape** them:

```json
"C:\\Users\\YourName\\Projects\\my-repo"
```

In Claude prompts, you can use either style — the tools normalize paths internally using `pathlib.Path.resolve()`.

---

## šŸ“¦ Tech Stack

| Layer | Technology |
|-------|-----------|
| Language | Python 3.8+ |
| MCP SDK | `mcp` |
| Process execution | `asyncio.subprocess` |
| Transport | stdio (standard MCP transport) |

---

## šŸ¤ How It Bridges Claude and Windows

```
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│                  Claude Desktop                  │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│  │   Claude AI (Claude Sonnet / Opus)          │ │
│  │   → Decides which tool to call              │ │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                 │ MCP Protocol (stdio JSON-RPC)
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│           AI Dev Assistant MCP Server            │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  │ Repo Reader  │  │     Code Executor         │  │
│  │ (pathlib)    │  │  (asyncio.subprocess)     │  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  │  Doc Search  │  │   Terminal Commander      │  │
│  │ (os.walk)    │  │   (cmd.exe / pwsh.exe)   │  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                              │
              ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
              │     Windows 10 File System    │
              │     Python / Node Runtimes    │
              │     Git / npm / Docker        │
              ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
```

Claude sends a tool-call request over stdio. The MCP server validates it, executes the appropriate handler, and returns formatted Markdown back to Claude — which presents it naturally in the conversation.

---

## šŸ“„ License

MIT — free to use, modify, and build upon.

TDQS

A4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: code_executor runs code snippets, doc_search searches documents, github_repo_reader reads repository files, and terminal_commander executes system commands. The descriptions make it easy to differentiate between them, as they target different resources and use cases.

Naming Consistency4/5

The naming follows a consistent snake_case pattern with descriptive names (e.g., code_executor, doc_search), but there is a minor deviation with github_repo_reader using a compound term that could be more aligned (e.g., repo_reader). Overall, the naming is readable and mostly predictable.

Tool Count5/5

With 4 tools, the count is well-scoped for an AI Dev Assistant, covering key development tasks like code execution, documentation search, repository reading, and terminal commands. Each tool earns its place without feeling excessive or insufficient for the server's purpose.

Completeness4/5

The tool set covers essential development workflows, including code execution, documentation, repository management, and system operations. A minor gap exists in not having tools for more advanced tasks like debugging or version control beyond basic commands, but agents can work around this with the provided tools.

Maintenance

ActivityInactive
ResponsivenessNo issues