QwenClaw v2.0 - Complete Rebuild with ALL 81+ Skills
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "tavily-tools",
|
||||
"version": "2.0.2",
|
||||
"description": "Tavily web search and content extraction MCP with hooks and skills for optimal tool selection.",
|
||||
"author": {
|
||||
"name": "Fatih Akyon"
|
||||
},
|
||||
"homepage": "https://github.com/fcakyon/claude-codex-settings#plugins",
|
||||
"repository": "https://github.com/fcakyon/claude-codex-settings",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"tavily": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "tavily-mcp@latest"],
|
||||
"env": {
|
||||
"TAVILY_API_KEY": "REPLACE_WITH_TAVILY_API_KEY"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
---
|
||||
description: Configure Tavily MCP server credentials
|
||||
---
|
||||
|
||||
# Tavily Tools Setup
|
||||
|
||||
**Source:** [tavily-ai/tavily-mcp](https://github.com/tavily-ai/tavily-mcp)
|
||||
|
||||
Configure the Tavily MCP server with your API key.
|
||||
|
||||
## Step 1: Check Current Status
|
||||
|
||||
Read the MCP configuration from `${CLAUDE_PLUGIN_ROOT}/.mcp.json`.
|
||||
|
||||
Check if Tavily is configured:
|
||||
|
||||
- If `tavily.env.TAVILY_API_KEY` contains `REPLACE_WITH_TAVILY_API_KEY`, it needs configuration
|
||||
- If it contains a value starting with `tvly-`, already configured
|
||||
|
||||
Report status:
|
||||
|
||||
- "Tavily MCP is not configured - needs an API key"
|
||||
- OR "Tavily MCP is already configured"
|
||||
|
||||
## Step 2: Show Setup Guide
|
||||
|
||||
Tell the user:
|
||||
|
||||
```
|
||||
To configure Tavily MCP, you need a Tavily API key.
|
||||
|
||||
Quick steps:
|
||||
1. Go to app.tavily.com and sign in
|
||||
2. Navigate to API Keys
|
||||
3. Create a new API key
|
||||
4. Copy the key (starts with tvly-)
|
||||
|
||||
Free tier: 1,000 searches/month
|
||||
|
||||
Don't need Tavily MCP? Disable it via /mcp command.
|
||||
```
|
||||
|
||||
## Step 3: Ask for Key
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
- question: "Do you have your Tavily API key ready?"
|
||||
- header: "Tavily Key"
|
||||
- options:
|
||||
- label: "Yes, I have it"
|
||||
description: "I have my Tavily API key ready to paste"
|
||||
- label: "No, skip for now"
|
||||
description: "I'll configure it later"
|
||||
|
||||
If user selects "No, skip for now":
|
||||
|
||||
- Tell them they can run `/tavily-tools:setup` again when ready
|
||||
- Remind them they can disable Tavily MCP via `/mcp` if not needed
|
||||
- Exit
|
||||
|
||||
If user selects "Yes" or provides key via "Other":
|
||||
|
||||
- If they provided key in "Other" response, use that
|
||||
- Otherwise, ask them to paste the key
|
||||
|
||||
## Step 4: Validate Key
|
||||
|
||||
Validate the provided key:
|
||||
|
||||
- Must start with `tvly-`
|
||||
- Must be at least 20 characters
|
||||
|
||||
If invalid:
|
||||
|
||||
- Show error: "Invalid key format. Tavily keys start with 'tvly-'"
|
||||
- Ask if they want to try again or skip
|
||||
|
||||
## Step 5: Update Configuration
|
||||
|
||||
1. Read current `${CLAUDE_PLUGIN_ROOT}/.mcp.json`
|
||||
2. Create backup at `${CLAUDE_PLUGIN_ROOT}/.mcp.json.backup`
|
||||
3. Update `tavily.env.TAVILY_API_KEY` value to the actual key
|
||||
4. Write updated configuration back to `${CLAUDE_PLUGIN_ROOT}/.mcp.json`
|
||||
|
||||
## Step 6: Confirm Success
|
||||
|
||||
Tell the user:
|
||||
|
||||
```
|
||||
Tavily MCP configured successfully!
|
||||
|
||||
IMPORTANT: Restart Claude Code for changes to take effect.
|
||||
- Exit Claude Code
|
||||
- Run `claude` again
|
||||
|
||||
To verify after restart, run /mcp and check that 'tavily' server is connected.
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"description": "Web search and Tavily integration hooks",
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "WebFetch",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/webfetch_to_tavily_extract.py"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": "WebSearch",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/websearch_to_tavily_search.py"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": "mcp__tavily__tavily-extract",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/tavily_extract_to_advanced.py"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Intercept mcp__tavily__tavily-extract to upgrade extract_depth and suggest gh CLI for GitHub URLs."""
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
try:
|
||||
data = json.load(sys.stdin)
|
||||
tool_input = data["tool_input"]
|
||||
urls = tool_input.get("urls", [])
|
||||
|
||||
# Always ensure extract_depth="advanced"
|
||||
tool_input["extract_depth"] = "advanced"
|
||||
|
||||
# Check for GitHub URLs and add soft suggestion
|
||||
github_domains = ("github.com", "raw.githubusercontent.com", "gist.github.com")
|
||||
github_urls = [url for url in urls if any(domain in url for domain in github_domains)]
|
||||
|
||||
if github_urls:
|
||||
# Allow but suggest GitHub MCP/gh CLI for next time
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"systemMessage": "Tip: For GitHub URLs, use gh CLI: `gh api repos/{owner}/{repo}/contents/{path} --jq '.content' | base64 -d` for files, `gh pr view` for PRs, `gh issue view` for issues.",
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "PreToolUse",
|
||||
"permissionDecision": "allow",
|
||||
"updatedInput": tool_input,
|
||||
},
|
||||
},
|
||||
separators=(",", ":"),
|
||||
)
|
||||
)
|
||||
sys.exit(0)
|
||||
|
||||
# Allow the call to proceed
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "PreToolUse",
|
||||
"permissionDecision": "allow",
|
||||
"updatedInput": tool_input,
|
||||
}
|
||||
},
|
||||
separators=(",", ":"),
|
||||
)
|
||||
)
|
||||
sys.exit(0)
|
||||
|
||||
except (KeyError, json.JSONDecodeError) as err:
|
||||
print(f"hook-error: {err}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
PreToolUse hook: intercept WebFetch → suggest using tavily-extract instead
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
try:
|
||||
data = json.load(sys.stdin)
|
||||
url = data["tool_input"]["url"]
|
||||
except (KeyError, json.JSONDecodeError) as err:
|
||||
print(f"hook-error: {err}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print(json.dumps({
|
||||
"systemMessage": "WebFetch detected. AI is directed to use Tavily extract instead.",
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "PreToolUse",
|
||||
"permissionDecision": "deny",
|
||||
"permissionDecisionReason": f"Please use mcp__tavily__tavily-extract with urls: ['{url}'] and extract_depth: 'advanced'"
|
||||
}
|
||||
}, separators=(',', ':')))
|
||||
sys.exit(0)
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
PreToolUse hook: intercept WebSearch → suggest using Tavily search instead
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
try:
|
||||
data = json.load(sys.stdin)
|
||||
tool_input = data["tool_input"]
|
||||
query = tool_input["query"]
|
||||
except (KeyError, json.JSONDecodeError) as err:
|
||||
print(f"hook-error: {err}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print(json.dumps({
|
||||
"systemMessage": "WebSearch detected. AI is directed to use Tavily search instead.",
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "PreToolUse",
|
||||
"permissionDecision": "deny",
|
||||
"permissionDecisionReason": f"Please use mcp__tavily__tavily_search with query: '{query}'"
|
||||
}
|
||||
}, separators=(',', ':')))
|
||||
sys.exit(0)
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: setup
|
||||
description: This skill should be used when user encounters "Tavily MCP error", "Tavily API key invalid", "web search not working", "Tavily failed", or needs help configuring Tavily integration.
|
||||
---
|
||||
|
||||
# Tavily Tools Setup
|
||||
|
||||
Run `/tavily-tools:setup` to configure Tavily MCP.
|
||||
|
||||
## Quick Fixes
|
||||
|
||||
- **API key invalid** - Get new key from app.tavily.com (format: `tvly-...`)
|
||||
- **Quota exceeded** - Free tier is 1,000 searches/month
|
||||
- **Connection failed** - Restart Claude Code after config changes
|
||||
|
||||
## Don't Need Tavily?
|
||||
|
||||
Disable via `/mcp` command to prevent errors.
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
name: tavily-usage
|
||||
description: This skill should be used when user asks to "search the web", "fetch content from URL", "extract page content", "use Tavily search", "scrape this website", "get information from this link", or "web search for X".
|
||||
---
|
||||
|
||||
# Tavily Search and Extract
|
||||
|
||||
Use Tavily MCP tools for web search and content retrieval operations.
|
||||
|
||||
## Tool Selection
|
||||
|
||||
### Tavily Search (`mcp__tavily__tavily_search`)
|
||||
|
||||
Use for:
|
||||
|
||||
- Keyword-based searches across the web
|
||||
- Finding relevant pages and content
|
||||
- Quick answer gathering
|
||||
- Multiple result discovery
|
||||
|
||||
**Best for**: Initial research, finding sources, broad queries
|
||||
|
||||
### Tavily Extract (`mcp__tavily__tavily-extract`)
|
||||
|
||||
Use for:
|
||||
|
||||
- Getting detailed content from specific URLs
|
||||
- Deep analysis of page content
|
||||
- Structured data extraction
|
||||
- Following up on search results
|
||||
|
||||
**Best for**: In-depth analysis, specific URL content, detailed information
|
||||
|
||||
## Hook Behavior
|
||||
|
||||
`tavily_extract_to_advanced.py` hook automatically upgrades extract calls to advanced mode for better accuracy when needed.
|
||||
|
||||
## Integration Pattern
|
||||
|
||||
1. Use `mcp__tavily__tavily_search` for discovery phase
|
||||
2. Analyze results to find relevant URLs
|
||||
3. Use `mcp__tavily__tavily-extract` for detailed content on specific URLs
|
||||
4. Process extracted content for user needs
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Tavily MCP requires:
|
||||
|
||||
- `TAVILY_API_KEY` - API key from Tavily (tvly-...)
|
||||
|
||||
Configure in shell before using the plugin.
|
||||
|
||||
## Cost Considerations
|
||||
|
||||
- Search is cheaper than extract
|
||||
- Use search to filter relevant URLs first
|
||||
- Only extract URLs that are likely relevant
|
||||
- Cache results when possible
|
||||
Reference in New Issue
Block a user