npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

marvin-mini

v0.1.5

Published

Minimal MCP server for X/Twitter search via Grok Build CLI.

Downloads

829

Readme

marvin-mini

marvin-mini is a small MCP server that exposes X/Twitter search tools backed by the local Grok Build CLI.

It does not call the xAI API directly. Instead, each MCP tool call spawns a stateless grok -p headless process and relies on the local Grok CLI login.

Repository

Requirements

  • Node.js >= 18.18.0
  • Grok Build CLI installed
  • Grok Build CLI logged in with grok login

Install dependencies:

npm install

Installation

MCP clients can start the server with npx:

npx -y marvin-mini@latest

This command is meant to be launched by an MCP client. If you run it directly in a terminal, marvin-mini prints a short usage message and exits, because stdio MCP servers wait for JSON-RPC messages from a client.

Using marvin-mini@latest also avoids npm resolving a local source checkout named marvin-mini when your current directory is the project repository.

Or install it globally and configure your MCP client to run marvin-mini:

npm install -g marvin-mini@latest

Tools

marvin-mini exposes five MCP tools:

  • x_keyword_search: search X/Twitter posts by keyword, including visible post text, date, author, and link
  • x_semantic_search: search X/Twitter posts by meaning or intent, including visible post text, date, author, and link
  • x_user_search: find an X/Twitter user profile and recent posts, including visible post text and links when available
  • x_user_posts_search: search posts from one X/Twitter user over a date range
  • x_thread_fetch: fetch X/Twitter thread context, including visible post text, dates, authors, links, and replies

Each marvin-mini tool allows Grok to use only the corresponding built-in Grok X tool.

x_thread_fetch accepts optional depth controls:

{
  "post_url": "https://x.com/user/status/123",
  "mode": "summary | balanced | deep",
  "max_posts": 50,
  "timeout_seconds": 300
}

For very long or high-engagement threads, start with summary or balanced, then run parallel x_thread_fetch calls on selected reply or quote URLs.

Parallel Search Strategy

marvin-mini stays stateless and does not create agents internally. For broad searches, let the calling CLI split work across multiple agents or parallel tool calls.

Recommended patterns:

  • Date sharding: for a three-day search, run one x_user_posts_search or x_keyword_search call per day, then merge, dedupe, and sort by time.
  • Tool sharding: run x_user_search, x_keyword_search, and x_semantic_search in parallel, then compare results.
  • Thread sharding: first fetch summary or balanced context, then fetch important reply or quote URLs in parallel.

Example three-day user search:

Agent A: x_user_posts_search(username="elonmusk", from_date="2026-05-30", to_date="2026-05-31")
Agent B: x_user_posts_search(username="elonmusk", from_date="2026-05-31", to_date="2026-06-01")
Agent C: x_user_posts_search(username="elonmusk", from_date="2026-06-01", to_date="2026-06-02")
Main agent: merge, dedupe, sort, summarize, and keep source links

Usage

Run the MCP server over stdio:

npx -y marvin-mini@latest

If the MCP client starts marvin-mini from a non-login shell and cannot find grok, set MARVIN_GROK_BIN to the absolute Grok binary path:

MARVIN_GROK_BIN=/absolute/path/to/grok npx -y marvin-mini@latest

The MCP server process must also have access to the same Grok login state. If a GUI client or service runs with a different HOME, grok may behave as if it is not logged in.

Client Configuration

Codex CLI

codex mcp add marvin-mini -- npx -y marvin-mini@latest

With an explicit Grok binary:

codex mcp add marvin-mini --env MARVIN_GROK_BIN=/absolute/path/to/grok -- npx -y marvin-mini@latest

If Codex reports an MCP startup timeout, use the globally installed command to avoid going through npx on every startup:

npm install -g marvin-mini@latest
command -v marvin-mini
codex mcp remove marvin-mini
codex mcp add marvin-mini -- /absolute/path/from/command-v

If you still want a larger cold-start window, set this in ~/.codex/config.toml:

[mcp_servers.marvin-mini]
startup_timeout_sec = 60

For long thread or multi-day searches, also increase the tool-call timeout:

[mcp_servers.marvin-mini]
tool_timeout_sec = 300

If you also need to set the Grok CLI path explicitly:

codex mcp add marvin-mini --env MARVIN_GROK_BIN=/absolute/path/to/grok -- /absolute/path/from/command-v

Claude Code

Add to ~/.claude/settings.json or project .claude/settings.json:

{
  "mcpServers": {
    "marvin-mini": {
      "command": "node",
      "args": ["/absolute/path/to/marvin-mini/src/index.mjs"],
      "env": {
        "MARVIN_GROK_BIN": "/absolute/path/to/grok"
      }
    }
  }
}

The env block is optional when grok is already on PATH.

After npm publication, you can also use npx in MCP clients that support command arguments:

{
  "mcpServers": {
    "marvin-mini": {
      "command": "npx",
      "args": ["-y", "marvin-mini@latest"],
      "env": {
        "MARVIN_GROK_BIN": "/absolute/path/to/grok"
      }
    }
  }
}

Gemini CLI / Cursor

Use the same stdio MCP shape:

{
  "mcpServers": {
    "marvin-mini": {
      "command": "node",
      "args": ["/absolute/path/to/marvin-mini/src/index.mjs"],
      "env": {
        "MARVIN_GROK_BIN": "/absolute/path/to/grok"
      }
    }
  }
}

Development

npm run check
npm test

npm test uses fake local Grok executables for wrapper tests, so it does not require live X/Twitter searches.