Skip to content
Back to skills

Xai

ASecurity

Use for xAI/Grok API capabilities through the lfg xai_grok MCP — text generation, web search, X/Twitter search, image/video generation, and TTS. Load when the user wants Grok-connected xAI tools beyond built-in host tools, or when search_tool should target xai_* MCP tools.

  • 6 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
content-marketingapi

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add islee23520/lfg --skill xai --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Xai?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Xai
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/islee23520-xai/badge)](https://www.skillsdirectory.com/skills/islee23520-xai)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: xai
description: Use for xAI/Grok API capabilities through the lfg xai_grok MCP — text generation, web search, X/Twitter search, image/video generation, and TTS. Load when the user wants Grok-connected xAI tools beyond built-in host tools, or when search_tool should target xai_* MCP tools.
---

# xAI (Grok-connected)

One skill for all **lfg `xai_grok` MCP** tools (`~/.grok/plugins/lfg/mcp-runtimes/xai-grok-mcp`). Use this skill instead of guessing tool names.

## Setup check

1. Run `lfg setup --run` so the plugin ships `xai_grok` and lfg mirrors it into `~/.grok/config.toml` as `[mcp_servers.xai_grok]` (required for the Grok **/mcps** UI). Reload MCP with `r` in `/mcps` or start a new session.
2. Credentials (priority): dedicated `~/.grok/xai-grok-mcp-auth.json` via **`lfg xai auth set-api-key`**, **`lfg xai auth set-oauth`**, or the MCP tools `xai_auth_set_api_key` / `xai_auth_set_oauth`; then `XAI_API_KEY`; then read-only Grok host `~/.grok/auth.json` (host file is never written by xai_grok MCP). Never log tokens or keys.
3. Do not use `/mcps` OAuth authenticate (`i`) for `xai_grok`: Grok only runs that host-managed OAuth flow for HTTP/SSE MCP servers, while `xai_grok` is local stdio. Use `xai_auth_*` tools instead.

## Tool flow (all capabilities)

1. `search_tool` with a specific query, e.g. `"xai web search"`, `"xai x search"`, `"xai image generate"`.
2. Call the qualified MCP tool via `use_tool` using the **exact** schema from step 1 (server is typically `xai_grok`; tool names use underscores: `xai_web_search`, not hyphens).

## Capability router

| User intent | MCP tool | `search_tool` hint |
|-------------|----------|-------------------|
| Draft, rewrite, summarize, reason (no live web) | `xai_generate_text` | `xai generate text` |
| Current web info + citations | `xai_web_search` | `xai web search` |
| X/Twitter posts, handles, real-time social | `xai_x_search` | `xai x search` |
| Still images (Grok Imagine) | `xai_image_generate` | `xai image generate` |
| Video (text/image/reference) | `xai_video_generate` | `xai video generate` |
| Speech / TTS | `xai_tts` | `xai tts` |

Details and example payloads: [references/tools.md](references/tools.md).

## Cross-cutting rules

- **Text vs search:** Use `xai_generate_text` for closed-book generation; use `xai_web_search` or `xai_x_search` when recency or sources matter.
- **X evidence:** Treat posts as leads or primary-source quotes only with relevant account identity; corroborate facts via web/docs before asserting them as settled.
- **Artifacts:** Image/video tools may return URLs, base64, or local paths under `.grok-xai-artifacts` when the schema supports `artifact_dir`.
- **Fallback:** If `xai_grok` is disconnected, say so explicitly; use host-native `web_search` / `x_search` only if the user still wants a fallback.

## Credential safety

Use credentials exposed by the Grok host or MCP server only. Never print, quote, summarize, or store OAuth tokens, refresh tokens, bearer tokens, or API keys.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in content-marketing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.