Install Mock Server
The swag2mcp-mock binary is a separate tool for testing APIs with fake responses. It supports the same installation methods as the main binary.
Compatibility
| Method | macOS | Linux | Windows |
|---|---|---|---|
| One-liner (curl) | ✅ | ✅ | ❌ |
| Homebrew | ✅ | ❌ | ❌ |
| Scoop | ❌ | ❌ | ✅ |
| GitHub Release | ✅ | ✅ | ✅ |
| go install | ✅ | ✅ | ✅ |
| Build from source | ✅ | ✅ | ✅ |
| Docker | ✅ | ✅ | ✅ |
macOS
One-liner (recommended)
Two install modes — choose the one that fits:
# With sudo (installs to /usr/local/bin — recommended)
curl -fsSL https://swag2mcp.io/install-mock.sh | bash
# Without sudo (installs to ~/.local/bin)
curl -fsSL https://swag2mcp.io/install-mock.sh | bash -s -- --local--sudo (default): Installs to /usr/local/bin/swag2mcp-mock using sudo. You will be prompted for your password. If sudo fails, falls back to ~/.local/bin/swag2mcp-mock.
--local: Installs to ~/.local/bin/swag2mcp-mock without sudo. After install, add to your shell config:
export PATH="$HOME/.local/bin:$PATH"Verify:
swag2mcp-mock --versionHomebrew
brew install mmadfox/tap/swag2mcp-mockVerify:
swag2mcp-mock --versionGitHub Release
- Open the latest release page
- Download the archive for your Mac:
- Apple Silicon:
swag2mcp-mock_darwin_arm64.tar.gz - Intel:
swag2mcp-mock_darwin_amd64.tar.gz
- Apple Silicon:
- Open Terminal in the download folder and run:
tar -xzf swag2mcp-mock_darwin_*.tar.gz
sudo mv swag2mcp-mock /usr/local/bin/Verify:
swag2mcp-mock --versiongo install
go install github.com/mmadfox/swag2mcp/cmd/swag2mcp-mock@latestEnsure $GOPATH/bin is in your $PATH:
export PATH=$PATH:$(go env GOPATH)/binVerify:
swag2mcp-mock --versionBuild from source
git clone https://github.com/mmadfox/swag2mcp.git
cd swag2mcp
go build -o swag2mcp-mock ./cmd/swag2mcp-mock
sudo mv swag2mcp-mock /usr/local/bin/Verify:
swag2mcp-mock --versionDocker
Mount ~/.swag2mcp (or your custom workspace path) to /home/nonroot/.swag2mcp. The entrypoint automatically adjusts file permissions so the container can read your workspace.
Apple Silicon (M1/M2/M3/M4) users: Add
--platform linux/amd64to run the image:docker run --rm --platform linux/amd64 -v ~/.swag2mcp:/home/nonroot/.swag2mcp ...
docker pull ghcr.io/mmadfox/swag2mcp-mock:latestRun mock server:
docker run --rm -i -v ~/.swag2mcp:/home/nonroot/.swag2mcp ghcr.io/mmadfox/swag2mcp-mock:latestVerify:
docker run --rm -v ~/.swag2mcp:/home/nonroot/.swag2mcp ghcr.io/mmadfox/swag2mcp-mock:latest --versionLinux
One-liner (recommended)
Two install modes — choose the one that fits:
# With sudo (installs to /usr/local/bin — recommended)
curl -fsSL https://swag2mcp.io/install-mock.sh | bash
# Without sudo (installs to ~/.local/bin)
curl -fsSL https://swag2mcp.io/install-mock.sh | bash -s -- --local--sudo (default): Installs to /usr/local/bin/swag2mcp-mock using sudo. You will be prompted for your password. If sudo fails, falls back to ~/.local/bin/swag2mcp-mock.
--local: Installs to ~/.local/bin/swag2mcp-mock without sudo. After install, add to your shell config:
export PATH="$HOME/.local/bin:$PATH"Verify:
swag2mcp-mock --versionGitHub Release
- Open the latest release page
- Download the archive for your architecture:
- amd64:
swag2mcp-mock_linux_amd64.tar.gz - arm64:
swag2mcp-mock_linux_arm64.tar.gz
- amd64:
- Open Terminal in the download folder and run:
tar -xzf swag2mcp-mock_linux_*.tar.gz
sudo mv swag2mcp-mock /usr/local/bin/Verify:
swag2mcp-mock --versiongo install
go install github.com/mmadfox/swag2mcp/cmd/swag2mcp-mock@latestEnsure $GOPATH/bin is in your $PATH:
export PATH=$PATH:$(go env GOPATH)/binVerify:
swag2mcp-mock --versionBuild from source
git clone https://github.com/mmadfox/swag2mcp.git
cd swag2mcp
go build -o swag2mcp-mock ./cmd/swag2mcp-mock
sudo mv swag2mcp-mock /usr/local/bin/Verify:
swag2mcp-mock --versionDocker
Mount ~/.swag2mcp (or your custom workspace path) to /home/nonroot/.swag2mcp. The entrypoint automatically adjusts file permissions so the container can read your workspace.
docker pull ghcr.io/mmadfox/swag2mcp-mock:latestRun mock server:
docker run --rm -i -v ~/.swag2mcp:/home/nonroot/.swag2mcp ghcr.io/mmadfox/swag2mcp-mock:latestVerify:
docker run --rm -v ~/.swag2mcp:/home/nonroot/.swag2mcp ghcr.io/mmadfox/swag2mcp-mock:latest --versionWindows
Scoop
scoop bucket add mmadfox https://github.com/mmadfox/scoop-bucket
scoop install mmadfox/swag2mcp-mockVerify:
swag2mcp-mock --versionGitHub Release
- Open the latest release page
- Download
swag2mcp-mock_windows_amd64.zip - Extract the ZIP file (right-click → Extract All, or use PowerShell)
- Move
swag2mcp-mock.exetoC:\Windows\System32\
Verify:
swag2mcp-mock --versiongo install
go install github.com/mmadfox/swag2mcp/cmd/swag2mcp-mock@latestVerify:
swag2mcp-mock --versionBuild from source
git clone https://github.com/mmadfox/swag2mcp.git
cd swag2mcp
go build -o swag2mcp-mock.exe ./cmd/swag2mcp-mockVerify:
swag2mcp-mock --versionNext Steps
- Quick Start — get running in 2 minutes
- Mock Server — configure and run the mock server