# MD_RUN parameter


> Control whether table functions run locally or remotely.

For certain DuckDB **Table Functions**, MotherDuck provides an additional parameter, `MD_RUN`, that gives explicit control over where the query is executed.

This parameter is available to the following functions:

- `read_csv()`
- `read_csv_auto()`
- `read_json()`
- `read_json_auto()`
- `read_parquet()` and its alias `parquet_scan()`

To leverage the `MD_RUN` parameter, you can choose:

- `MD_RUN=LOCAL` executes the function in your local DuckDB environment.
- `MD_RUN=REMOTE` executes the function in MotherDuck-hosted DuckDB runtimes in the cloud.
- `MD_RUN=AUTO` executes remotely all `s3://`, `http://`, `https://`, `s3a://`, `s3n://`, `gcs://`, `gs://`, `r2://`, `azure://`, `az://`, `abfss://`, and `hf://` requests, except those to `localhost`/`127.0.0.1`. This is the default option.

The following is an example of using this parameter to execute the function remotely:

```sql
SELECT *
FROM read_csv(
    'https://raw.githubusercontent.com/duckdb/duckdb-web/main/data/weather.csv',
    MD_RUN = REMOTE
);
```

In this example, `MD_RUN=REMOTE` is redundant because omitting it implies `MD_RUN=AUTO`, and given that this is a non-local `https://` resource, MotherDuck will automatically choose remote execution already.

You can force local execution with `MD_RUN=LOCAL`.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmotherduck-sql-reference%2Fmd-run-parameter%2F&page_title=MD_RUN%20parameter&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
