grok-mcp
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-mcpconsole.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에게 질문합니다.
매개변수 | 유형 | 필수 | 설명 |
| string | 예 | Grok을 위한 질문 또는 작업 |
| string[] | 아니요 | 컨텍스트에 포함할 파일 (아래 파일 구문 참조) |
| number | 아니요 | 최대 파일 수 재정의 (기본값 50) |
| number | 아니요 | 파일당 최대 크기(KB) 재정의 (기본값 32) |
| string | 아니요 | 사용자 지정 시스템 프롬프트 |
| string | 아니요 | 사용할 모델 (기본값: |
| boolean | 아니요 | 웹 검색, 기본적으로 활성화됨 |
| boolean | 아니요 | X/Twitter 검색 활성화 |
check_files
파일 확인을 위한 드라이 런(Dry-run)입니다. Grok을 호출하지 않고 모든 파일의 유효성을 검사하고 크기를 표시합니다. check_files가 통과하면 ask_grok도 통과합니다.
매개변수 | 유형 | 필수 | 설명 |
| string[] | 예 | 확인할 파일 ( |
| number | 아니요 | 최대 파일 수 재정의 (기본값 50) |
| number | 아니요 | 파일당 최대 크기(KB) 재정의 (기본값 32) |
파일 구문
파일은 다음과 같은 간결한 구문을 사용하여 문자열 배열로 전달됩니다:
구문 | 설명 |
| 전체 파일 |
| 10~30행 |
| 10행만 |
| Glob 패턴 |
| 파일당 크기 제한 우회 |
| 행 범위와 강제 적용 결합 |
안전 제한
제한 | 기본값 | 재정의 |
호출당 파일 수 | 50 |
|
파일당 크기 | 32 KB |
|
총 컨텍스트 | 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 toolsask_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.
Inputs: prompt (required), previous_response_id, files, max_files, +5 more.
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
Inputs: files (required), max_files, max_file_size.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
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.
Both tool names follow a consistent verb_noun pattern (ask_grok, check_files), using underscores and clear verbs.
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.
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.
Related MCP Connectors
Hosted X (Twitter) MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Hosted MCP server from TwitterAPI.io that gives AI agents read-only access to Twitter/X data. 12 tools: tweet search with X operators, user profiles, a user's latest tweets, followers and followings, replies, quotes, retweeters, mentions and trends. Connect at https://mcp.twitterapi.io/mcp with a TwitterAPI.io API key or account sign-in; usage is paid per result returned. Separately, TwitterAPI.io also offers x402 pay-per-call HTTP endpoints (tweet search, user info, a user's latest tweets) paid in USDC on Base or Solana with no account or API key; see https://docs.twitterapi.io/x402-pay-per-call. The MCP server itself uses an API key or sign-in.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseAqualityBmaintenanceUse XAI's latest api functionalities with Grok MCP. It supports image understanding and generation, live search, latest models and more.2255MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that enables coding agents to search X/Twitter and the web through the local Grok CLI, providing better search results than default Codex or Claude search without requiring an API key.7MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for xAI Grok API with 19 tools for chat, web and X search, session management, tool chaining, image and video generation, and documentation.2MIT
- AlicenseNot gradedqualityDmaintenanceA single-file MCP server that enhances Claude Desktop with real-time web and X search, multi-tool agent, and image/video generation via xAI's Grok.MIT