Skip to main content

MCP Bridge for Claude Code with Multi-Model Support. Install globally: claude mcp add --scope user stravinsky -- uvx stravinsky. Add to CLAUDE.md: See https://pypi.org/project/stravinsky/

Project description

Stravinsky Logo

Stravinsky

The Avant-Garde MCP Bridge for Claude Code

Movement โ€ข Rhythm โ€ข Precision


What is Stravinsky?

Multi-model AI orchestration with OAuth authentication for Claude Code.

Features

  • ๐Ÿ” OAuth Authentication - Secure browser-based auth for Google (Gemini) and OpenAI (ChatGPT)
  • ๐Ÿค– Multi-Model Support - Seamlessly invoke Gemini and GPT models from Claude
  • ๐ŸŽฏ Native Subagent Orchestration - Auto-delegating orchestrator with parallel execution (zero CLI overhead)
  • ๐Ÿ› ๏ธ 38 MCP Tools - Model invocation, code search, semantic search, LSP refactoring, session management, and more
  • ๐Ÿง  9 Specialized Native Agents - Stravinsky (orchestrator), Research Lead, Implementation Lead, Delphi (GPT-5.2 advisor), Dewey (documentation), Explore (code search), Frontend (Gemini 3 Pro High UI/UX), Code Reviewer, Debugger
  • ๐Ÿ”„ Hook-Based Delegation - PreToolUse hooks enforce delegation patterns with hard boundaries (exit code 2)
  • ๐Ÿ“ LSP Integration - Full Language Server Protocol support with persistent servers (35x speedup), code refactoring, and advanced navigation
  • ๐Ÿ” AST-Aware Search - Structural code search and refactoring with ast-grep
  • ๐Ÿง  Semantic Code Search - Natural language queries with local embeddings (ChromaDB + Ollama)
  • โšก Cost-Optimized Routing - Free/cheap agents (explore, dewey) always async, expensive (delphi) only when needed

Quick Start

Installation

From PyPI (Recommended):

# One-shot with uvx - no installation needed!
claude mcp add stravinsky -- uvx stravinsky

# Or install globally first:
uv tool install stravinsky
claude mcp add stravinsky -- stravinsky

From Source (for development):

uv tool install --editable /path/to/stravinsky
claude mcp add stravinsky -- stravinsky

Authentication

# Login to Google (Gemini)
stravinsky-auth login gemini

# Login to OpenAI (ChatGPT Plus/Pro required)
stravinsky-auth login openai

# Check status
stravinsky-auth status

# Logout
stravinsky-auth logout gemini

Slash Commands

Slash commands are discovered from:

  • Project-local: .claude/commands/**/*.md (recursive)
  • User-global: ~/.claude/commands/**/*.md (recursive)

Commands can be organized in subdirectories (e.g., .claude/commands/strav/stravinsky.md).

Native Subagent Architecture

Stravinsky uses native Claude Code subagents (.claude/agents/) with automatic delegation:

How It Works

  1. Auto-Delegation: Claude Code automatically delegates complex tasks to the Stravinsky orchestrator
  2. Hook-Based Control: PreToolUse hooks intercept direct tool calls and enforce delegation patterns
  3. Parallel Execution: Task tool enables true parallel execution of specialist agents
  4. Multi-Model Routing: Specialists use invoke_gemini/openai MCP tools for multi-model access

Agent Types

Agent Model Cost Use For
stravinsky Claude Sonnet 4.5 (32k thinking) Moderate Auto-delegating orchestrator (primary)
explore Gemini 3 Flash (via MCP) Free Code search, always async
dewey Gemini 3 Flash + WebSearch Cheap Documentation research, always async
code-reviewer Claude Sonnet (native) Cheap Quality analysis, always async
debugger Claude Sonnet (native) Medium Root cause (after 2+ failures)
frontend Gemini 3 Pro High (via MCP) Medium ALL visual changes (blocking)
delphi GPT-5.2 Medium (via MCP) Expensive Architecture (after 3+ failures)

Delegation Rules (oh-my-opencode Pattern)

  • Always Async: explore, dewey, code-reviewer (free/cheap)
  • Blocking: debugger (2+ failures), frontend (ALL visual), delphi (3+ failures or architecture)
  • Never Work Alone: Orchestrator blocks Read/Grep/Bash via PreToolUse hooks

ULTRATHINK / ULTRAWORK

  • ULTRATHINK: Engage exhaustive deep reasoning with extended thinking budget (32k tokens)
  • ULTRAWORK: Maximum parallel execution - spawn all async agents immediately

## Tools (38)

| Category         | Tools                                                                              |
| ---------------- | ---------------------------------------------------------------------------------- |
| **Model Invoke** | `invoke_gemini`, `invoke_openai`, `get_system_health`                              |
| **Environment**  | `get_project_context`, `task_spawn`, `task_status`, `task_list`                    |
| **Agents**       | `agent_spawn`, `agent_output`, `agent_cancel`, `agent_list`, `agent_progress`, `agent_retry` |
| **Code Search**  | `ast_grep_search`, `ast_grep_replace`, `grep_search`, `glob_files`                 |
| **Semantic**     | `semantic_search`, `semantic_index`, `semantic_stats`                              |
| **LSP**          | `lsp_diagnostics`, `lsp_hover`, `lsp_goto_definition`, `lsp_find_references`, `lsp_document_symbols`, `lsp_workspace_symbols`, `lsp_prepare_rename`, `lsp_rename`, `lsp_code_actions`, `lsp_code_action_resolve`, `lsp_extract_refactor`, `lsp_servers` (12 tools) |
| **Sessions**     | `session_list`, `session_read`, `session_search`                                   |
| **Skills**       | `skill_list`, `skill_get`                                                          |

### LSP Performance & Refactoring

The Phase 2 update introduced the `LSPManager`, which maintains persistent language server instances:

- **35x Speedup**: Subsequent LSP calls are near-instant because the server no longer needs to re-initialize and re-index the codebase for every request
- **Code Refactoring**: New support for `lsp_extract_refactor` allows automated code extraction (e.g., extracting a method or variable) with full symbol resolution
- **Code Actions**: `lsp_code_action_resolve` enables complex, multi-step refactoring workflows with automatic fixes for diagnostics

### Semantic Code Search

Natural language code search powered by embeddings. Find code by meaning, not just keywords.

**Prerequisites:**

```bash
# Install Ollama (default provider - free, local)
brew install ollama

# Pull the recommended lightweight embedding model (274MB)
ollama pull nomic-embed-text

# Or for better accuracy (670MB, slower):
ollama pull mxbai-embed-large
```

**Recommended model:** `nomic-embed-text` is lightweight (274MB), fast, and works great for code search. It's the best choice for most users, especially on space-constrained systems like MacBooks.

**Usage:**

```python
# Via MCP tools in Claude Code
semantic_index(project_path=".", provider="ollama")  # First-time indexing
semantic_search(query="OAuth authentication logic", n_results=5)
semantic_stats()  # View index statistics
```

**Example queries:**
- "find authentication logic"
- "error handling in API endpoints"
- "database connection pooling"

**Providers:**

| Provider | Model | Size | Cost | Setup |
|----------|-------|------|------|-------|
| `ollama` (default) | nomic-embed-text (recommended) | 274MB | Free/local | `ollama pull nomic-embed-text` |
| `ollama` | mxbai-embed-large (advanced) | 670MB | Free/local | `ollama pull mxbai-embed-large` |
| `gemini` | gemini-embedding-001 | N/A | OAuth/cloud | `stravinsky-auth login gemini` |
| `openai` | text-embedding-3-small | N/A | OAuth/cloud | `stravinsky-auth login openai` |

**Technical details:**
- **AST-aware chunking**: Python files split by functions/classes for better semantic boundaries
- **Persistent storage**: ChromaDB at `~/.stravinsky/vectordb/<project>_<provider>/`
- **Async parallel embeddings**: 10 concurrent for fast indexing

## Native Subagents (9)

Configured in `.claude/agents/*.md`:

| Agent            | Purpose                                                               | Location |
| ---------------- | --------------------------------------------------------------------- | -------- |
| `stravinsky`     | Task orchestration with 32k extended thinking (Sonnet 4.5)            | .claude/agents/stravinsky.md |
| `research-lead`  | Research coordinator - spawns explore/dewey, synthesizes findings (Gemini Flash) | .claude/agents/research-lead.md |
| `implementation-lead` | Implementation coordinator - spawns frontend/debugger/reviewer (Haiku) | .claude/agents/implementation-lead.md |
| `explore`        | Codebase search and structural analysis (Gemini 3 Flash)              | .claude/agents/explore.md |
| `dewey`          | Documentation research and web search (Gemini 3 Flash)                | .claude/agents/dewey.md |
| `code-reviewer`  | Security, quality, and best practice analysis (Claude Sonnet)         | .claude/agents/code-reviewer.md |
| `debugger`       | Root cause analysis and fix strategies (Claude Sonnet)                | .claude/agents/debugger.md |
| `frontend`       | UI/UX implementation with creative generation (Gemini 3 Pro High)     | .claude/agents/frontend.md |
| `delphi`         | Strategic architecture advisor with 32k thinking (GPT-5.2 Medium)     | .claude/agents/delphi.md |

## Development

```bash
# Install in development mode
uv pip install -e .

# Run server
stravinsky
```

## Project Structure

```
stravinsky/
โ”œโ”€โ”€ .claude/                      # Claude Code configuration
โ”‚   โ”œโ”€โ”€ agents/                   # Native subagent configurations (7 agents)
โ”‚   โ”‚   โ”œโ”€โ”€ stravinsky.md         # Orchestrator (auto-delegated)
โ”‚   โ”‚   โ”œโ”€โ”€ explore.md            # Code search specialist
โ”‚   โ”‚   โ”œโ”€โ”€ dewey.md              # Documentation research
โ”‚   โ”‚   โ”œโ”€โ”€ code-reviewer.md      # Quality analysis
โ”‚   โ”‚   โ”œโ”€โ”€ debugger.md           # Root cause analysis
โ”‚   โ”‚   โ”œโ”€โ”€ frontend.md           # UI/UX specialist
โ”‚   โ”‚   โ”œโ”€โ”€ delphi.md             # Strategic advisor (GPT-5.2)
โ”‚   โ”‚   โ””โ”€โ”€ HOOKS.md              # Hook architecture guide
โ”‚   โ”œโ”€โ”€ commands/                 # Slash commands (skills)
โ”‚   โ”‚   โ”œโ”€โ”€ stravinsky.md         # /stravinsky orchestrator
โ”‚   โ”‚   โ”œโ”€โ”€ delphi.md             # /delphi strategic advisor
โ”‚   โ”‚   โ”œโ”€โ”€ dewey.md              # /dewey documentation research
โ”‚   โ”‚   โ”œโ”€โ”€ publish.md            # /publish PyPI release
โ”‚   โ”‚   โ”œโ”€โ”€ review.md             # /review code review
โ”‚   โ”‚   โ”œโ”€โ”€ verify.md             # /verify post-implementation
โ”‚   โ”‚   โ””โ”€โ”€ version.md            # /version diagnostic info
โ”‚   โ”œโ”€โ”€ hooks/                    # Native Claude Code hooks (11 hooks)
โ”‚   โ”‚   โ”œโ”€โ”€ stravinsky_mode.py    # PreToolUse delegation enforcer
โ”‚   โ”‚   โ”œโ”€โ”€ context.py            # UserPromptSubmit context injection
โ”‚   โ”‚   โ”œโ”€โ”€ todo_continuation.py  # UserPromptSubmit todo continuation
โ”‚   โ”‚   โ”œโ”€โ”€ truncator.py          # PostToolUse output truncation
โ”‚   โ”‚   โ”œโ”€โ”€ tool_messaging.py     # PostToolUse user messaging
โ”‚   โ”‚   โ”œโ”€โ”€ edit_recovery.py      # PostToolUse edit backup
โ”‚   โ”‚   โ”œโ”€โ”€ todo_delegation.py    # PostToolUse parallel reminder
โ”‚   โ”‚   โ”œโ”€โ”€ parallel_execution.py # PostToolUse parallel enforcement
โ”‚   โ”‚   โ”œโ”€โ”€ notification_hook.py  # PreToolUse agent spawn notifications
โ”‚   โ”‚   โ”œโ”€โ”€ subagent_stop.py      # PostToolUse agent completion handling
โ”‚   โ”‚   โ””โ”€โ”€ pre_compact.py        # PreCompact context preservation
โ”‚   โ”œโ”€โ”€ skills/                   # Skill library (empty, skills in commands/)
โ”‚   โ”œโ”€โ”€ settings.json             # Hook configuration
โ”‚   โ””โ”€โ”€ HOOKS_INTEGRATION.md      # Hook integration guide
โ”œโ”€โ”€ mcp_bridge/                   # Python MCP server
โ”‚   โ”œโ”€โ”€ server.py                 # MCP server entry point
โ”‚   โ”œโ”€โ”€ server_tools.py           # Tool definitions
โ”‚   โ”œโ”€โ”€ auth/                     # OAuth authentication
โ”‚   โ”‚   โ”œโ”€โ”€ oauth.py              # Google OAuth (Gemini)
โ”‚   โ”‚   โ”œโ”€โ”€ openai_oauth.py       # OpenAI OAuth (ChatGPT)
โ”‚   โ”‚   โ”œโ”€โ”€ token_store.py        # Keyring storage
โ”‚   โ”‚   โ”œโ”€โ”€ token_refresh.py      # Auto-refresh tokens
โ”‚   โ”‚   โ””โ”€โ”€ cli.py                # stravinsky-auth CLI
โ”‚   โ”œโ”€โ”€ tools/                    # MCP tool implementations
โ”‚   โ”‚   โ”œโ”€โ”€ model_invoke.py       # invoke_gemini, invoke_openai
โ”‚   โ”‚   โ”œโ”€โ”€ agent_manager.py      # agent_spawn, agent_output, etc.
โ”‚   โ”‚   โ”œโ”€โ”€ code_search.py        # ast_grep, grep, glob
โ”‚   โ”‚   โ”œโ”€โ”€ semantic_search.py    # semantic_search, semantic_index, semantic_stats
โ”‚   โ”‚   โ”œโ”€โ”€ session_manager.py    # session_list, session_read, etc.
โ”‚   โ”‚   โ”œโ”€โ”€ skill_loader.py       # skill_list, skill_get
โ”‚   โ”‚   โ”œโ”€โ”€ project_context.py    # get_project_context
โ”‚   โ”‚   โ”œโ”€โ”€ lsp/                  # LSP tool implementations
โ”‚   โ”‚   โ””โ”€โ”€ templates.py          # Project templates
โ”‚   โ”œโ”€โ”€ prompts/                  # Agent system prompts (legacy CLI)
โ”‚   โ”‚   โ”œโ”€โ”€ stravinsky.py         # Legacy orchestrator prompt
โ”‚   โ”‚   โ”œโ”€โ”€ delphi.py             # Legacy advisor prompt
โ”‚   โ”‚   โ”œโ”€โ”€ dewey.py              # Legacy research prompt
โ”‚   โ”‚   โ”œโ”€โ”€ explore.py            # Legacy search prompt
โ”‚   โ”‚   โ”œโ”€โ”€ frontend.py           # Legacy UI/UX prompt
โ”‚   โ”‚   โ””โ”€โ”€ multimodal.py         # Multimodal analysis prompt
โ”‚   โ”œโ”€โ”€ hooks/                    # MCP internal hooks (17+ hooks)
โ”‚   โ”‚   โ”œโ”€โ”€ manager.py            # Hook orchestration
โ”‚   โ”‚   โ”œโ”€โ”€ truncator.py          # Output truncation
โ”‚   โ”‚   โ”œโ”€โ”€ parallel_enforcer.py  # Parallel execution
โ”‚   โ”‚   โ”œโ”€โ”€ todo_enforcer.py      # Todo continuation
โ”‚   โ”‚   โ””โ”€โ”€ ...                   # 13+ more optimization hooks
โ”‚   โ”œโ”€โ”€ native_hooks/             # Native Claude Code hooks
โ”‚   โ”‚   โ”œโ”€โ”€ stravinsky_mode.py    # PreToolUse delegation enforcer
โ”‚   โ”‚   โ”œโ”€โ”€ tool_messaging.py     # PostToolUse user messaging
โ”‚   โ”‚   โ”œโ”€โ”€ todo_delegation.py    # TodoWrite parallel reminder
โ”‚   โ”‚   โ”œโ”€โ”€ todo_continuation.py  # UserPromptSubmit todo injection
โ”‚   โ”‚   โ”œโ”€โ”€ context.py            # UserPromptSubmit context
โ”‚   โ”‚   โ”œโ”€โ”€ truncator.py          # PostToolUse truncation
โ”‚   โ”‚   โ””โ”€โ”€ edit_recovery.py      # PostToolUse backup
โ”‚   โ”œโ”€โ”€ cli/                      # CLI utilities
โ”‚   โ”‚   โ””โ”€โ”€ session_report.py     # Session analysis
โ”‚   โ”œโ”€โ”€ config/                   # Configuration
โ”‚   โ”‚   โ””โ”€โ”€ hooks.py              # Hook configuration
โ”‚   โ””โ”€โ”€ utils/                    # Utility functions
โ”œโ”€โ”€ .stravinsky/                  # Agent execution logs (gitignored)
โ”œโ”€โ”€ assets/                       # Logo, images
โ”œโ”€โ”€ docs/                         # Additional documentation
โ”œโ”€โ”€ logs/                         # Application logs
โ”œโ”€โ”€ tests/                        # Test suite
โ”œโ”€โ”€ pyproject.toml                # Build configuration
โ”œโ”€โ”€ uv.lock                       # Dependency lock
โ”œโ”€โ”€ ARCHITECTURE.md               # Architecture guide (oh-my-opencode comparison)
โ”œโ”€โ”€ CLAUDE.md                     # Project instructions
โ”œโ”€โ”€ INSTALL.md                    # Installation guide
โ””โ”€โ”€ README.md                     # This file
```

## Troubleshooting

### OpenAI "Port 1455 in use"

The Codex CLI uses the same port. Stop it with: `killall codex`

### OpenAI Authentication Failed

- Ensure you have a ChatGPT Plus/Pro subscription
- Tokens expire occasionally; run `stravinsky-auth login openai` to refresh

## License

MIT

---

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stravinsky-0.2.74.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stravinsky-0.2.74-py3-none-any.whl (207.5 kB view details)

Uploaded Python 3

File details

Details for the file stravinsky-0.2.74.tar.gz.

File metadata

  • Download URL: stravinsky-0.2.74.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stravinsky-0.2.74.tar.gz
Algorithm Hash digest
SHA256 b7c190bd2cfb7ad1484a46e2691e64fba41112cb416be79fb9108d50c3fc4fe2
MD5 e941e3420a4b28b89e711973c587628d
BLAKE2b-256 d0161f911293e4cc70421956c2be9de67029d523e168b2e577552c5724699e25

See more details on using hashes here.

File details

Details for the file stravinsky-0.2.74-py3-none-any.whl.

File metadata

  • Download URL: stravinsky-0.2.74-py3-none-any.whl
  • Upload date:
  • Size: 207.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stravinsky-0.2.74-py3-none-any.whl
Algorithm Hash digest
SHA256 74a9a377f70b28d3121c9deeeb39c2d5a59f5f07692ce7ec1cb7d812e1b29b22
MD5 e85390c21ba7c94bb67268287cda0374
BLAKE2b-256 0ed3412c8ea9eabdfdc61a04271a11ce57faf4a74bfc84ee969793ab549ed4e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page