# EPA Envirofacts MCP MCP

> EPA Envirofacts provides direct access to US environmental data from the EPA. Use this MCP to query toxic release inventories, analyze Superfund sites, or track UV index forecasts—hourly and daily—by ZIP code or city/state. Pull official government records on air, water, and waste without complex registration or manual API calls.

## Overview
- **Category:** government-public-data
- **Price:** Free
- **Tags:** environmental-data, uv-index, toxic-release, superfund, public-health, data-query

## Description

This connector pulls a wealth of environmental data straight from the United States Environmental Protection Agency. You can query everything from toxic release inventories to UV index forecasts simply by asking your agent. Need to know how much radiation a specific ZIP code gets over a day? Or maybe you need facility records for an old Superfund site? The MCP handles it, letting you run complex queries against official government databases without ever needing an API key. It's like having the EPA database right inside your chat window. When you connect this to Vinkius, all those environmental datasets become available through one central point, making data exploration simple for anyone—developer, researcher, or safety professional.

## Tools

### graphql_query
Runs complex queries across the entire EPA Envirofacts database using GraphQL syntax.

### rest_query
Queries specific tables within the Envirofacts API, allowing filtering by structure like 'tri.facility'.

### uv_daily_city_state
Retrieves a full day's UV index forecast based on a specified City and State.

### uv_daily_zip
Gets the daily UV index forecast for any given ZIP code.

### uv_hourly_city_state
Provides an hour-by-hour breakdown of the UV index using a City and State location.

### uv_hourly_zip
Retrieves the detailed, hour-by-hour UV index forecast for a specific ZIP code.

## Prompt Examples

**Prompt:** 
```
What is the hourly UV forecast for ZIP code 90210?
```

**Response:** 
```
I've retrieved the hourly UV forecast for Beverly Hills (90210). The index starts at 1 in the morning, peaks at 7 (High) around 1:00 PM, and decreases toward the evening. Would you like the daily summary as well?
```

**Prompt:** 
```
Search the 'sems.envirofacts_site' table for facilities in the city of 'Miami'.
```

**Response:** 
```
Querying the SEMS database... I found several environmental sites in Miami. Notable entries include the 'Miami Drum Services' and 'Munisport Landfill'. Would you like the full details for any of these site IDs?
```

**Prompt:** 
```
Run a GraphQL query to count TRI facilities by state.
```

**Response:** 
```
Executing the GraphQL aggregation... The query returned the facility counts. For example, Texas has 1,542 facilities and California has 1,210. Would you like me to list the counts for all states?
```

## Capabilities

### Get daily UV forecasts
Retrieves the full day's UV index forecast using either a specific ZIP code or City/State location.

### Get hourly UV forecasts
Provides a detailed, hour-by-hour breakdown of the UV index for both ZIP codes and specified metropolitan areas.

### Run complex data aggregations
Allows you to perform cross-table analysis across multiple EPA datasets using GraphQL queries.

### Query specific environmental tables
Searches any table in the Envirofacts database, like facility records or toxic inventories, with custom filters and pagination.

## Use Cases

### Assessing site contamination risks
An environmental consultant needs to check if a potential development site has been flagged in the historical records. They ask their agent, which runs `rest_query` against the Superfund (SEMS) database, and immediately receive a list of relevant facility IDs for review.

### Planning outdoor construction work
A safety manager needs to schedule workers around peak sun exposure. They ask their agent to use `uv_hourly_zip` for the job site's ZIP code, getting a precise timeline showing when UV levels exceed safe limits.

### Writing an academic paper on pollution trends
A data scientist requires total counts of facilities by state from the Toxic Release Inventory (TRI). They execute `graphql_query`, aggregating and counting records across all states to generate a comprehensive report dataset.

### Building real-time safety dashboards
A health professional needs continuous data streams for multiple locations. They connect the MCP via Vinkius, using `uv_daily_city_state` to pull forecasts for an entire metropolitan region into a single dashboard.

## Benefits

- You get detailed UV forecasts for every location type. Use `uv_hourly_zip` or `uv_daily_city_state` to provide precise, time-sensitive safety data.
- Stop writing custom API wrappers. The general `graphql_query` tool lets you run complex aggregations across multiple EPA datasets in one shot.
- The MCP handles the complexity of government databases. Use `rest_query` when you need to search a specific table, like finding all Superfund sites near an address.
- Data is immediately usable. Whether you're tracking toxic releases or just monitoring air quality, the output formats are clean and ready for analysis.
- Save time on repetitive lookups. You don't need separate endpoints for every single data type; this MCP centralizes EPA access.

## How It Works

The bottom line is, your agent handles all the complex API calls so you just get clean, usable data back.

1. Start by asking your agent for specific environmental data. For example, request a daily UV index forecast for a ZIP code.
2. The MCP translates that request into the correct query—like calling `uv_daily_zip` or running a general GraphQL aggregation.
3. Your agent receives and presents the structured results (e.g., a list of facility IDs or an indexed UV chart), ready for you to use.

## Frequently Asked Questions

**How do I get UV index data for a specific ZIP code using uv_hourly_zip?**
You provide your agent with the target ZIP code. It uses `uv_hourly_zip` to fetch the hour-by-hour forecast, giving you a precise timeline of UV levels for that area.

**Can I query facility records using rest_query?**
Yes, `rest_query` lets you search specific tables. You can target fields like the Toxic Release Inventory (TRI) to find environmental records for known sites by filtering on table names.

**What is the difference between graphql_query and rest_query?**
`graphql_query` is for complex data aggregation across multiple related tables. `rest_query` is better when you know exactly which specific table and fields you want to pull from.

**Do I need an API key to use uv_daily_city_state?**
No, the MCP handles connecting to public EPA data. You just talk to your agent; it manages the authentication behind the scenes for you.

**When running complex searches with `rest_query`, how should I handle pagination or limit the records returned?**
You must specify limits and offsets within your query parameters. This prevents over-fetching data and ensures you can retrieve large result sets page by page.

**Using `graphql_query`, can I combine filters, like searching for both 'Superfund' sites and specific contamination types?**
Yes, GraphQL supports complex input objects. You pass multiple criteria (e.g., site ID AND contamination type) as structured arguments to perform precise cross-field filtering.

**When I use `uv_hourly_city_state`, what time zone is the returned UV Index forecast based on?**
The forecasts are provided in standard local time for the specified City and State. Always treat the data as being specific to that region's local clock.

**If I get an error using `rest_query`, how do I check which tables or schemas are available before writing a query?**
The API documentation provides a schema lookup function. Use this resource first to verify the exact table names and field structures for your desired data.

**How can I check the UV Index for a specific location?**
Use the `uv_hourly_zip` or `uv_hourly_city_state` tools. Simply provide a 5-digit US ZIP code or the city name and 2-letter state abbreviation to receive the latest hourly forecast data.

**Can I search for specific facilities in the EPA database?**
Yes! Use the `rest_query` tool. You can specify tables like 'tri.tri_facility' or 'sems.envirofacts_site' and apply filters using operators like 'equals' or 'contains' to find specific sites and their environmental records.

**Does this server support complex data aggregations?**
Absolutely. The `graphql_query` tool allows you to execute custom GraphQL strings to perform advanced data fetching, aggregations, and subqueries across the EPA's DMAP API infrastructure.