> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nihalxkumar.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Development Setup

> Set up your development environment for Arch MCP Server

# Development Setup

Set up your environment for developing and testing the Arch MCP Server.

<Note>
  This guide is for **developers** who want to contribute to the project. For **end users**, use the simple [uvx installation](/arch-mcp/install) instead.
</Note>

## Prerequisites

* **Python 3.11+** - Check version: `python --version`
* **uv** - Modern Python package manager
* **Git** - Version control

### Install uv

<CodeGroup>
  ```bash Arch Linux theme={null}
  sudo pacman -S uv
  ```

  ```bash Other Linux/macOS theme={null}
  curl -LsSf https://astral.sh/uv/install.sh | sh
  ```

  ```bash Windows theme={null}
  powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  ```
</CodeGroup>

## Clone Repository

```bash theme={null}
git clone https://github.com/nihalxkumar/arch-mcp.git
cd arch-mcp
```

## Install Development Dependencies

```bash theme={null}
uv sync
```

This installs all dependencies including development tools.

## Testing

### Run Test Suite

The project uses **pytest** for comprehensive automated testing:

```bash theme={null}
# Run all tests
uv run pytest

# Run with verbose output
uv run pytest -v

# Run with coverage report
uv run pytest --cov=arch_ops_server --cov-report=term-missing

# Run specific test file
uv run pytest tests/test_utils.py -v
```

**Current test coverage:**

* **92 tests** covering core functionality
* **59% overall coverage** (90-98% on core modules)
* Tests for utils, wiki, AUR, and pacman modules
* Async test support via pytest-asyncio

**Test modules:**

* `test_utils.py` - Platform detection, command execution (97% coverage)
* `test_wiki.py` - Search, page retrieval, API/scraping (98% coverage)
* `test_pacman.py` - Package info, updates, parsing (90% coverage)
* `test_aur.py` - Security analysis, metadata risk scoring (52% coverage)

### Test with MCP Inspector

Interactive browser-based testing - essential for development:

```bash theme={null}
./test_inspector.sh
```

This opens a web interface where you can:

* **Test tools interactively** - Call any tool with custom parameters
* **Try resources** - Test URI schemes with different inputs
* **Explore prompts** - See prompt workflows in action
* **Debug responses** - Inspect JSON responses and errors

<Tip>
  Use MCP Inspector during development to quickly test changes without restarting your MCP client.
</Tip>

## Testing Checklist

Before submitting code, verify:

* [ ] **Unit tests pass** - `uv run pytest` (all tests green)
* [ ] **Coverage maintained** - `uv run pytest --cov` (no significant drops)
* [ ] **New features tested** - Add tests for any new functionality
* [ ] **MCP Inspector works** - All tools return expected results
* [ ] **Arch Linux testing** - Test on Arch if available
* [ ] **Non-Arch testing** - Verify remote API fallbacks work
* [ ] **Error logs clean** - No unexpected errors in `stderr`
* [ ] **Error handling** - Test failure scenarios with pytest
* [ ] **Documentation updated** - User-facing docs reflect changes

## Recommended extensions:

* Pylance (type checking)
* Ruff (linting)

### Type Checking

```bash theme={null}
# Install mypy for type checking
uv pip install mypy

# Run type checks
mypy arch_ops_server.py
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Code Standards" icon="code" href="/arch-mcp/code-standards">
    Learn coding standards and best practices
  </Card>

  <Card title="Contributing Guide" icon="git-pull-request" href="/arch-mcp/contributing">
    Guidelines for submitting contributions
  </Card>
</CardGroup>
