Files
dss/tools/dss_mcp/plugins/hello_world.py
Digital Production Factory 276ed71f31 Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm

Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)

Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability

Migration completed: $(date)
🤖 Clean migration with full functionality preserved
2025-12-09 18:45:48 -03:00

99 lines
2.6 KiB
Python

"""
Hello World Plugin - Test Plugin for DSS MCP Server
Simple plugin to validate the plugin loading system is working correctly.
"""
from typing import Dict, Any, List
from mcp import types
PLUGIN_METADATA = {
"name": "Hello World Plugin",
"version": "1.0.0",
"author": "DSS Team",
"description": "Simple test plugin to validate plugin system"
}
TOOLS = [
types.Tool(
name="hello_world",
description="Simple hello world tool to test plugin loading",
inputSchema={
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name to greet",
"default": "World"
}
}
}
),
types.Tool(
name="plugin_status",
description="Get status of the plugin system",
inputSchema={
"type": "object",
"properties": {}
}
)
]
class PluginTools:
"""Handler for hello world plugin tools"""
def __init__(self, **kwargs):
self.call_count = 0
async def execute_tool(self, name: str, arguments: Dict[str, Any]) -> List:
"""Execute tool by name"""
self.call_count += 1
if name == "hello_world":
return await self._hello_world(arguments)
elif name == "plugin_status":
return await self._plugin_status(arguments)
else:
raise ValueError(f"Unknown tool: {name}")
async def _hello_world(self, arguments: Dict[str, Any]) -> List[types.TextContent]:
"""Simple hello world implementation"""
name = arguments.get("name", "World")
message = (
f"Hello, {name}!\n\n"
f"✓ Plugin system is operational\n"
f"✓ Dynamic loading works correctly\n"
f"✓ Tool routing is functional\n"
f"✓ Call count: {self.call_count}"
)
return [
types.TextContent(
type="text",
text=message
)
]
async def _plugin_status(self, arguments: Dict[str, Any]) -> List[types.TextContent]:
"""Return plugin system status"""
status = {
"status": "operational",
"plugin_name": PLUGIN_METADATA["name"],
"plugin_version": PLUGIN_METADATA["version"],
"tools_count": len(TOOLS),
"call_count": self.call_count,
"tools": [tool.name for tool in TOOLS]
}
import json
return [
types.TextContent(
type="text",
text=json.dumps(status, indent=2)
)
]