auto-backup: 2025-12-11 20:35:05 (68 files: +19 ~23 -25)
Generated by DSS Git Backup Hook
This commit is contained in:
@@ -24,15 +24,15 @@ BLUE='\033[0;34m'
|
||||
CYAN='\033[0;36m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Service configuration
|
||||
# Service configuration (DSS Ports: API=6220, Admin=6221, MCP=6222, Storybook=6226)
|
||||
declare -A SERVICES=(
|
||||
["api"]="8000"
|
||||
["admin-ui"]="3456"
|
||||
["storybook"]="6006"
|
||||
["api"]="6220"
|
||||
["admin-ui"]="6221"
|
||||
["storybook"]="6226"
|
||||
)
|
||||
|
||||
declare -A SERVICE_CMDS=(
|
||||
["api"]="uvicorn apps.api.server:app --host 0.0.0.0 --port 8000 --reload"
|
||||
["api"]="uvicorn apps.api.server:app --host 0.0.0.0 --port 6220 --reload"
|
||||
["admin-ui"]="npm run dev"
|
||||
["storybook"]="npm run storybook"
|
||||
)
|
||||
|
||||
70
scripts/setup-mcp.sh
Executable file
70
scripts/setup-mcp.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
# Generate .claude/mcp.json with absolute paths for current setup
|
||||
#
|
||||
# USAGE:
|
||||
# ./scripts/setup-mcp.sh
|
||||
#
|
||||
# This script generates the MCP configuration file needed for Claude Code
|
||||
# to access DSS tools. Run this after cloning or when switching machines.
|
||||
|
||||
set -e
|
||||
|
||||
DSS_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
MCP_CONFIG_DIR="$DSS_ROOT/.claude"
|
||||
MCP_CONFIG="$MCP_CONFIG_DIR/mcp.json"
|
||||
|
||||
# Ensure .claude directory exists
|
||||
mkdir -p "$MCP_CONFIG_DIR"
|
||||
|
||||
# Detect Python venv location
|
||||
if [ -d "$DSS_ROOT/.venv" ]; then
|
||||
PYTHON_PATH="$DSS_ROOT/.venv/bin/python3"
|
||||
elif [ -d "$DSS_ROOT/venv" ]; then
|
||||
PYTHON_PATH="$DSS_ROOT/venv/bin/python3"
|
||||
else
|
||||
echo "Error: No Python virtual environment found at .venv or venv"
|
||||
echo "Create one with: python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify MCP server exists
|
||||
MCP_SERVER="$DSS_ROOT/dss-claude-plugin/servers/dss-mcp-server.py"
|
||||
if [ ! -f "$MCP_SERVER" ]; then
|
||||
echo "Error: MCP server not found at $MCP_SERVER"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat > "$MCP_CONFIG" << EOF
|
||||
{
|
||||
"\$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/mcp-servers.schema.json",
|
||||
"mcpServers": {
|
||||
"dss": {
|
||||
"command": "$PYTHON_PATH",
|
||||
"args": ["$MCP_SERVER"],
|
||||
"env": {
|
||||
"PYTHONPATH": "$DSS_ROOT:$DSS_ROOT/dss-claude-plugin",
|
||||
"DSS_HOME": "$DSS_ROOT/.dss",
|
||||
"DSS_DATABASE": "$DSS_ROOT/.dss/dss.db",
|
||||
"DSS_CACHE": "$DSS_ROOT/.dss/cache",
|
||||
"DSS_BASE_PATH": "$DSS_ROOT"
|
||||
},
|
||||
"description": "Design System Server MCP - local development"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Generated MCP config: $MCP_CONFIG"
|
||||
echo ""
|
||||
echo "Configuration:"
|
||||
echo " DSS_ROOT: $DSS_ROOT"
|
||||
echo " Python: $PYTHON_PATH"
|
||||
echo " MCP Server: $MCP_SERVER"
|
||||
echo ""
|
||||
|
||||
# Optionally install the DSS plugin for commands/skills
|
||||
echo "To install DSS plugin commands (optional):"
|
||||
echo " claude plugin marketplace add $DSS_ROOT/dss-claude-plugin"
|
||||
echo " claude plugin install dss-claude-plugin@dss"
|
||||
echo ""
|
||||
echo "Restart Claude Code to load the DSS MCP server."
|
||||
Reference in New Issue
Block a user