@symbo.ls/mcp 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/symbols-mcp.js +98 -14
- package/package.json +13 -3
- package/symbols_mcp/skills/AGENT_INSTRUCTIONS.md +37 -29
- package/symbols_mcp/skills/BUILT_IN_COMPONENTS.md +1 -1
- package/symbols_mcp/skills/DEFAULT_COMPONENTS.md +132 -69
- package/symbols_mcp/skills/DEFAULT_DESIGN_SYSTEM.md +168 -140
- package/symbols_mcp/skills/MIGRATE_TO_SYMBOLS.md +256 -236
- package/.claude/settings.local.json +0 -9
- package/generate-mcpb.sh +0 -17
- package/manifest.json +0 -67
- package/publish.sh +0 -58
- package/pyproject.toml +0 -19
- package/server.json +0 -32
- package/symbols-mcp.mcpb +0 -0
- package/symbols_mcp/__init__.py +0 -1
- package/symbols_mcp/server.py +0 -359
- package/uv.lock +0 -826
package/generate-mcpb.sh
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
# Install mcpb CLI if needed
|
|
5
|
-
if ! command -v mcpb &> /dev/null; then
|
|
6
|
-
echo "Installing mcpb..."
|
|
7
|
-
npm install -g @anthropic-ai/mcpb
|
|
8
|
-
fi
|
|
9
|
-
|
|
10
|
-
# Sync version from pyproject.toml into manifest.json
|
|
11
|
-
VERSION=$(grep '^version' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
|
12
|
-
sed -i '' "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" manifest.json
|
|
13
|
-
|
|
14
|
-
# Pack the .mcpb bundle
|
|
15
|
-
mcpb pack
|
|
16
|
-
|
|
17
|
-
echo "Generated symbols-mcp-${VERSION}.mcpb"
|
package/manifest.json
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"manifest_version": "0.3",
|
|
3
|
-
"name": "symbols-mcp",
|
|
4
|
-
"display_name": "Symbols MCP",
|
|
5
|
-
"version": "1.0.5",
|
|
6
|
-
"description": "MCP server for Symbols/DOMQL v3 — documentation search and framework reference",
|
|
7
|
-
"author": {
|
|
8
|
-
"name": "Symbols",
|
|
9
|
-
"url": "https://symbols.so"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/symbo-ls/symbols-mcp.git"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://symbols.so",
|
|
16
|
-
"documentation": "https://github.com/symbo-ls/symbols-mcp",
|
|
17
|
-
"support": "https://github.com/symbo-ls/symbols-mcp/issues",
|
|
18
|
-
"keywords": ["symbols", "domql", "mcp", "design-system", "ai"],
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"server": {
|
|
21
|
-
"type": "node",
|
|
22
|
-
"entry_point": "bin/symbols-mcp.js",
|
|
23
|
-
"mcp_config": {
|
|
24
|
-
"command": "node",
|
|
25
|
-
"args": ["${__dirname}/bin/symbols-mcp.js"]
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"tools": [
|
|
29
|
-
{
|
|
30
|
-
"name": "get_project_rules",
|
|
31
|
-
"description": "Returns mandatory Symbols/DOMQL v3 rules. Call this first before any code generation."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "search_symbols_docs",
|
|
35
|
-
"description": "Search the Symbols documentation knowledge base for relevant information."
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
"prompts": [
|
|
39
|
-
{
|
|
40
|
-
"name": "symbols_component_prompt",
|
|
41
|
-
"description": "Generate a Symbols/DOMQL v3 component",
|
|
42
|
-
"arguments": ["description", "component_name"],
|
|
43
|
-
"text": "Generate a Symbols/DOMQL v3 component with these requirements:\n\nComponent Name: ${arguments.component_name}\nDescription: ${arguments.description}\n\nFollow these strict rules:\n- Use DOMQL v3 syntax ONLY (extends, childExtends, flattened props, onX events)\n- Components are plain objects with named exports: export const ${arguments.component_name} = { ... }\n- Use design-system tokens for spacing (A, B, C), colors, typography\n- NO imports between files — reference components by PascalCase key name\n- All folders flat — no subfolders\n- Include responsive breakpoints (@mobile, @tablet) where appropriate\n- Follow modern UI/UX: visual hierarchy, minimal cognitive load, confident typography\n\nOutput ONLY the JavaScript code."
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "symbols_migration_prompt",
|
|
47
|
-
"description": "Migrate React/Angular/Vue code to Symbols/DOMQL v3",
|
|
48
|
-
"arguments": ["source_framework"],
|
|
49
|
-
"text": "You are migrating ${arguments.source_framework} code to Symbols/DOMQL v3.\n\nKey conversion rules for ${arguments.source_framework}:\n- Components become plain objects (never functions)\n- NO imports between project files\n- All folders are flat — no subfolders\n- Use extends/childExtends (v3 plural, never v2 singular)\n- Flatten all props directly (no props: {} wrapper)\n- Events use onX prefix (no on: {} wrapper)\n- Use design-system tokens for spacing/colors\n- State: state: { key: val } + s.update({ key: newVal })\n- Effects: onRender for mount, onStateUpdate for dependency changes\n- Lists: children: (el, s) => s.items, childrenAs: 'state', childExtends: 'Item'\n\nProvide the ${arguments.source_framework} code to convert and I will output clean DOMQL v3."
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"name": "symbols_project_prompt",
|
|
53
|
-
"description": "Scaffold a complete Symbols project",
|
|
54
|
-
"arguments": ["description"],
|
|
55
|
-
"text": "Create a complete Symbols/DOMQL v3 project:\n\nProject Description: ${arguments.description}\n\nRequired structure (smbls/ folder):\n- index.js (root export)\n- config.js (platform config)\n- vars.js (global constants)\n- dependencies.js (external packages)\n- components/ (PascalCase files, named exports)\n- pages/ (dash-case files, camelCase exports, route mapping in index.js)\n- functions/ (camelCase, called via el.call())\n- designSystem/ (color, spacing, typography, theme, icons)\n- state/ (default exports)\n\nRules:\n- v3 syntax only — extends, childExtends, flattened props, onX events\n- Design tokens for all spacing/colors (padding: 'A', not padding: '16px')\n- Components are plain objects, never functions\n- No imports between project files\n- All folders completely flat\n\nGenerate all files with complete, production-ready code."
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "symbols_review_prompt",
|
|
59
|
-
"description": "Review Symbols/DOMQL code for v3 compliance",
|
|
60
|
-
"arguments": [],
|
|
61
|
-
"text": "Review this Symbols/DOMQL code for v3 compliance and best practices.\n\nCheck for these violations:\n1. v2 syntax: extend→extends, childExtend→childExtends, props:{}, on:{}\n2. Imports between project files (FORBIDDEN)\n3. Function-based components (must be plain objects)\n4. Subfolders (must be flat)\n5. Hardcoded pixels instead of design tokens\n6. Wrong event handler signatures\n7. Default exports for components (should be named)\n\nProvide:\n- Issues found with line references\n- Corrected code for each issue\n- Overall v3 compliance score (1-10)\n- Improvement suggestions\n\nPaste your code below:"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
"compatibility": {
|
|
65
|
-
"platforms": ["darwin", "win32", "linux"]
|
|
66
|
-
}
|
|
67
|
-
}
|
package/publish.sh
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
# Usage: ./publish.sh [patch|minor|major|x.y.z]
|
|
5
|
-
# Stores PyPI token in .pypi_token (gitignored)
|
|
6
|
-
|
|
7
|
-
BUMP=${1:-patch}
|
|
8
|
-
|
|
9
|
-
# Read current version from pyproject.toml
|
|
10
|
-
CURRENT=$(grep '^version' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
|
11
|
-
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
|
|
12
|
-
|
|
13
|
-
case "$BUMP" in
|
|
14
|
-
patch) NEW="$MAJOR.$MINOR.$((PATCH + 1))" ;;
|
|
15
|
-
minor) NEW="$MAJOR.$((MINOR + 1)).0" ;;
|
|
16
|
-
major) NEW="$((MAJOR + 1)).0.0" ;;
|
|
17
|
-
*.*.*) NEW="$BUMP" ;;
|
|
18
|
-
*) echo "Usage: $0 [patch|minor|major|x.y.z]"; exit 1 ;;
|
|
19
|
-
esac
|
|
20
|
-
|
|
21
|
-
echo "Bumping $CURRENT → $NEW"
|
|
22
|
-
|
|
23
|
-
# Update versions
|
|
24
|
-
sed -i '' "s/^version = \"$CURRENT\"/version = \"$NEW\"/" pyproject.toml
|
|
25
|
-
sed -i '' "s/\"version\": \"$CURRENT\"/\"version\": \"$NEW\"/g" server.json
|
|
26
|
-
sed -i '' "s/\"version\": \"$CURRENT\"/\"version\": \"$NEW\"/" package.json
|
|
27
|
-
|
|
28
|
-
# Build Python package
|
|
29
|
-
rm -f dist/symbols_mcp-${CURRENT}*
|
|
30
|
-
uv build
|
|
31
|
-
|
|
32
|
-
# Publish to PyPI
|
|
33
|
-
if [ -f .pypi_token ]; then
|
|
34
|
-
TOKEN=$(cat .pypi_token)
|
|
35
|
-
else
|
|
36
|
-
read -rsp "PyPI token: " TOKEN; echo
|
|
37
|
-
fi
|
|
38
|
-
uv publish --token "$TOKEN"
|
|
39
|
-
|
|
40
|
-
# Publish to npm
|
|
41
|
-
chmod +x bin/symbols-mcp.js
|
|
42
|
-
npm publish --access public
|
|
43
|
-
|
|
44
|
-
# Generate .mcpb bundle
|
|
45
|
-
./generate-mcpb.sh
|
|
46
|
-
|
|
47
|
-
# Publish to MCP registry
|
|
48
|
-
echo "Publishing to MCP registry..."
|
|
49
|
-
mcp-publisher login github
|
|
50
|
-
mcp-publisher publish
|
|
51
|
-
|
|
52
|
-
# Commit, tag and push
|
|
53
|
-
git add pyproject.toml package.json server.json manifest.json
|
|
54
|
-
git commit -m "chore: release v$NEW"
|
|
55
|
-
git tag "v$NEW"
|
|
56
|
-
git push && git push --tags
|
|
57
|
-
|
|
58
|
-
echo "Done! Published symbols-mcp $NEW"
|
package/pyproject.toml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "symbols-mcp"
|
|
3
|
-
version = "1.0.6"
|
|
4
|
-
description = "MCP server for Symbols/DOMQL v3 — documentation search and framework reference"
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.10"
|
|
7
|
-
dependencies = [
|
|
8
|
-
"mcp[cli]>=1.9.0",
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
[project.scripts]
|
|
12
|
-
symbols-mcp = "symbols_mcp.server:main"
|
|
13
|
-
|
|
14
|
-
[tool.hatch.build.targets.wheel]
|
|
15
|
-
packages = ["symbols_mcp"]
|
|
16
|
-
|
|
17
|
-
[build-system]
|
|
18
|
-
requires = ["hatchling"]
|
|
19
|
-
build-backend = "hatchling.build"
|
package/server.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
-
"name": "io.github.symbo-ls/symbols-mcp",
|
|
4
|
-
"version": "1.0.6",
|
|
5
|
-
"title": "Symbols MCP",
|
|
6
|
-
"description": "MCP server for Symbols/DOMQL v3 — documentation search and framework reference",
|
|
7
|
-
"repository": {
|
|
8
|
-
"url": "https://github.com/symbo-ls/symbols-mcp",
|
|
9
|
-
"source": "github"
|
|
10
|
-
},
|
|
11
|
-
"packages": [
|
|
12
|
-
{
|
|
13
|
-
"registryType": "pypi",
|
|
14
|
-
"registryBaseUrl": "https://pypi.org",
|
|
15
|
-
"identifier": "symbols-mcp",
|
|
16
|
-
"version": "1.0.6",
|
|
17
|
-
"runtimeHint": "uvx",
|
|
18
|
-
"transport": {
|
|
19
|
-
"type": "stdio"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"registryType": "npm",
|
|
24
|
-
"identifier": "@symbo.ls/mcp",
|
|
25
|
-
"version": "1.0.6",
|
|
26
|
-
"runtimeHint": "npx",
|
|
27
|
-
"transport": {
|
|
28
|
-
"type": "stdio"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
package/symbols-mcp.mcpb
DELETED
|
Binary file
|
package/symbols_mcp/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Symbols MCP
|
package/symbols_mcp/server.py
DELETED
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Symbols MCP — Documentation search and reference tools for Symbols/DOMQL v3.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import os
|
|
6
|
-
import json
|
|
7
|
-
import logging
|
|
8
|
-
import re
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
from mcp.server.fastmcp import FastMCP
|
|
12
|
-
|
|
13
|
-
# ---------------------------------------------------------------------------
|
|
14
|
-
# Configuration
|
|
15
|
-
# ---------------------------------------------------------------------------
|
|
16
|
-
SKILLS_DIR = os.getenv("SYMBOLS_SKILLS_DIR", str(Path(__file__).resolve().parent / "skills"))
|
|
17
|
-
|
|
18
|
-
logging.basicConfig(level=logging.INFO)
|
|
19
|
-
logger = logging.getLogger("symbols-mcp")
|
|
20
|
-
|
|
21
|
-
# ---------------------------------------------------------------------------
|
|
22
|
-
# MCP Server
|
|
23
|
-
# ---------------------------------------------------------------------------
|
|
24
|
-
mcp = FastMCP(
|
|
25
|
-
"Symbols",
|
|
26
|
-
instructions=(
|
|
27
|
-
"Reference assistant for the Symbols/DOMQL v3 design-system framework. "
|
|
28
|
-
"Searches Symbols documentation, exposes framework rules, and provides "
|
|
29
|
-
"comprehensive syntax and API reference."
|
|
30
|
-
),
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
# ---------------------------------------------------------------------------
|
|
34
|
-
# Helpers
|
|
35
|
-
# ---------------------------------------------------------------------------
|
|
36
|
-
SKILLS_PATH = Path(SKILLS_DIR)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def _read_skill(filename: str) -> str:
|
|
40
|
-
"""Read a skill markdown file from the skills directory."""
|
|
41
|
-
path = SKILLS_PATH / filename
|
|
42
|
-
if path.exists():
|
|
43
|
-
return path.read_text(encoding="utf-8")
|
|
44
|
-
return f"Skill file '{filename}' not found at {path}"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def _load_agent_instructions() -> str:
|
|
48
|
-
"""Load the upfront AI agent instructions from AGENT_INSTRUCTIONS.md."""
|
|
49
|
-
path = SKILLS_PATH / "AGENT_INSTRUCTIONS.md"
|
|
50
|
-
if path.exists():
|
|
51
|
-
return path.read_text(encoding="utf-8")
|
|
52
|
-
return _read_skill("CLAUDE.md")
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
# ---------------------------------------------------------------------------
|
|
56
|
-
# TOOLS
|
|
57
|
-
# ---------------------------------------------------------------------------
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
@mcp.tool()
|
|
61
|
-
def get_project_rules() -> str:
|
|
62
|
-
"""ALWAYS call this first before any generate_* tool.
|
|
63
|
-
|
|
64
|
-
Returns the mandatory Symbols/DOMQL v3 rules that MUST be followed.
|
|
65
|
-
Violations cause silent failures — black page, nothing renders.
|
|
66
|
-
|
|
67
|
-
Call this before: generate_project, generate_component, generate_page,
|
|
68
|
-
convert_to_symbols, or any code generation task.
|
|
69
|
-
"""
|
|
70
|
-
return _load_agent_instructions()
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
@mcp.tool()
|
|
74
|
-
async def search_symbols_docs(
|
|
75
|
-
query: str,
|
|
76
|
-
max_results: int = 3,
|
|
77
|
-
) -> str:
|
|
78
|
-
"""Search the Symbols documentation knowledge base for relevant information.
|
|
79
|
-
|
|
80
|
-
Args:
|
|
81
|
-
query: Natural language search query about Symbols/DOMQL.
|
|
82
|
-
max_results: Maximum number of results to return (1-5).
|
|
83
|
-
"""
|
|
84
|
-
keywords = [w for w in re.split(r"\s+", query.lower()) if len(w) > 2]
|
|
85
|
-
if not keywords:
|
|
86
|
-
keywords = [query.lower()]
|
|
87
|
-
|
|
88
|
-
results = []
|
|
89
|
-
for fname in SKILLS_PATH.glob("*.md"):
|
|
90
|
-
content = fname.read_text(encoding="utf-8")
|
|
91
|
-
content_lower = content.lower()
|
|
92
|
-
if not any(kw in content_lower for kw in keywords):
|
|
93
|
-
continue
|
|
94
|
-
lines = content.split("\n")
|
|
95
|
-
for i, line in enumerate(lines):
|
|
96
|
-
line_lower = line.lower()
|
|
97
|
-
if any(kw in line_lower for kw in keywords):
|
|
98
|
-
start = max(0, i - 2)
|
|
99
|
-
end = min(len(lines), i + 20)
|
|
100
|
-
snippet = "\n".join(lines[start:end])
|
|
101
|
-
results.append({"file": fname.name, "snippet": snippet})
|
|
102
|
-
break
|
|
103
|
-
if len(results) >= max_results:
|
|
104
|
-
break
|
|
105
|
-
|
|
106
|
-
if results:
|
|
107
|
-
return json.dumps(results[:max_results], indent=2)
|
|
108
|
-
return f"No results found for '{query}'. Try a different search term."
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# ---------------------------------------------------------------------------
|
|
112
|
-
# RESOURCES — Expose skills documentation as browsable resources
|
|
113
|
-
# ---------------------------------------------------------------------------
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
@mcp.resource("symbols://skills/domql-v3-reference")
|
|
117
|
-
def get_domql_v3_reference() -> str:
|
|
118
|
-
"""Complete DOMQL v3 syntax reference and rules."""
|
|
119
|
-
return _read_skill("CLAUDE.md")
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
@mcp.resource("symbols://skills/project-structure")
|
|
123
|
-
def get_project_structure() -> str:
|
|
124
|
-
"""Symbols project folder structure and file conventions."""
|
|
125
|
-
return _read_skill("SYMBOLS_LOCAL_INSTRUCTIONS.md")
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
@mcp.resource("symbols://skills/design-direction")
|
|
129
|
-
def get_design_direction() -> str:
|
|
130
|
-
"""Modern UI/UX design direction for generating Symbols interfaces."""
|
|
131
|
-
return _read_skill("DESIGN_DIRECTION.md")
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
@mcp.resource("symbols://skills/migration-guide")
|
|
135
|
-
def get_migration_guide() -> str:
|
|
136
|
-
"""Guide for migrating React/Angular/Vue apps to Symbols/DOMQL v3."""
|
|
137
|
-
return _read_skill("MIGRATE_TO_SYMBOLS.md")
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
@mcp.resource("symbols://skills/v2-to-v3-migration")
|
|
141
|
-
def get_v2_v3_migration() -> str:
|
|
142
|
-
"""DOMQL v2 to v3 migration changes and examples."""
|
|
143
|
-
return _read_skill("DOMQL_v2-v3_MIGRATION.md")
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
@mcp.resource("symbols://skills/quickstart")
|
|
147
|
-
def get_quickstart() -> str:
|
|
148
|
-
"""Symbols CLI setup and usage quickstart guide."""
|
|
149
|
-
return _read_skill("QUICKSTART.md")
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
@mcp.resource("symbols://reference/spacing-tokens")
|
|
153
|
-
def get_spacing_tokens() -> str:
|
|
154
|
-
"""Spacing token reference for the Symbols design system."""
|
|
155
|
-
return """# Symbols Spacing Tokens
|
|
156
|
-
|
|
157
|
-
Ratio-based system (base 16px, ratio 1.618 golden ratio):
|
|
158
|
-
|
|
159
|
-
| Token | ~px | Token | ~px | Token | ~px |
|
|
160
|
-
|-------|------|-------|------|-------|------|
|
|
161
|
-
| X | 3 | A | 16 | D | 67 |
|
|
162
|
-
| Y | 6 | A1 | 20 | E | 109 |
|
|
163
|
-
| Z | 10 | A2 | 22 | F | 177 |
|
|
164
|
-
| Z1 | 12 | B | 26 | | |
|
|
165
|
-
| Z2 | 14 | B1 | 32 | | |
|
|
166
|
-
| | | B2 | 36 | | |
|
|
167
|
-
| | | C | 42 | | |
|
|
168
|
-
| | | C1 | 52 | | |
|
|
169
|
-
| | | C2 | 55 | | |
|
|
170
|
-
|
|
171
|
-
Usage: padding: 'A B', gap: 'C', borderRadius: 'Z', fontSize: 'B1'
|
|
172
|
-
Tokens work with padding, margin, gap, width, height, borderRadius, position, and any spacing property.
|
|
173
|
-
Negative values: margin: '-Y1 -Z2 - auto'
|
|
174
|
-
Math: padding: 'A+V2'
|
|
175
|
-
"""
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
@mcp.resource("symbols://reference/atom-components")
|
|
179
|
-
def get_atom_components() -> str:
|
|
180
|
-
"""Built-in primitive atom components in Symbols."""
|
|
181
|
-
return """# Symbols Atom Components (Primitives)
|
|
182
|
-
|
|
183
|
-
| Atom | HTML Tag | Description |
|
|
184
|
-
|------------|------------|-------------------------------|
|
|
185
|
-
| Text | <span> | Text content |
|
|
186
|
-
| Box | <div> | Generic container |
|
|
187
|
-
| Flex | <div> | Flexbox container |
|
|
188
|
-
| Grid | <div> | CSS Grid container |
|
|
189
|
-
| Link | <a> | Anchor with built-in router |
|
|
190
|
-
| Input | <input> | Form input |
|
|
191
|
-
| Radio | <input> | Radio button |
|
|
192
|
-
| Checkbox | <input> | Checkbox |
|
|
193
|
-
| Svg | <svg> | SVG container |
|
|
194
|
-
| Icon | <svg> | Icon from icon sprite |
|
|
195
|
-
| IconText | <div> | Icon + text combination |
|
|
196
|
-
| Button | <button> | Button with icon/text support |
|
|
197
|
-
| Img | <img> | Image element |
|
|
198
|
-
| Iframe | <iframe> | Embedded frame |
|
|
199
|
-
| Video | <video> | Video element |
|
|
200
|
-
|
|
201
|
-
Usage examples:
|
|
202
|
-
{ Box: { padding: 'A', background: 'surface' } }
|
|
203
|
-
{ Flex: { flow: 'y', gap: 'B', align: 'center center' } }
|
|
204
|
-
{ Grid: { columns: 'repeat(3, 1fr)', gap: 'A' } }
|
|
205
|
-
{ Link: { text: 'Click here', href: '/dashboard' } }
|
|
206
|
-
{ Button: { text: 'Submit', theme: 'primary', icon: 'check' } }
|
|
207
|
-
{ Icon: { name: 'chevronLeft' } }
|
|
208
|
-
{ Img: { src: 'photo.png', boxSize: 'D D' } }
|
|
209
|
-
"""
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
@mcp.resource("symbols://reference/event-handlers")
|
|
213
|
-
def get_event_handlers() -> str:
|
|
214
|
-
"""Event handler reference for Symbols/DOMQL v3."""
|
|
215
|
-
return """# Symbols Event Handlers (v3)
|
|
216
|
-
|
|
217
|
-
## Lifecycle Events
|
|
218
|
-
onInit: (el, state) => {} // Once on creation
|
|
219
|
-
onRender: (el, state) => {} // On each render (return fn for cleanup)
|
|
220
|
-
onUpdate: (el, state) => {} // On props/state change
|
|
221
|
-
onStateUpdate: (changes, el, state, context) => {}
|
|
222
|
-
|
|
223
|
-
## DOM Events
|
|
224
|
-
onClick: (event, el, state) => {}
|
|
225
|
-
onInput: (event, el, state) => {}
|
|
226
|
-
onKeydown: (event, el, state) => {}
|
|
227
|
-
onDblclick: (event, el, state) => {}
|
|
228
|
-
onMouseover: (event, el, state) => {}
|
|
229
|
-
onWheel: (event, el, state) => {}
|
|
230
|
-
onSubmit: (event, el, state) => {}
|
|
231
|
-
onLoad: (event, el, state) => {}
|
|
232
|
-
|
|
233
|
-
## Calling Functions
|
|
234
|
-
onClick: (e, el) => el.call('functionName', args) // Global function
|
|
235
|
-
onClick: (e, el) => el.scope.localFn(el, s) // Scope function
|
|
236
|
-
onClick: (e, el) => el.methodName() // Element method
|
|
237
|
-
|
|
238
|
-
## State Updates
|
|
239
|
-
onClick: (e, el, s) => s.update({ count: s.count + 1 })
|
|
240
|
-
onClick: (e, el, s) => s.toggle('isActive')
|
|
241
|
-
onClick: (e, el, s) => s.root.update({ modal: '/add-item' })
|
|
242
|
-
|
|
243
|
-
## Navigation
|
|
244
|
-
onClick: (e, el) => el.router('/dashboard', el.getRoot())
|
|
245
|
-
|
|
246
|
-
## Cleanup Pattern
|
|
247
|
-
onRender: (el, s) => {
|
|
248
|
-
const interval = setInterval(() => { /* ... */ }, 1000)
|
|
249
|
-
return () => clearInterval(interval) // Called on element removal
|
|
250
|
-
}
|
|
251
|
-
"""
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
# ---------------------------------------------------------------------------
|
|
255
|
-
# PROMPTS — Reusable prompt templates for common tasks
|
|
256
|
-
# ---------------------------------------------------------------------------
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
@mcp.prompt()
|
|
260
|
-
def symbols_component_prompt(description: str, component_name: str = "MyComponent") -> str:
|
|
261
|
-
"""Prompt template for generating a Symbols/DOMQL v3 component."""
|
|
262
|
-
return f"""Generate a Symbols/DOMQL v3 component with these requirements:
|
|
263
|
-
|
|
264
|
-
Component Name: {component_name}
|
|
265
|
-
Description: {description}
|
|
266
|
-
|
|
267
|
-
Follow these strict rules:
|
|
268
|
-
- Use DOMQL v3 syntax ONLY (extends, childExtends, flattened props, onX events)
|
|
269
|
-
- Components are plain objects with named exports: export const {component_name} = {{ ... }}
|
|
270
|
-
- Use design-system tokens for spacing (A, B, C), colors, typography
|
|
271
|
-
- NO imports between files — reference components by PascalCase key name
|
|
272
|
-
- All folders flat — no subfolders
|
|
273
|
-
- Include responsive breakpoints (@mobile, @tablet) where appropriate
|
|
274
|
-
- Follow modern UI/UX: visual hierarchy, minimal cognitive load, confident typography
|
|
275
|
-
|
|
276
|
-
Output ONLY the JavaScript code."""
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
@mcp.prompt()
|
|
280
|
-
def symbols_migration_prompt(source_framework: str = "React") -> str:
|
|
281
|
-
"""Prompt template for migrating code to Symbols/DOMQL v3."""
|
|
282
|
-
return f"""You are migrating {source_framework} code to Symbols/DOMQL v3.
|
|
283
|
-
|
|
284
|
-
Key conversion rules for {source_framework}:
|
|
285
|
-
- Components become plain objects (never functions)
|
|
286
|
-
- NO imports between project files
|
|
287
|
-
- All folders are flat — no subfolders
|
|
288
|
-
- Use extends/childExtends (v3 plural, never v2 singular)
|
|
289
|
-
- Flatten all props directly (no props: {{}} wrapper)
|
|
290
|
-
- Events use onX prefix (no on: {{}} wrapper)
|
|
291
|
-
- Use design-system tokens for spacing/colors
|
|
292
|
-
- State: state: {{ key: val }} + s.update({{ key: newVal }})
|
|
293
|
-
- Effects: onRender for mount, onStateUpdate for dependency changes
|
|
294
|
-
- Lists: children: (el, s) => s.items, childrenAs: 'state', childExtends: 'Item'
|
|
295
|
-
|
|
296
|
-
Provide the {source_framework} code to convert and I will output clean DOMQL v3."""
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
@mcp.prompt()
|
|
300
|
-
def symbols_project_prompt(description: str) -> str:
|
|
301
|
-
"""Prompt template for scaffolding a complete Symbols project."""
|
|
302
|
-
return f"""Create a complete Symbols/DOMQL v3 project:
|
|
303
|
-
|
|
304
|
-
Project Description: {description}
|
|
305
|
-
|
|
306
|
-
Required structure (smbls/ folder):
|
|
307
|
-
- index.js (root export)
|
|
308
|
-
- config.js (platform config)
|
|
309
|
-
- vars.js (global constants)
|
|
310
|
-
- dependencies.js (external packages)
|
|
311
|
-
- components/ (PascalCase files, named exports)
|
|
312
|
-
- pages/ (dash-case files, camelCase exports, route mapping in index.js)
|
|
313
|
-
- functions/ (camelCase, called via el.call())
|
|
314
|
-
- designSystem/ (color, spacing, typography, theme, icons)
|
|
315
|
-
- state/ (default exports)
|
|
316
|
-
|
|
317
|
-
Rules:
|
|
318
|
-
- v3 syntax only — extends, childExtends, flattened props, onX events
|
|
319
|
-
- Design tokens for all spacing/colors (padding: 'A', not padding: '16px')
|
|
320
|
-
- Components are plain objects, never functions
|
|
321
|
-
- No imports between project files
|
|
322
|
-
- All folders completely flat
|
|
323
|
-
|
|
324
|
-
Generate all files with complete, production-ready code."""
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
@mcp.prompt()
|
|
328
|
-
def symbols_review_prompt() -> str:
|
|
329
|
-
"""Prompt template for reviewing Symbols/DOMQL code."""
|
|
330
|
-
return """Review this Symbols/DOMQL code for v3 compliance and best practices.
|
|
331
|
-
|
|
332
|
-
Check for these violations:
|
|
333
|
-
1. v2 syntax: extend→extends, childExtend→childExtends, props:{}, on:{}
|
|
334
|
-
2. Imports between project files (FORBIDDEN)
|
|
335
|
-
3. Function-based components (must be plain objects)
|
|
336
|
-
4. Subfolders (must be flat)
|
|
337
|
-
5. Hardcoded pixels instead of design tokens
|
|
338
|
-
6. Wrong event handler signatures
|
|
339
|
-
7. Default exports for components (should be named)
|
|
340
|
-
|
|
341
|
-
Provide:
|
|
342
|
-
- Issues found with line references
|
|
343
|
-
- Corrected code for each issue
|
|
344
|
-
- Overall v3 compliance score (1-10)
|
|
345
|
-
- Improvement suggestions
|
|
346
|
-
|
|
347
|
-
Paste your code below:"""
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
# ---------------------------------------------------------------------------
|
|
351
|
-
# Entry point
|
|
352
|
-
# ---------------------------------------------------------------------------
|
|
353
|
-
def main():
|
|
354
|
-
"""Run the Symbols MCP server."""
|
|
355
|
-
mcp.run(transport="stdio")
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
if __name__ == "__main__":
|
|
359
|
-
main()
|