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

opus-advisor-mcp

v1.2.0

Published

MCP server that lets Claude Code (Sonnet/Haiku) consult Opus as a strategic advisor via the CLI

Downloads

39

Readme

opus-advisor-mcp

An MCP server that lets Claude Code consult Opus as a strategic advisor mid-task. Run your session on Sonnet or Haiku, and escalate complex decisions to Claude Opus 4.7 on demand — using your existing Claude Code subscription.

Inspired by Anthropic's Advisor Strategy.

How it works

┌─────────────────────────────────────────────┐
│  Claude Code (Sonnet)                       │
│                                             │
│  "I need to decide on the DB schema..."     │
│        │                                    │
│        ▼                                    │
│  calls consult_opus MCP tool                │
│        │                                    │
└────────┼────────────────────────────────────┘
         │
         ▼
┌─────────────────────────────────────────────┐
│  opus-advisor MCP server                    │
│                                             │
│  1. Reads prior consultation history        │
│  2. Reads requested files from disk         │
│  3. Pipes prompt to: claude -p --model opus │
│  4. Logs advice to advisor-log.md           │
│  5. Returns advice to Sonnet                │
└─────────────────────────────────────────────┘

No API keys needed. The server shells out to the claude CLI, which uses your existing authentication.

Install

npm install -g opus-advisor-mcp

Or clone and build locally:

git clone https://github.com/Divinci-AI/opus-advisor-mcp.git
cd opus-advisor-mcp
npm install
npm run build

Configure

Add to your project's .mcp.json or ~/.claude/.mcp.json:

{
  "mcpServers": {
    "opus-advisor": {
      "command": "opus-advisor",
      "timeout": 180000
    }
  }
}

If installed locally (not globally):

{
  "mcpServers": {
    "opus-advisor": {
      "command": "node",
      "args": ["/path/to/opus-advisor-mcp/dist/index.js"],
      "timeout": 180000
    }
  }
}

Restart Claude Code after adding the config.

Tools

consult_advisor

Consult an AI advisor for strategic advice. Defaults to Opus; override per-call or globally via env var.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | question | string | required | The question or problem you need advice on | | context | string | optional | Additional context, constraints, or background | | files | string[] | optional | File paths (relative to project root) to include as code context | | effort | "low" | "medium" | "high" | "medium" | Reasoning effort level | | include_history | boolean | true | Include prior consultation history for continuity | | model | string | "opus" | Model alias for the Claude Code CLI ("opus", "sonnet", "haiku", or full model ID). Overrides ADVISOR_MODEL env var. |

Example:

{
  "question": "Is this database migration safe under concurrent writes?",
  "files": ["src/db/migration-042.ts", "src/db/schema.ts"],
  "effort": "high",
  "model": "sonnet"
}

read_advisor_log

Read the consultation log from prior calls.

| Parameter | Type | Description | |-----------|------|-------------| | last_n | number | Number of recent consultations to return (omit for all) |

read_advisor_meta

Read structured metadata (latency, token counts, effort levels).

| Parameter | Type | Description | |-----------|------|-------------| | last_n | number | Number of recent entries to return (omit for all) |

clear_advisor_log

Clear the consultation log and metadata to start fresh.

Features

  • No API key required — Uses your existing Claude Code subscription via the claude CLI
  • Per-project logs — Consultation history is stored per project at ~/.opus-advisor/<project>-<hash>/
  • Code-aware context — Pass file paths directly; the server reads and injects them as labeled code blocks
  • Consultation continuity — Prior advice is fed back as context so Opus can build on earlier decisions
  • Token-aware history — History is capped by both entry count (5) and token budget (~6K tokens)
  • Metadata tracking — Latency, token estimates, and effort levels tracked in advisor-meta.jsonl
  • Signal protection — Partial output from killed processes is discarded, not returned as advice
  • Path traversal guard — File reads are validated to stay within the project root

Security

  • Path traversal protection: The files parameter validates that all resolved paths remain within the project root directory. Paths like ../../etc/passwd or absolute paths outside the project are rejected.
  • Binary file filtering: Common binary extensions (images, executables, archives, etc.) are automatically skipped.
  • No shell execution: The server uses spawn with array arguments and pipes the prompt via stdin. No shell interpolation occurs.
  • Local only: The MCP server runs locally via stdio. No network ports are opened.
  • Consultation logs: Stored at ~/.opus-advisor/ in plaintext. These may contain code snippets and questions from your consultations. Do not commit or share these files if they contain sensitive code.

Environment Variables

| Variable | Description | |----------|-------------| | ADVISOR_LOG_DIR | Override the log directory (default: ~/.opus-advisor/<project>-<hash>/) | | ADVISOR_MODEL | Default model for all consultations (default: opus). Accepts any alias the Claude Code CLI recognizes: opus, sonnet, haiku, or a full model ID. Overridden per-call by the model parameter. |

How it compares to Anthropic's Advisor Tool

Anthropic's advisor_20260301 is a server-side API feature where the advisor sees the full conversation transcript within a single API request. This MCP server is a different approach:

| | Anthropic Advisor Tool | opus-advisor-mcp | |---|---|---| | Context sharing | Full transcript (server-side) | Question + files + history (client-side) | | Auth | API key required | Uses existing Claude Code subscription | | Integration | API-level (tools array) | MCP tool (works in Claude Code today) | | Persistence | None | Markdown log + JSONL metadata | | Cost | Billed per-token at Opus rates | Included in subscription |

Requirements

  • Node.js >= 18
  • Claude Code CLI installed and authenticated

License

MIT