Skip to main content
All connectors
qbash Connectors / Grok search

Grok search MCP serverand Python AI tasks

qbash publishes Grok search as a tool on a hosted MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.

Developers use qbash Tasks to write cloud-hosted Python functions that pair Grok search with models such as Claude and GPT.

MCP server

Build a Grok search MCP server

Give ChatGPT, Claude and your other AI tools a Grok search Task as a tool on one server, next to your other connectors and memory folders.

How to set it up

  1. Connect Grok search on the qbash Connectors page.
  2. Save a Grok search Task, then add it to an MCP server.
  3. Paste the server URL into your client. It connects with OAuth or an access token.

Python AI task

Write a Grok search task in Python

A qbash Task is a hosted Python function that calls Grok search and AI models.

Turn recent posts into a cited brief

Ask Grok Search about the last seven days of X posts, then pass its answer and source URLs to an inline prompt that writes a brief.

main.py
today = datetime.now(timezone.utc).date()
report = qbash.integrations.grok_search.model_search(
query="Summarize recent X posts about Python workflow scheduling. Cite sources.",
from_date=(today - timedelta(days=7)).isoformat(),
to_date=today.isoformat(),
)
if report.get("response"):
brief = qbash.ai.run_prompt(
slug="grok-topic-brief",
variables={"answer": report["response"], "sources": json.dumps(report.get("citations", []))},
)
qbash.output(brief)
else:
qbash.output("No answer or cited posts returned for this topic.")
Sample model_search response
{
"response": "Recent posts discuss recurring Python task execution.",
"citations": [
"https://x.com/example/status/123456789"
],
"result_count": 1,
"usage": {
"input_tokens": 200,
"output_tokens": 80
}
}

What the Grok search connector can do

  • Search X posts using Grok AI via the xAI Responses API
See every Grok search method in the SDK Reference

qbash Tasks: AI applications in Python

A Task is a Python function that calls Grok search, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.

AnthropicOpenAIGeminixAI

Run Tasks on a schedule or from your team's tools

OpenAIAnthropicGrokGmailSlackGitHub+ more
  • Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
  • Version controlled Every save is a revision you can compare and roll back.
  • Logged Each run records its inputs, output, errors and what started it.
  • Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.

Grok search MCP questions

Why isn’t Grok search a direct MCP tool?

qbash offers it as a Python method only. A task wraps model_search with the inputs you choose, and each runnable task on an MCP server becomes one tool whose schema comes from those inputs.

Whose xAI account pays for searches?

Yours. The connection uses your xAI API key, and the result’s usage field reports what each search consumed.

How does this compare with the X connector?

The X connector calls the X API and returns raw posts and metrics. Grok search returns Grok’s written answer with citations and needs only an xAI key.

Guides that use Grok search

Build a Grok search task

Write it in Python with AI steps, and qbash hosts it with versions and run logs.

Build a task

Build a Grok search MCP server

Pick the Grok search tools to share and connect ChatGPT, Claude or Grok Bot.

Build an MCP server