mcp-grok-websearch
An MCP server that exposes Grok Build CLI's built-in web_search as a standard MCP tool. Any MCP-compatible agent (Codex, Claude Desktop, Cursor, etc.) can use it for real-time web search.
Prerequisites
- Grok Build CLI installed and authenticated:
curl -fsSL https://x.ai/cli/install.sh | bash grok login # OAuth, or set GROK_CODE_XAI_API_KEY below
- uv (for
uvxusage): https://docs.astral.sh/uv/
Usage
Run directly with uvx (no install needed)
uvx mcp-grok-websearch
Configure in an MCP-compatible agent
Add to your agent's MCP config (e.g. ~/.codex/config.json, claude_desktop_config.json, etc.):
{
"mcpServers": {
"websearch": {
"command": "uvx",
"args": ["mcp-grok-websearch"]
}
}
}
If you use an API key instead of grok login:
{
"mcpServers": {
"websearch": {
"command": "uvx",
"args": ["mcp-grok-websearch"],
"env": {
"GROK_CODE_XAI_API_KEY": "xai-..."
}
}
}
}
MCP Tool
web_search
Search the web in real time using Grok's built-in search capability.
| Parameter | Type | Default | Description |
|---|---|---|---|
query |
str |
required | Search query |
max_results |
int |
5 |
Number of results (1–20) |
Returns: Formatted results, each with Title, URL, and Summary, separated by ---.
Example result:
Title: Model Context Protocol – Anthropic
URL: https://modelcontextprotocol.io
Summary: The official site for MCP, the open standard for connecting AI to external tools and data sources.
---
Title: MCP GitHub Repository
URL: https://github.com/modelcontextprotocol
Summary: Source code and SDKs for the Model Context Protocol.
---
Authentication
The server supports two modes, tried in this order:
- API key – set
GROK_CODE_XAI_API_KEY(orXAI_API_KEY) in the environment. - OAuth session – if no key is present, the existing
grok loginsession on the machine is used.
License
MIT
Metadata
Release files for mcp-grok-websearch 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_grok_websearch-0.1.2.tar.gz | 98.7 kB | Without provenance | Details for mcp_grok_websearch-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_grok_websearch-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for mcp_grok_websearch-0.1.2-py3-none-any.whl |
Total release size: 107.7 kB
Release files / mcp_grok_websearch-0.1.2.tar.gz
| Download URL | mcp_grok_websearch-0.1.2.tar.gz |
|---|---|
| Size | 98.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac2f30b70f5150a87b070a1eea6f4f0ea394606b2294bf7ef976cbe5352880b9
|
|
BLAKE2b-256 checksum How to use checksums |
761c51214e385de577ad5a75343373047cdec2b92be1e7f44d601c086f65110c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mcp_grok_websearch-0.1.2-py3-none-any.whl
| Download URL | mcp_grok_websearch-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1578920bb9fc4df16cbc1c50d767555474888b0a0988f5c556d5dd34ccd8dcfd
|
|
BLAKE2b-256 checksum How to use checksums |
3e8c502a123b744c5b3d39fe2aedb5a091dd2440447215ec45039151bf100d17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mcp-grok-websearch 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.