Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ External LLM → sequentialthinking tool → ThoughtProcessor → WorkflowExecut
### Configuration & Data Flow

**Environment Variables:**
- `LLM_PROVIDER`: Provider selection (deepseek, groq, openrouter, ollama, github, anthropic)
- `{PROVIDER}_API_KEY`: API keys (e.g., `DEEPSEEK_API_KEY`, `GITHUB_TOKEN`)
- `LLM_PROVIDER`: Provider selection (deepseek, groq, openrouter, ollama, github, anthropic, claude-agent-sdk)
- `{PROVIDER}_API_KEY`: API keys (e.g., `DEEPSEEK_API_KEY`, `GITHUB_TOKEN`) - **Not required for claude-agent-sdk**
- `{PROVIDER}_ENHANCED_MODEL_ID`: Enhanced model for complex synthesis (Blue Hat)
- `{PROVIDER}_STANDARD_MODEL_ID`: Standard model for individual hat processing
- `EXA_API_KEY`: Research capabilities (if using research agents)
Expand Down Expand Up @@ -122,6 +122,13 @@ External LLM → sequentialthinking tool → ThoughtProcessor → WorkflowExecut

**Examples:**
```bash
# Claude Agent SDK (uses local Claude Code - no API key needed!)
LLM_PROVIDER="claude-agent-sdk"
# No API key required - uses locally installed Claude Code
# Model IDs are informational - Claude Code uses its internal models
CLAUDE_AGENT_SDK_ENHANCED_MODEL_ID="claude-sonnet-4-5" # Both synthesis and processing
CLAUDE_AGENT_SDK_STANDARD_MODEL_ID="claude-sonnet-4-5"

# GitHub Models
GITHUB_ENHANCED_MODEL_ID="openai/gpt-5" # Blue Hat synthesis
GITHUB_STANDARD_MODEL_ID="openai/gpt-5-min" # Individual hats
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Research is **optional** - requires `EXA_API_KEY` environment variable. The syst
- **AI Selection**: System automatically chooses the right model based on task complexity

### Supported Providers:
- **Claude Agent SDK** - Use local Claude Code (no API key required!)
- **DeepSeek** (default) - High performance, cost-effective
- **Groq** - Ultra-fast inference
- **OpenRouter** - Access to multiple models
Expand Down Expand Up @@ -339,9 +340,12 @@ Create a `.env` file or set these variables:

```bash
# LLM Provider (required)
LLM_PROVIDER="deepseek" # deepseek, groq, openrouter, github, anthropic, ollama
LLM_PROVIDER="deepseek" # deepseek, groq, openrouter, github, anthropic, ollama, claude-agent-sdk
DEEPSEEK_API_KEY="sk-..."

# Or use Claude Agent SDK (no API key needed!)
# LLM_PROVIDER="claude-agent-sdk" # Requires Claude Code installed locally

# Optional: Enhanced/Standard Model Selection
# DEEPSEEK_ENHANCED_MODEL_ID="deepseek-chat" # For synthesis
# DEEPSEEK_STANDARD_MODEL_ID="deepseek-chat" # For other agents
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies = [
"openrouter",
"httpx[socks]>=0.28.1",
"sqlalchemy",
"claude-agent-sdk",
]

[project.optional-dependencies]
Expand Down
43 changes: 39 additions & 4 deletions src/mcp_server_mas_sequential_thinking/config/modernized_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
from agno.models.openai import OpenAIChat
from agno.models.openrouter import OpenRouter

from mcp_server_mas_sequential_thinking.models.claude_agent_sdk import (
ClaudeAgentSDKModel,
)


class GitHubOpenAI(OpenAIChat):
"""OpenAI provider configured for GitHub Models API with enhanced validation."""
Expand Down Expand Up @@ -83,7 +87,7 @@ def _validate_github_token(token: str) -> None:
"use a real GitHub token."
)

def __init__(self, **kwargs: Any) -> None:
def __init__(self, **kwargs: Any) -> None: # noqa: ANN401
# Set GitHub Models configuration
kwargs.setdefault("base_url", "https://models.github.ai/inference")

Expand Down Expand Up @@ -117,7 +121,8 @@ def create_enhanced_model(self) -> Model:
if self.provider_class == Claude:
return self.provider_class(
id=self.enhanced_model_id,
# Note: cache_system_prompt removed - not available in current Agno version
# Note: cache_system_prompt removed - not available in
# current Agno version
)
return self.provider_class(id=self.enhanced_model_id)

Expand All @@ -127,7 +132,8 @@ def create_standard_model(self) -> Model:
if self.provider_class == Claude:
return self.provider_class(
id=self.standard_model_id,
# Note: cache_system_prompt removed - not available in current Agno version
# Note: cache_system_prompt removed - not available in
# current Agno version
)
return self.provider_class(id=self.standard_model_id)

Expand Down Expand Up @@ -289,6 +295,34 @@ def api_key_name(self) -> str:
return "ANTHROPIC_API_KEY"


class ClaudeAgentSDKStrategy(BaseProviderStrategy):
"""Claude Agent SDK provider strategy (uses local Claude Code).

This provider uses the Claude Agent SDK to communicate with locally installed
Claude Code, eliminating the need for API keys and enabling the use of
Claude Code's capabilities within the Multi-Thinking framework.
"""

@property
def provider_class(self) -> type[Model]:
return ClaudeAgentSDKModel

@property
def default_enhanced_model(self) -> str:
# Claude Code uses internal models, but we specify sonnet as default
return "claude-sonnet-4-5"

@property
def default_standard_model(self) -> str:
# Both enhanced and standard use the same model in Claude Code
return "claude-sonnet-4-5"

@property
def api_key_name(self) -> str | None:
# Claude Agent SDK doesn't require API keys - uses local Claude Code
return None


class ConfigurationManager:
"""Manages configuration strategies with dependency injection."""

Expand All @@ -300,6 +334,7 @@ def __init__(self) -> None:
"ollama": OllamaStrategy(),
"github": GitHubStrategy(),
"anthropic": AnthropicStrategy(),
"claude-agent-sdk": ClaudeAgentSDKStrategy(),
}
self._default_strategy = "deepseek"

Expand Down Expand Up @@ -342,7 +377,7 @@ def validate_environment(self, provider_name: str | None = None) -> dict[str, st
exa_key = os.environ.get("EXA_API_KEY")
if not exa_key:
# Don't fail startup - just log warning that research will be disabled
import logging
import logging # noqa: PLC0415

logging.getLogger(__name__).warning(
"EXA_API_KEY not found. Research tools will be disabled."
Expand Down
7 changes: 7 additions & 0 deletions src/mcp_server_mas_sequential_thinking/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Models module for custom model implementations."""

from mcp_server_mas_sequential_thinking.models.claude_agent_sdk import (
ClaudeAgentSDKModel,
)

__all__ = ["ClaudeAgentSDKModel"]
Loading