top of page

Raycast AI Commands for MCP: Fleet Queries Without Opening a Chat Window

  • Writer: MacSmithAI
    MacSmithAI
  • 22 hours ago
  • 6 min read

In the last post we stood up an Intune MCP server on macOS and wired it into Claude Desktop. That covers the deep, conversational use cases — the kind where you're genuinely reasoning through a problem and want an LLM to hold the thread.


But a lot of fleet work isn't that. It's the same five questions fifteen times a day: is this Mac compliant, what's its OS version, when did it last check in. Opening a chat window, waiting for the assistant to spin up, typing a full sentence — that's more ceremony than the question deserves.


Raycast fixes this. Since v1.98 (May 2025), Raycast ships with native MCP support — the same Intune server you configured for Claude Desktop can be called from a keyboard shortcut, a saved AI Command, or a Quick AI query. This post covers how to get it set up and the commands I actually use.


What you need

  • Raycast (latest version — MCP support requires v1.98 or newer)

  • Raycast Pro, or a BYOK setup with an Anthropic/OpenAI/Google API key. MCP tool calls require an AI model that supports extensions, which means Pro or BYOK — the free tier won't cut it here.

  • A working Intune MCP server from the previous post (or any other MCP server you want to drive from Raycast)


If you're on BYOK with your own Anthropic key, the setup is in Raycast Settings → AI → Custom API Keys. Drop your key in, pick a Claude model in the model selector, and you're set — no Pro subscription required, and you're paying metered usage directly to the provider.


Step 1: Install the MCP server in Raycast

Open Raycast and run the Install Server command (just type "install server"). You'll get a form asking for name, command, arguments, and environment variables. If you already have the server running with Claude Desktop, you can reuse that exact config — Raycast's format mirrors it closely.


Pro tip from the Raycast docs: if you copy a standard MCP JSON blob to your clipboard first, the Install Server command will auto-populate the form. Copy this to your clipboard before opening the command:

{
  "mcpServers": {
    "intune": {
      "command": "node",
      "args": ["/Users/yourname/mcp-servers/intune-mcp/dist/index.js"],
      "env": {
        "AZURE_TENANT_ID": "00000000-0000-0000-0000-000000000000",
        "AZURE_CLIENT_ID": "11111111-1111-1111-1111-111111111111",
        "AZURE_CLIENT_SECRET": "your-secret-value-here"
      }
    }
  }
}

A few notes:

  • Only stdio transport is supported for now. Streamable HTTP servers won't work — this matches Claude Desktop's current behavior.

  • Raycast inherits PATH from your default shell at launch. If you install Node via nvm or edit your shell profile after Raycast is open, restart Raycast or the server won't find node. This burns an hour the first time.

  • Secrets live in the JSON file same as with Claude Desktop. You can find the config file via the Manage Servers command → Show Config File in Finder if you'd rather edit it directly.


Once installed, run Manage Servers to verify it's connected. You should see "intune" listed with a green status indicator and the tools it exposes.


Step 2: Test with Quick AI

Before building saved commands, verify the server works from Quick AI. Hit your Raycast hotkey (default ⌥ Space), type a question with an @-mention, and press Tab to trigger AI:

@intune how many macOS devices do we have enrolled?

Raycast will ask for confirmation the first time the server calls a tool. You can approve once, approve always, or deny. I default to "Confirm Always" for read-only tools and leave write operations (like add-devices-to-group) on per-invocation approval. You can reset allowed tools any time from Settings → AI → MCP Servers.


Step 3: Build saved AI Commands

This is where Raycast earns its keep. A saved AI Command is a named, reusable prompt template with its own hotkey and (optionally) dynamic placeholders. Instead of typing the same prompt over and over, you build it once and fire it with a keystroke.

Open Raycast → Create AI Command (or Settings → Extensions → AI Commands → +). The commands below are the ones I reach for constantly.

Command 1: Device lookup by serial

Name: Intune Device LookupPrompt:

Use @intune to look up the device with serial number {selection}.
Return: user, model, OS version, last check-in, compliance state,
and a count of installed apps. Format as a compact bulleted list.

The {selection} dynamic placeholder pulls whatever text you've highlighted in any app. Copy a serial from a Slack message, hit the hotkey, get the full device profile in two seconds. Assign ⌃⌥ D or similar and it becomes muscle memory.

Command 2: Daily compliance check

Name: Morning Fleet StatusPrompt:

Use @intune to give me a fleet health snapshot:
- Total macOS device count
- Count of noncompliant devices
- Count of devices pending restart
- Count of devices that haven't checked in for 14+ days
Keep it to 4 lines. No preamble.

I run this first thing every morning. It's faster than opening a dashboard and the numbers are the ones I actually care about.


Command 3: User device audit

Name: Who Has WhatPrompt:

Use @intune to find all devices enrolled by {argument name="upn" placeholder="user@company.com"}.
For each device, show: model, serial, OS version, last check-in,
and FileVault escrow status. Flag anything concerning.

The {argument} placeholder prompts you for input when the command runs. Useful when you're doing offboarding and need to confirm everything about a departing user's gear in one shot.


Command 4: OS version breakdown

Name: macOS Version AuditPrompt:

Use @intune to break down our macOS fleet by OS version.
Return a simple table: version | device count | percentage.
Highlight any versions that are more than one major release behind current.

Good for the monthly patching conversation with security. The "one major release behind" phrasing keeps Claude from editorializing about every minor point release.


Command 5: App deployment check

Name: App Install StatusPrompt:

Use @intune to find all macOS devices with {argument name="app" placeholder="Google Chrome"} installed.
Show a version summary: which versions are installed and how many devices on each.
Flag any devices on versions more than 2 major releases behind the latest.

When someone asks "did the Chrome update land?" this answers the question properly — not just a yes/no, but the actual distribution.


Dynamic placeholders worth knowing

Raycast's AI Commands support a handful of dynamic placeholders that make these templates feel native:

  • {selection} — the text you've highlighted in the foreground app

  • {clipboard} — whatever's on your clipboard right now

  • {argument name="x" placeholder="..."} — a named input prompted at runtime

  • {date}, {time} — current date/time for timestamped queries

The selection and clipboard placeholders are what turn this from "slightly faster chat" into "actually ergonomic." A serial number in a ticket, an email address in a Slack message, a hostname in a terminal — highlight, hotkey, answer.


Tuning the model for speed

For short fleet queries, the large reasoning models are overkill and noticeably slower. In each AI Command's settings, pick a model that balances speed with tool-use reliability. My current defaults:

  • Short lookups (device by serial, count queries): Claude Haiku 4.5 — fast, competent with tool calls, fine for structured output

  • Multi-step reports (morning status, version audits): Claude Sonnet 4.6 — handles multiple tool calls and summarizes cleanly

  • Anything that needs real reasoning (cross-referencing across tools, spotting patterns): Claude Opus 4.7 — slower but worth it when the question isn't just a lookup

Only models that explicitly support AI Extensions will work with MCP — Raycast marks these in the model selector. If you pick a model without the tag, your @intune mention will silently do nothing.


Security posture

Same caveats as the Claude Desktop setup, plus one Raycast-specific note:

Tool confirmations are per-app. Approving add-devices-to-group in Claude Desktop doesn't carry over to Raycast, and vice versa. That's actually good — it means you can have a lenient posture in one app and a strict one in the other. I keep Raycast strict because it's fired from keystrokes and the margin for an accidental write is thinner.

Don't put the config file in a synced folder. Raycast's MCP config lives in the Raycast Extension support directory and contains your client secret in plaintext. Dropbox, iCloud Drive, and similar sync tools should not be pointed at ~/Library/Application Support, but people occasionally do weird things here — worth a quick check.

BYOK billing is on you. If you're on BYOK rather than Raycast Pro, every tool call burns tokens against your API key. A hotkey that fires a 5-tool-call audit every time you press it can add up if you're absent-minded about it. Nothing crazy, but worth knowing the first time a monthly bill lands.


Where this leaves you

Claude Desktop is for the conversations — the ones where you're working through a decision, iterating on a theory, or wrangling multiple tools together. Raycast is for the reflexes — the ten-second lookups that happen between other tasks.

Once both are set up against the same MCP server, the split starts to feel natural. If I'm starting to type a question and my hand is already on ⌥ Space, it belongs in Raycast. If I'm going to need more than one exchange, it belongs in Claude. That boundary is fuzzy in practice and doesn't need to be precise — what matters is that you have both surfaces available and you're not forcing every question through the wrong one.


Next in this series: wiring the same MCP server into VSCode and the GitHub Copilot chat pane — so fleet context is available right where you're already writing the script that depends on it.

Comments


bottom of page