mirror of
https://github.com/usestrix/strix.git
synced 2026-11-14 09:01:25 +00:00
feat(mcp): add a one-line Claude Code installer
Ship install-claude-code.sh: a curl|bash installer that provisions the strix CLI (installing uv first if needed) and registers it as a user-scoped MCP server in Claude Code, so a Claude Code subscription drives Strix with no STRIX_LLM or LLM_API_KEY. Fork-only: the script and the README one-liner pin this fork's URL, so they stay off the upstream PR branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
912c773e5e
commit
ea65491cf6
2 changed files with 82 additions and 1 deletions
10
README.md
10
README.md
|
|
@ -354,7 +354,15 @@ Each server's tools are namespaced by `name`, for example `github_list_issues`.
|
|||
|
||||
The reverse of the above: expose Strix's own tools to an MCP client such as Claude Code, Cursor, or Zed. The client supplies the model and the orchestration loop, so this mode needs **no `STRIX_LLM` and no `LLM_API_KEY`** — if you already use Claude Code or another coding agent, Strix rides on that subscription. Strix contributes its sandbox container, the HTTP proxy, the skill packs, and the CVSS-scored reporting tools.
|
||||
|
||||
Register it with Claude Code:
|
||||
**One-line install for Claude Code** (needs Docker and the `claude` CLI already installed):
|
||||
|
||||
```bash
|
||||
curl -LsSf https://raw.githubusercontent.com/IshanKulkarni02/strix-ClaudeCode/feat/mcp-server/install-claude-code.sh | bash
|
||||
```
|
||||
|
||||
That installs the `strix` CLI (installing `uv` first if needed) and registers it as a user-scoped MCP server. Then open Claude Code and ask it to test a target.
|
||||
|
||||
To wire it up manually instead, register it with Claude Code:
|
||||
|
||||
```bash
|
||||
claude mcp add strix -- strix mcp-server
|
||||
|
|
|
|||
73
install-claude-code.sh
Executable file
73
install-claude-code.sh
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# One-line installer: run Strix as an MCP server inside Claude Code.
|
||||
#
|
||||
# curl -LsSf https://raw.githubusercontent.com/IshanKulkarni02/strix-ClaudeCode/feat/mcp-server/install-claude-code.sh | bash
|
||||
#
|
||||
# It installs the `strix` CLI (via uv, installing uv first if needed) and
|
||||
# registers it with Claude Code so the agent can drive Strix's tools. No
|
||||
# STRIX_LLM or LLM_API_KEY is needed: Claude Code supplies the model.
|
||||
#
|
||||
# Requirements the script checks for: Claude Code (`claude`) and Docker.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO="${STRIX_REPO:-github.com/IshanKulkarni02/strix-ClaudeCode}"
|
||||
BRANCH="${STRIX_BRANCH:-feat/mcp-server}"
|
||||
SPEC="git+https://${REPO}@${BRANCH}"
|
||||
|
||||
bold() { printf '\033[1m%s\033[0m\n' "$1"; }
|
||||
info() { printf ' %s\n' "$1"; }
|
||||
warn() { printf '\033[33m!\033[0m %s\n' "$1"; }
|
||||
die() { printf '\033[31m✗\033[0m %s\n' "$1" >&2; exit 1; }
|
||||
|
||||
bold "Strix → Claude Code installer"
|
||||
|
||||
# 1. Claude Code must be present (it is the model + orchestration loop).
|
||||
if ! command -v claude >/dev/null 2>&1; then
|
||||
die "Claude Code not found. Install it first: https://claude.com/claude-code"
|
||||
fi
|
||||
info "Claude Code: $(command -v claude)"
|
||||
|
||||
# 2. uv: install if missing, then make sure its bin dir is on PATH now.
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
if ! command -v uv >/dev/null 2>&1; then
|
||||
info "Installing uv (Python package manager)…"
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
# shellcheck disable=SC1090
|
||||
[ -f "$HOME/.local/bin/env" ] && . "$HOME/.local/bin/env"
|
||||
fi
|
||||
command -v uv >/dev/null 2>&1 || die "uv install failed; see https://docs.astral.sh/uv/"
|
||||
info "uv: $(command -v uv)"
|
||||
|
||||
# 3. Install the strix CLI from the fork branch as a global tool.
|
||||
info "Installing strix from ${REPO}@${BRANCH} (first run downloads deps)…"
|
||||
uv tool install --force "$SPEC" >/dev/null
|
||||
# Resolve the binary uv just created explicitly — do not trust PATH order, in
|
||||
# case an official strix (e.g. ~/.strix/bin/strix) shadows this one.
|
||||
UV_BIN_DIR="$(uv tool dir --bin 2>/dev/null || echo "$HOME/.local/bin")"
|
||||
STRIX_BIN="$UV_BIN_DIR/strix"
|
||||
[ -x "$STRIX_BIN" ] || die "strix was not installed at $STRIX_BIN"
|
||||
info "strix: $STRIX_BIN"
|
||||
|
||||
# 4. Register the MCP server with Claude Code (user scope = all projects).
|
||||
# Use the absolute path so it resolves regardless of the shell's PATH.
|
||||
claude mcp remove strix -s user >/dev/null 2>&1 || true
|
||||
claude mcp add strix -s user -- "$STRIX_BIN" mcp-server
|
||||
info "Registered 'strix' as an MCP server (user scope)."
|
||||
|
||||
# 5. Docker is needed for the sandbox; warn but don't fail if it is down.
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
if docker info >/dev/null 2>&1; then
|
||||
info "Docker: running."
|
||||
else
|
||||
warn "Docker is installed but not running — start it before the first scan."
|
||||
fi
|
||||
else
|
||||
warn "Docker not found — install and start Docker Desktop before the first scan."
|
||||
fi
|
||||
|
||||
printf '\n'
|
||||
bold "Done."
|
||||
info "Open Claude Code and ask, e.g.: \"use strix to test https://example.com\""
|
||||
info "The sandbox container is pulled automatically on the first tool call."
|
||||
Loading…
Add table
Reference in a new issue