mcpField
V
viceroy

viceroy

github.com/fastlyDevelopment3683 installsUpdated 1w ago
Repository

About viceroy

viceroy is Fastly’s local testing environment for developers building Fastly Compute applications. It emulates the platform so WASM services can be run and tested locally, with local backends and stores configured through fastly.toml.

Key features

  1. 01Emulates the Fastly Compute platform
  2. 02Runs and tests WASM services
  3. 03Configures local backends and stores

Use cases

  1. 01Developing Compute applications locally
  2. 02Testing services that call local backends

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fastly/fastly-agent-toolkit --skill viceroy

After installing, type/viceroyin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
fastly-compute-adapt.md
fastly-compute-config.md
fastly-compute-serve.md
fastly-compute-test.md

Details

From the project README

Viceroy — Local Fastly Compute Runtime

Viceroy is Fastly's official local testing environment for Compute applications. It emulates the Fastly Compute platform, allowing you to develop and test WASM services locally.

Viceroy documentation: https://github.com/fastly/Viceroy

Common Gotchas

  • Dictionaries and ConfigStores are both supported but configured differently in fastly.toml. Dictionaries go under [local_server.dictionaries] as inline key-value maps or JSON files. ConfigStores go under [local_server.config_stores].
  • fastly.toml must have a [local_server] section. Without it, Viceroy won't know about your backends, stores, or other local overrides. Every backend your app calls must be listed under [local_server.backends].
  • Default port is 7676, not 5000 (which is Fastlike's default). Access your app at http://127.0.0.1:7676.
  • Backends should point to local servers when developing locally. Avoid proxying to remote production origins to prevent accidentally leaking request data.

Quick Start

# Install Viceroy
cargo install --locked viceroy

# Build your Compute app
fastly compute build

# Start local server (default: 127.0.0.1:7676)
viceroy -C fastly.toml bin/main.wasm

# Or use the Fastly CLI wrapper
fastly compute serve

References

TopicFileUse when...
Servefastly-compute-serve.mdStarting local dev server, profiling, advanced server options
Configfastly-compute-config.mdConfiguring fastly.toml backends, stores, geolocation, device detection, ACLs
Testfastly-compute-test.mdRunning Rust unit tests with cargo-nextest, writing tests for Compute services
Adaptfastly-compute-adapt.mdConverting core WASM modules to Component Model, custom build pipelines

Comments

Markdown supported