Unify MCP across clients; remove legacy plugin server
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled

This commit is contained in:
DSS
2025-12-12 14:33:18 -03:00
parent 1d53ec341d
commit ec09a0a662
60 changed files with 3451 additions and 4668 deletions

View File

@@ -10,7 +10,7 @@
"name": "dss-claude-plugin",
"source": "./",
"description": "Design System Server (DSS) integration for Claude Code - Analyze, extract, and generate design system tokens and components",
"version": "1.0.0"
"version": "1.0.2"
}
]
}

View File

@@ -1,6 +1,6 @@
{
"name": "dss-claude-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "Design System Server (DSS) integration for Claude Code - Analyze, extract, and generate design system tokens and components",
"author": {
"name": "overbits",

View File

@@ -20,11 +20,11 @@ Single entry point for all DSS initialization. Handles MCP config, dependencies,
## Full Workflow (15 steps)
1. **Reset** (with --reset) - Clear all DSS data
2. **MCP Config** - Generate `.mcp.json`
2. **MCP Config** - Generate `.claude/mcp.json` (local MCP server)
3. **Dependencies** - Python venv, Node modules, admin-ui build
4. **Environment** - Validate Python, Node, Figma token
5. **Directory Structure** - Create `.dss/` folders
6. **Database** - Initialize SQLite
6. **Storage** - Initialize JSON data directories
7. **Analyze Targets** - admin-ui, storybook stats
8. **Token Structure** - Create base token files
9. **3-Layer Validation** - Core, skins, themes

View File

@@ -22,13 +22,12 @@ Without `--confirm`, runs in dry-run mode showing what would be deleted.
## What This Clears
1. `.dss/data/` - Projects, teams, cache, activity
2. `.dss/dss.db` - SQLite database
3. `admin-ui/css/dss-*.css` - Generated CSS files
4. `admin-ui/src/components/*.stories.js` - Generated stories
5. `admin-ui/src/components/ds-*.js` - Generated components
6. `dss/core_tokens/tokens.json` - Reset to empty
7. `dss-claude-plugin/core/skins/*.json` - Reset to awaiting sync
8. `.dss/logs/` - Clear log files
2. `admin-ui/css/dss-*.css` - Generated CSS files
3. `admin-ui/src/components/*.stories.js` - Generated stories
4. `admin-ui/src/components/ds-*.js` - Generated components
5. `dss/core_tokens/tokens.json` - Reset to empty
6. `dss-claude-plugin/core/skins/*.json` - Reset to awaiting sync
7. `.dss/logs/` - Clear log files
## Instructions for Claude
@@ -59,8 +58,6 @@ DRY RUN MODE - No changes will be made
1. Clearing .dss/data/ structure...
Would run: rm -rf .dss/data/projects/* ...
2. Resetting database...
Would run: rm -f .dss/dss.db
...
DRY RUN COMPLETE

View File

@@ -34,9 +34,9 @@ Manage all DSS development services from a single command.
| Service | Port | Description |
|---------|------|-------------|
| api | 8000 | FastAPI REST server |
| admin-ui | 3456 | Vite dev server |
| storybook | 6006 | Storybook design docs |
| api | 6220 | FastAPI REST server |
| admin-ui | 6221 | Vite dev server |
| storybook | 6226 | Storybook design docs |
## Examples
@@ -71,25 +71,25 @@ When the user runs this command:
3. For `status` action, show a table with service states
4. After `start`, provide clickable URLs:
- API: http://localhost:8000
- admin-ui: http://localhost:3456
- Storybook: http://localhost:6006
- API: http://localhost:6220
- admin-ui: http://localhost:6221
- Storybook: http://localhost:6226
## Service Details
### API Server (port 8000)
### API Server (port 6220)
- FastAPI REST API
- Endpoints: projects, figma, health, config
- Command: `uvicorn apps.api.server:app --reload`
- Command: `uvicorn apps.api.server:app --host 0.0.0.0 --port 6220 --reload`
- Log: `/tmp/dss-api.log`
### Admin UI (port 3456)
### Admin UI (port 6221)
- Preact/Vite development server
- Design system management interface
- Command: `npm run dev`
- Log: `/tmp/dss-admin-ui.log`
### Storybook (port 6006)
### Storybook (port 6226)
- Component documentation
- Token visualization
- Command: `npm run storybook`
@@ -104,6 +104,5 @@ If a service fails to start:
## Related Commands
- `/dss-setup` - Full environment setup
- `/dss-init` - Initialize DSS structure
- `/dss-init` - Full environment setup + initialization
- `/dss-reset` - Reset to clean state

View File

@@ -1,38 +0,0 @@
---
name: dss-setup
description: DEPRECATED - Use /dss-init instead
arguments:
- name: flags
description: Optional flags (--reset, --skip-servers)
required: false
---
# DSS Setup Command (DEPRECATED)
**This command is deprecated. Use `/dss-init` instead.**
The `/dss-init` command now handles everything that `/dss-setup` did:
- MCP configuration
- Dependencies (Python venv, Node modules)
- DSS initialization
- Development servers
## Migration
| Old Command | New Command |
|-------------|-------------|
| `/dss-setup` | `/dss-init` |
| `/dss-setup --reset` | `/dss-init --reset` |
| `/dss-setup --skip-servers` | `/dss-init --skip-servers` |
## Instructions for Claude
When the user runs this command:
1. Inform them that `/dss-setup` is deprecated
2. Run `/dss-init` with the same flags instead
```bash
# Just run dss-init.sh directly
scripts/dss-init.sh [flags]
```

View File

@@ -143,5 +143,6 @@ CONFIGURATION CREATED
- Controls configured
Run: npm run storybook
Access: http://localhost:6006
Access: http://localhost:6226
```
Note: DSS uses `6226` as its default Storybook port, but many target projects still run Storybook on `6006`/`6007`.

View File

@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
CONFIG_DIR = Path.home() / ".dss"
CONFIG_FILE = CONFIG_DIR / "config.json"
DEFAULT_REMOTE_URL = "https://dss.overbits.luz.uy"
DEFAULT_LOCAL_URL = "http://localhost:6006"
DEFAULT_LOCAL_URL = "http://localhost:6220"
class DSSMode(str, Enum):

View File

@@ -105,7 +105,7 @@ def mcp_get_compiler_status() -> str:
# MCP Tool Registry
# This can be imported by dss-mcp-server.py to register the tools
# These tool definitions can be imported by the unified DSS MCP layer if needed.
MCP_TOOLS = {
"dss_get_resolved_context": {

File diff suppressed because it is too large Load Diff

View File

@@ -206,11 +206,13 @@ export default create({
## Server Configuration
DSS Storybook runs on port 6006 by default:
DSS Storybook runs on port `6226` by default:
- Host: 0.0.0.0 (configurable)
- Port: 6006 (configurable)
- Port: 6226 (configurable via `STORYBOOK_PORT`)
- Auto-open: disabled by default
Many target projects still run Storybook on `6006`/`6007`; DSS service discovery can detect those running instances.
## Best Practices
1. **Story Organization**

View File

@@ -1,158 +0,0 @@
#!/usr/bin/env python3
"""Verify that dss-mcp-server.py properly exports Context Compiler tools."""
import sys
from pathlib import Path
# Add the server directory to path
sys.path.insert(0, str(Path(__file__).parent))
# Import the server module
print("=" * 60)
print("CONTEXT COMPILER TOOL VERIFICATION")
print("=" * 60)
# Test imports
print("\n1. Testing Context Compiler imports...")
try:
from core import (
get_active_context,
get_compiler_status,
list_skins,
resolve_token,
validate_manifest,
)
print(" ✓ All Context Compiler functions imported successfully")
CONTEXT_COMPILER_AVAILABLE = True
except ImportError as e:
print(f" ✗ Context Compiler import failed: {e}")
CONTEXT_COMPILER_AVAILABLE = False
sys.exit(1)
# Test the server's tool list
print("\n2. Checking MCP server tool list...")
try:
# We need to simulate the MCP server initialization
# to see what tools it would export
from mcp.server import Server
# Create a test server instance
server = Server("dss-test")
# Import the list_tools function logic
print(" Checking if server exports tools properly...")
# Read the actual server file and check for context_compiler_tools
with open(Path(__file__).parent / "servers" / "dss-mcp-server.py", "r") as f:
server_code = f.read()
if "context_compiler_tools" in server_code:
print(" ✓ context_compiler_tools defined in server")
else:
print(" ✗ context_compiler_tools NOT found in server")
sys.exit(1)
if "dss_get_resolved_context" in server_code:
print(" ✓ dss_get_resolved_context tool defined")
else:
print(" ✗ dss_get_resolved_context NOT found")
sys.exit(1)
if "dss_resolve_token" in server_code:
print(" ✓ dss_resolve_token tool defined")
else:
print(" ✗ dss_resolve_token NOT found")
sys.exit(1)
if "dss_validate_manifest" in server_code:
print(" ✓ dss_validate_manifest tool defined")
else:
print(" ✗ dss_validate_manifest NOT found")
sys.exit(1)
if "dss_list_skins" in server_code:
print(" ✓ dss_list_skins tool defined")
else:
print(" ✗ dss_list_skins NOT found")
sys.exit(1)
if "dss_get_compiler_status" in server_code:
print(" ✓ dss_get_compiler_status tool defined")
else:
print(" ✗ dss_get_compiler_status NOT found")
sys.exit(1)
# Check if tools are returned
if "return dss_tools + devtools_tools + browser_tools + context_compiler_tools" in server_code:
print(" ✓ context_compiler_tools added to tool list return")
else:
print(" ✗ context_compiler_tools NOT added to return statement")
sys.exit(1)
except Exception as e:
print(f" ✗ Error checking server tools: {e}")
sys.exit(1)
# Test tool handlers
print("\n3. Checking MCP server tool handlers...")
try:
with open(Path(__file__).parent / "servers" / "dss-mcp-server.py", "r") as f:
server_code = f.read()
handlers = [
'elif name == "dss_get_resolved_context"',
'elif name == "dss_resolve_token"',
'elif name == "dss_validate_manifest"',
'elif name == "dss_list_skins"',
'elif name == "dss_get_compiler_status"',
]
for handler in handlers:
if handler in server_code:
tool_name = handler.split('"')[1]
print(f"{tool_name} handler implemented")
else:
tool_name = handler.split('"')[1]
print(f"{tool_name} handler NOT found")
sys.exit(1)
except Exception as e:
print(f" ✗ Error checking tool handlers: {e}")
sys.exit(1)
# Test Context Compiler functionality
print("\n4. Testing Context Compiler functionality...")
try:
import json
# Test list_skins
skins_json = list_skins()
skins = json.loads(skins_json)
print(f" ✓ list_skins() returned {len(skins)} skins: {skins}")
# Test get_compiler_status
status_json = get_compiler_status()
status = json.loads(status_json)
print(f" ✓ get_compiler_status() returned status: {status['status']}")
if status["status"] == "active":
print(" ✓ Context Compiler is active and ready")
else:
print(f" ✗ Context Compiler status is: {status['status']}")
sys.exit(1)
except Exception as e:
print(f" ✗ Context Compiler functionality test failed: {e}")
sys.exit(1)
print("\n" + "=" * 60)
print("✅ ALL VERIFICATIONS PASSED")
print("=" * 60)
print("\nContext Compiler tools are properly integrated into dss-mcp-server.py")
print("and should be available to Claude Code after MCP server restart.")
print("\nIf tools are not showing up in Claude Code, try:")
print("1. Fully restart Claude Code (not just /mcp restart)")
print("2. Check Claude Code logs for connection errors")
print("3. Verify MCP server configuration in Claude settings")