# Apighost

> Mock API server generated from OpenAPI specs for local development and testing

- **Type:** MCP server
- **Install:** `agentstack add mcp-coding-dev-tools-apighost`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Coding-Dev-Tools](https://agentstack.voostack.com/s/coding-dev-tools)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Coding-Dev-Tools](https://github.com/Coding-Dev-Tools)
- **Source:** https://github.com/Coding-Dev-Tools/apighost
- **Website:** https://coding-dev-tools.github.io/devforge/

## Install

```sh
agentstack add mcp-coding-dev-tools-apighost
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# APIGhost

[](https://github.com/Coding-Dev-Tools/apighost/stargazers)

**OpenAPI spec → mock server with VCR recording**

> ⭐ **Star this repo** if you build or test APIs — it helps others discover APIGhost!

[](https://github.com/Coding-Dev-Tools/apighost)
[](https://github.com/Coding-Dev-Tools/apighost/blob/main/LICENSE)
[](https://github.com/Coding-Dev-Tools/apighost/actions/workflows/ci.yml)
[](https://www.opensourcealternative.to/project/apighost)

## Why APIGhost?

Every frontend and integration test needs a mock API. Most teams either hardcode responses (brittle), run a shared staging server (slow, flaky), or hand-write mock configurations (time-consuming). APIGhost reads your OpenAPI spec and **generates a working mock server in seconds** — with realistic fake data, scenario switching for edge cases, and VCR recording for deterministic test replay. When your API spec changes, your mock server updates automatically.

## Installation

**pip (Python):**
```bash
pip install git+https://github.com/Coding-Dev-Tools/apighost.git
```

Or via the self-hosted PyPI index:
```bash
pip install --index-url https://coding-dev-tools.github.io/pypi-index/simple/ apighost
```

**Homebrew:**
```bash
brew tap Coding-Dev-Tools/homebrew-tap
brew install apighost
```

## Quick Start

```bash
# Start a mock server from an OpenAPI spec
apighost serve petstore.yaml

# Or run directly from a URL
apighost serve https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml
```

## Commands

### `apighost serve`
Start a mock server from an OpenAPI spec file.

```bash
apighost serve spec.yaml                    # Default port 8080
apighost serve api.json -p 3000             # Custom port
apighost serve spec.yaml --scenario error    # Use error scenario
apighost serve spec.yaml --record            # Record interactions to cassette
```

### `apighost record`
Start a server, make sample requests, and record them to a cassette.

```bash
apighost record petstore.yaml
apighost record spec.yaml --output my-test-cassette
```

### `apighost replay`
Replay a recorded cassette as a deterministic mock server.

```bash
apighost replay my-recording
apighost replay /path/to/cassette.json -p 3000
```

### `apighost scenario`
Manage response scenarios — named sets of overrides.

```bash
apighost scenario create error-test -d "API error scenarios"
apighost scenario edit error-test "GET /users" --status 500 --body '{"error":"oops"}'
apighost scenario list
apighost scenario delete error-test
```

### `apighost generate`
Generate realistic sample data from an OpenAPI spec into a scenario.

```bash
apighost generate petstore.yaml
```

### `apighost info`
Show APIGhost configuration and storage info.

## Features

- **OpenAPI 3.0/3.1 parsing** — full path, parameter, and response parsing
- **Realistic fake data** — Faker-powered with property name hints (emails, names, IDs)
- **VCR recording** — capture real interactions for deterministic replay
- **Scenario system** — named response presets for testing edge cases
- **Path parameter support** — dynamic URL path resolution
- **Status code selection** — picks appropriate response codes per scenario

## CI/CD Integration

```yaml
# GitHub Actions — start mock API for integration tests
- name: Start mock API
  run: |
    apighost serve api-spec.yaml -p 8080 &
    sleep 2

- name: Run integration tests against mock
  run: pytest tests/integration/
```

```bash
# Deterministic replay — no flaky tests
apighost record petstore.yaml                    # Record once
apighost replay my-recording -p 8080            # Replay forever, same responses
```

## Alternatives Comparison

| Feature | APIGhost | Prism | WireMock | Mockoon |
|---------|----------|-------|----------|---------|
| OpenAPI → mock server | ✅ | ✅ | ❌ | ✅ |
| VCR record/replay | ✅ | ❌ | ✅ | ❌ |
| Scenario switching | ✅ | ❌ | ✅ | ✅ |
| Realistic fake data | ✅ | ✅ | ❌ | ❌ |
| Zero-config from spec | ✅ | ✅ | ❌ | ✅ |
| CLI-first (no GUI) | ✅ | ✅ | ✅ | ❌ |
| Spec change auto-sync | ✅ | ✅ | ❌ | ❌ |

**APIGhost vs Prism**: Prism generates mock responses but can't record/replay or switch scenarios. APIGhost adds VCR cassettes and scenario presets.

**APIGhost vs WireMock**: WireMock requires hand-coded stubs. APIGhost generates everything from your OpenAPI spec — zero config.

**APIGhost vs Mockoon**: Mockoon needs a GUI. APIGhost is CLI-first — perfect for CI and headless environments.

## Pricing

| Tier | Price | Features |
|------|-------|----------|
| **Free** | $0 | Unlimited local use, 100 requests/session |
| **Pro** | $12/mo ($119/yr) | Unlimited requests, VCR cassettes, CI/CD integration |
| **Suite** | $49/mo ($39 billed annually) | All tools in the Coding-Dev-Tools ecosystem under one license |

## Storage

Cassettes and scenarios are stored in `~/.apighost/`:
- `~/.apighost/cassettes/` — recorded interaction cassettes (JSON)
- `~/.apighost/scenarios/` — response scenario definitions (JSON)

## Roadmap

- [ ] OpenAPI 3.1 full support (JSON Schema draft 2020-12)
- [ ] Webhook simulation
- [ ] Latency simulation with per-endpoint config
- [ ] Dashboard UI for real-time request inspection
- [ ] MCP server integration for AI-assisted testing
- [ ] Docker image

## Development

```bash
git clone https://github.com/Coding-Dev-Tools/apighost.git
cd apighost
pip install -e ".[dev]"
pytest
```

## License

MIT — see [LICENSE](LICENSE)

---

Part of [DevForge](https://coding-dev-tools.github.io/devforge/) — a suite of 10 developer CLI tools built by autonomous AI agents. Also check out [API Contract Guardian](https://github.com/Coding-Dev-Tools/api-contract-guardian) (breaking change detection), [DeployDiff](https://github.com/Coding-Dev-Tools/deploydiff) (infrastructure diffs), [json2sql](https://github.com/Coding-Dev-Tools/json2sql) (JSON → SQL), [ConfigDrift](https://github.com/Coding-Dev-Tools/configdrift) (config drift detection), [DeadCode](https://github.com/Coding-Dev-Tools/deadcode) (dead code cleanup), [APIAuth](https://github.com/Coding-Dev-Tools/apiauth) (API key management), [Envault](https://github.com/Coding-Dev-Tools/envault) (env sync), [SchemaForge](https://github.com/Coding-Dev-Tools/schemaforge) (ORM converter), and [click-to-mcp](https://github.com/Coding-Dev-Tools/click-to-mcp) (CLI → MCP server).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Coding-Dev-Tools](https://github.com/Coding-Dev-Tools)
- **Source:** [Coding-Dev-Tools/apighost](https://github.com/Coding-Dev-Tools/apighost)
- **License:** MIT
- **Homepage:** https://coding-dev-tools.github.io/devforge/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-coding-dev-tools-apighost
- Seller: https://agentstack.voostack.com/s/coding-dev-tools
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
