bootstrap: Gitea-MCP und context7 automatisch einrichten
- gitea-mcp Binary via go install installieren falls fehlend - gitea MCP-Server via `claude mcp add --scope user` registrieren - context7 Plugin-Aktivierung prüfen und bei Fehlen warnen - Wrapper-Skript löst GITEA_ACCESS_TOKEN zur Laufzeit via secret-tool auf - mcpServers-Block aus settings.json entfernt (wird von Claude Code ignoriert) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,8 @@ echo "✓ Agents verlinkt"
|
|||||||
ln -sf "$REPO/dotfiles/CLAUDE.md" ~/.claude/CLAUDE.md
|
ln -sf "$REPO/dotfiles/CLAUDE.md" ~/.claude/CLAUDE.md
|
||||||
ln -sf "$REPO/dotfiles/settings.json" ~/.claude/settings.json
|
ln -sf "$REPO/dotfiles/settings.json" ~/.claude/settings.json
|
||||||
ln -sf "$REPO/dotfiles/statusline-command.sh" ~/.claude/statusline-command.sh
|
ln -sf "$REPO/dotfiles/statusline-command.sh" ~/.claude/statusline-command.sh
|
||||||
|
ln -sf "$REPO/dotfiles/gitea-mcp-wrapper.sh" ~/.claude/gitea-mcp-wrapper.sh
|
||||||
|
chmod +x "$REPO/dotfiles/gitea-mcp-wrapper.sh"
|
||||||
echo "✓ Dotfiles verlinkt"
|
echo "✓ Dotfiles verlinkt"
|
||||||
|
|
||||||
# Hooks ausführbar machen
|
# Hooks ausführbar machen
|
||||||
@@ -55,6 +57,32 @@ else
|
|||||||
echo "✓ ruff installiert"
|
echo "✓ ruff installiert"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --- gitea-mcp Binary ---
|
||||||
|
if [[ -x ~/go/bin/gitea-mcp ]]; then
|
||||||
|
echo "✓ gitea-mcp vorhanden"
|
||||||
|
else
|
||||||
|
echo " gitea-mcp fehlt – installiere via go install..."
|
||||||
|
go install gitea.com/gitea/gitea-mcp@latest
|
||||||
|
echo "✓ gitea-mcp installiert"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- context7 Plugin-Check ---
|
||||||
|
if claude mcp list 2>/dev/null | grep -q "context7"; then
|
||||||
|
echo "✓ context7 Plugin aktiv"
|
||||||
|
else
|
||||||
|
echo "⚠ context7 Plugin nicht aktiv – prüfe enabledPlugins in settings.json"
|
||||||
|
echo " Ggf. Claude Code neu starten oder Plugin manuell aktivieren."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- gitea-mcp in Claude Code registrieren ---
|
||||||
|
if claude mcp list 2>/dev/null | grep -q "^gitea:"; then
|
||||||
|
echo "✓ gitea MCP bereits registriert"
|
||||||
|
else
|
||||||
|
echo " Registriere gitea MCP..."
|
||||||
|
claude mcp add --scope user gitea -- bash ~/.claude/gitea-mcp-wrapper.sh
|
||||||
|
echo "✓ gitea MCP registriert"
|
||||||
|
fi
|
||||||
|
|
||||||
# --- secret-tool + Gitea-Token ---
|
# --- secret-tool + Gitea-Token ---
|
||||||
if ! command -v secret-tool &>/dev/null; then
|
if ! command -v secret-tool &>/dev/null; then
|
||||||
echo " secret-tool fehlt – installiere libsecret-tools..."
|
echo " secret-tool fehlt – installiere libsecret-tools..."
|
||||||
|
|||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
exec env GITEA_ACCESS_TOKEN="$(secret-tool lookup user claude-code token gitea)" \
|
||||||
|
~/go/bin/gitea-mcp -host https://gitea.troeger-net.org
|
||||||
+47
-47
@@ -1,50 +1,50 @@
|
|||||||
{
|
{
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"allow": [
|
"allow": [
|
||||||
"Bash(npm run build:*)",
|
"Bash(npm run build:*)",
|
||||||
"Bash(grep:*)",
|
"Bash(grep:*)",
|
||||||
"Bash(xargs:*)",
|
"Bash(xargs:*)",
|
||||||
"WebSearch",
|
"WebSearch",
|
||||||
"Bash(npm install)",
|
"Bash(npm install)",
|
||||||
"Bash(curl:*)",
|
"Bash(curl:*)",
|
||||||
"Bash(ls:*)",
|
"Bash(ls:*)",
|
||||||
"Bash(python3:*)"
|
"Bash(python3:*)"
|
||||||
],
|
],
|
||||||
"defaultMode": "default"
|
"defaultMode": "default"
|
||||||
},
|
},
|
||||||
"statusLine": {
|
"hooks": {
|
||||||
"type": "command",
|
"PostToolUse": [
|
||||||
"command": "bash ~/.claude/statusline-command.sh"
|
{
|
||||||
},
|
"matcher": "Edit|Write",
|
||||||
"enabledPlugins": {
|
"hooks": [
|
||||||
"typescript-lsp@claude-plugins-official": true,
|
{
|
||||||
"frontend-design@claude-plugins-official": true,
|
"type": "command",
|
||||||
"context7@claude-plugins-official": true,
|
"command": "bash /mnt/projekte/claude-workflow/hooks/auto-format.sh"
|
||||||
"code-review@claude-plugins-official": true,
|
}
|
||||||
"code-simplifier@claude-plugins-official": true
|
|
||||||
},
|
|
||||||
"language": "German",
|
|
||||||
"hooks": {
|
|
||||||
"PostToolUse": [
|
|
||||||
{
|
|
||||||
"matcher": "Edit|Write",
|
|
||||||
"hooks": [
|
|
||||||
{
|
|
||||||
"type": "command",
|
|
||||||
"command": "bash /mnt/projekte/claude-workflow/hooks/auto-format.sh"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Stop": [
|
|
||||||
{
|
|
||||||
"hooks": [
|
|
||||||
{
|
|
||||||
"type": "command",
|
|
||||||
"command": "bash /mnt/projekte/claude-workflow/hooks/verify-on-stop.sh"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "bash /mnt/projekte/claude-workflow/hooks/verify-on-stop.sh"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"statusLine": {
|
||||||
|
"type": "command",
|
||||||
|
"command": "bash ~/.claude/statusline-command.sh"
|
||||||
|
},
|
||||||
|
"enabledPlugins": {
|
||||||
|
"typescript-lsp@claude-plugins-official": true,
|
||||||
|
"frontend-design@claude-plugins-official": true,
|
||||||
|
"context7@claude-plugins-official": true,
|
||||||
|
"code-review@claude-plugins-official": true,
|
||||||
|
"code-simplifier@claude-plugins-official": true
|
||||||
|
},
|
||||||
|
"language": "German"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user