How to Use the PurpleAir MCP in Claude Code
Query PurpleAir particulate data directly from Claude Code and pipe real-time pollution metrics into your terminal workflows.
Works with every AI agent you already use
…and any MCP-compatible client
Connect PurpleAir MCP to Claude Code
Create your Vinkius account to connect PurpleAir to Claude Code — we handle the hosting, security, and runtime updates so you don't have to. No server setup required.
Key Capabilities
Pipe real-time PM2.5 metrics into terminal scripts
Claude Code lets you query global PurpleAir air quality without leaving your shell. Use `get_pm25_sensors` to pull active particulate measurements, then pipe the JSON output directly into standard terminal utilities or Claude Code scripts. Your agent can run queries like `get_sensor_data` to check a specific PurpleAir monitor's current PM2.5 and VOC levels. It outputs clean, parseable text to Claude Code that is ready for automated cron jobs or server monitoring alerts.
Export historical pollution data via Claude Code
Download massive environmental datasets directly to your local machine using Claude Code's terminal interface. Claude Code calls `get_sensor_history_csv` to retrieve time-series logs for specific PurpleAir sensors, saving the output as flat files for quick shell processing. For programmatic analysis, your agent uses `get_sensor_history` to pull structured PurpleAir JSON data. You can specify precise Unix timestamps in Claude Code to isolate wildfire smoke events or seasonal pollution trends.
Query geographic sensor grids using this MCP Server
Find localized PurpleAir monitors using coordinate bounding boxes inside your shell. Claude Code calls `get_sensors_by_bounding_box` to scan specific latitudes and longitudes, returning a list of active PurpleAir hardware and their current PM2.5 readings. This MCP Server lets you target specific hardware using `get_indoor_sensors` or `get_outdoor_sensors` directly inside Claude Code. If you need the closest active monitor, the agent triggers `get_sensors_near_me` using your local coordinates to find active PurpleAir sensors.
Set up PurpleAir MCP in Claude Code
Prerequisites
- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code) - Active Vinkius subscription with a valid endpoint token
- 1
Run the add command
Open your terminal and run the command shown on the right. Replace
[YOUR_TOKEN_HERE]with your endpoint token from cloud.vinkius.com. Use--scope userto make it available across all projects. - 2
Verify the connection
Start a Claude Code session and type
/mcpto list connected servers. You should seepurpleair-mcpwith a green status indicator. - 3
Start using tools
Ask Claude Code something like "Check my latest PurpleAir transactions." It will automatically discover and invoke the available PurpleAir tools.
claude mcp add --transport http purpleair-mcp https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about PurpleAir MCP in Claude Code
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the PurpleAir MCP today
We host it, we monitor it, we maintain it. You just paste one token.