Skip to main content
Glama

grok-mcp

xAI Grok API를 래핑하는 MCP 서버입니다. Claude 및 기타 AI 에이전트가 사고, 계획 및 실시간 검색을 Grok에 위임할 수 있도록 합니다.

빠른 시작

모든 기기에서 Claude Code에 추가하는 한 줄 명령어:

claude mcp add grok -e XAI_API_KEY=your-key -- npx -y @pkwadsy/grok-mcp

console.x.ai에서 xAI API 키가 필요합니다.

대안: 프로젝트 구성

프로젝트의 .mcp.json에 추가:

{
  "mcpServers": {
    "grok": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@pkwadsy/grok-mcp"],
      "env": {
        "XAI_API_KEY": "your-xai-api-key"
      }
    }
  }
}

Related MCP server: grok-search-mcp

도구

ask_grok

선택적 파일 컨텍스트, 웹 검색 및 X/Twitter 검색을 사용하여 Grok에게 질문합니다.

매개변수

유형

필수

설명

prompt

string

Grok을 위한 질문 또는 작업

files

string[]

아니요

컨텍스트에 포함할 파일 (아래 파일 구문 참조)

max_files

number

아니요

최대 파일 수 재정의 (기본값 50)

max_file_size

number

아니요

파일당 최대 크기(KB) 재정의 (기본값 32)

system_prompt

string

아니요

사용자 지정 시스템 프롬프트

model

string

아니요

사용할 모델 (기본값: grok-4.20-multi-agent)

web_search

boolean

아니요

웹 검색, 기본적으로 활성화됨

x_search

boolean

아니요

X/Twitter 검색 활성화

check_files

파일 확인을 위한 드라이 런(Dry-run)입니다. Grok을 호출하지 않고 모든 파일의 유효성을 검사하고 크기를 표시합니다. check_files가 통과하면 ask_grok도 통과합니다.

매개변수

유형

필수

설명

files

string[]

확인할 파일 (ask_grok과 동일한 구문)

max_files

number

아니요

최대 파일 수 재정의 (기본값 50)

max_file_size

number

아니요

파일당 최대 크기(KB) 재정의 (기본값 32)

파일 구문

파일은 다음과 같은 간결한 구문을 사용하여 문자열 배열로 전달됩니다:

구문

설명

"src/index.ts"

전체 파일

"src/index.ts:10-30"

10~30행

"src/index.ts:10"

10행만

"src/**/*.ts"

Glob 패턴

"large-file.ts:force"

파일당 크기 제한 우회

"large-file.ts:1-100:force"

행 범위와 강제 적용 결합

안전 제한

제한

기본값

재정의

호출당 파일 수

50

max_files 매개변수

파일당 크기

32 KB

max_file_size 매개변수 또는 :force 접미사

총 컨텍스트

256 KB

하드 캡, 재정의 불가

사용 가능한 모델

  • grok-4.20-multi-agent — 멀티 에이전트 모드, 아키텍처 및 계획에 적합 (기본값)

  • grok-4.20-reasoning — 플래그십 추론 모델

  • grok-4.20-non-reasoning — 빠름, 추론 없음

  • grok-4.1-fast-reasoning — 더 저렴한 추론 모델

  • grok-4.1-fast-non-reasoning — 가장 저렴하고 빠름

예시

파일 컨텍스트와 함께 질문:

prompt: "Review this code for bugs"
files: ["src/index.ts", "src/utils.ts:20-50"]

웹 검색:

prompt: "What happened in tech news today?"

X/Twitter 검색:

prompt: "What are people saying about the new React release?"
x_search: true

질문 전 파일 확인:

files: ["src/**/*.ts"]

라이선스

MIT

Available Tools

2 tools
ask_grokA

Ask Grok a question. Grok is great for thinking, planning, architecture, and real-time search via web and X/Twitter. Use web_search for current information from the internet. Use x_search to find and analyze posts on X/Twitter. IMPORTANT: Grok has no context about your conversation or codebase. Always include all relevant context directly in the prompt — file contents, error messages, architecture details, constraints, and goals. The more context you provide, the better Grok's response will be. Do not assume Grok knows anything about the current project. Use the files parameter to automatically include file contents with line numbers — this is preferred over pasting code into the prompt. File paths are resolved relative to the server working directory: /app. Responses include a response_id — pass it back as previous_response_id to continue a conversation without resending context.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesThe question or task for Grok. Include all relevant context — constraints, background, and goals — since Grok has no access to your conversation or files. Use the files parameter to attach source code rather than pasting it inline
previous_response_idNoResponse ID from a previous ask_grok call. Continues the conversation — Grok remembers all prior context so you don't need to resend files or repeat background. Not supported by multi-agent model (beta limitation)
filesNoFiles to include in context. Compact syntax: "path/to/file" (whole file), "path/to/file:10-30" (lines 10-30), "path/to/file:10" (just line 10), "src/**/*.ts" (glob pattern), "large-file.ts:force" (bypass per-file size limit). Paths resolve relative to server cwd.
max_filesNoOverride max file count (default 50). Useful when a glob legitimately matches many files
max_file_sizeNoOverride max per-file size in KB (default 32). Applies to all files without :force suffix
system_promptNoCustom system prompt to guide Grok's behavior
modelNoModel to use. Defaults to grok-4.20-multi-agent. Options: grok-4.20-multi-agent, grok-4.20-reasoning, grok-4.20-non-reasoning, grok-4.1-fast-reasoning, grok-4.1-fast-non-reasoning
web_searchNoWeb search is enabled by default. Set to false to disable
x_searchNoEnable X/Twitter search to find and analyze posts

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite no annotations, the description fully discloses behavioral traits: Grok has no context about conversation or codebase, responses include a response_id for continuation, file inclusion syntax, model options, and search defaults. The limitation of previous_response_id in multi-agent mode is also noted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is fairly long but well-organized, using bold for emphasis and clear sections. Every sentence contributes essential information. Could be slightly more concise, but overall efficient for the complexity covered.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 9 parameters and no output schema, the description is comprehensive: covers all input aspects, explains the output (response_id), gives continuation guidance, and addresses the critical context limitation. Complete and actionable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds substantial value: explains the rationale for using files, provides detailed file path syntax, clarifies the purpose of previous_response_id, and describes model options and search behavior. It enriches the parameter meanings significantly beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Ask Grok a question' and outlines what Grok excels at (thinking, planning, architecture, real-time search). It distinguishes from related tools like web_search and x_search, though they are not listed as siblings on this server. The purpose is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly provides when to use this tool vs alternatives: 'Use web_search for current information... Use x_search to find and analyze posts.' Also gives critical usage guidance: include full context, use files parameter, how to continue conversations with previous_response_id. No ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_filesA

Dry-run file resolution. Use this before ask_grok to verify files will resolve correctly and check context size. Uses the same validation as ask_grok — if check_files passes, ask_grok will too. File paths resolve relative to: /app

ParametersJSON Schema
NameRequiredDescriptionDefault
filesYesFiles to check. Same syntax as ask_grok: "path/to/file", "path/to/file:10-30", "src/**/*.ts", "large-file.ts:force"
max_filesNoOverride max file count (default 50)
max_file_sizeNoOverride max per-file size in KB (default 32)

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the tool is a dry-run (non-destructive), verifies file resolution, checks context size, and states that file paths resolve relative to /app. It doesn't detail error behavior or rate limits, but for a simple check tool this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at three sentences, with the primary purpose front-loaded. Every sentence adds essential information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, no output schema, and a single sibling, the description covers the core functionality and relationship well. It explains validation equivalence and file resolution. It does not describe the return format, but the overall completeness is sufficient for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with detailed descriptions for all three parameters. The description adds an important context note about file paths resolving relative to /app, which is not in the schema. However, this is environmental context rather than parameter semantics, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs a 'dry-run file resolution' and explicitly differentiates it from its sibling 'ask_grok' by positioning it as a preparatory verification step. The verb 'check' and noun 'files' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Use this before ask_grok' and explains that if check_files passes, ask_grok will too. It also notes the same validation logic, giving clear context for when to use this tool versus the alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.4.0
    • First observedask_grok
    • First observedcheck_files

TDQS

A4.4/5.0

Scored across 2 tools

Disambiguation5/5

ask_grok and check_files serve clearly distinct purposes: one is for querying Grok, the other is a dry-run validator for file resolution. No overlap or ambiguity.

Naming Consistency5/5

Both tool names follow a consistent verb_noun pattern (ask_grok, check_files), using underscores and clear verbs.

Tool Count3/5

Only 2 tools feels thin for a server that provides access to Grok, which could benefit from additional tools for conversation management or specialized searches.

Completeness2/5

The tool set lacks basic conversational features like retrieving history or managing context, and the promised web_search/x_search capabilities are not exposed as separate tools, limiting functionality.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers