css-mcp 0.1.2__tar.gz → 0.2.0__tar.gz

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.
Files changed (29) hide show
  1. css_mcp-0.2.0/.crackerjack/adapter_learning.dhara +0 -0
  2. {css_mcp-0.1.2/.oneiric_cache → css_mcp-0.2.0/.crackerjack/oneiric_cache}/workflow_checkpoints.sqlite +0 -0
  3. {css_mcp-0.1.2 → css_mcp-0.2.0}/.gitignore +13 -0
  4. css_mcp-0.2.0/.lycheecache +12 -0
  5. css_mcp-0.2.0/AGENTS.md +38 -0
  6. {css_mcp-0.1.2 → css_mcp-0.2.0}/CHANGELOG.md +6 -0
  7. {css_mcp-0.1.2 → css_mcp-0.2.0}/CLAUDE.md +4 -0
  8. {css_mcp-0.1.2 → css_mcp-0.2.0}/PKG-INFO +17 -7
  9. {css_mcp-0.1.2 → css_mcp-0.2.0}/README.md +12 -0
  10. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/__init__.py +5 -2
  11. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/__main__.py +3 -1
  12. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/analyzer.py +167 -129
  13. css_mcp-0.2.0/css_mcp/cli.py +42 -0
  14. css_mcp-0.2.0/css_mcp/cli.py.backup.json +1 -0
  15. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/compat.py +37 -58
  16. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/config.py +32 -26
  17. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/mdn_fetcher.py +21 -23
  18. css_mcp-0.2.0/css_mcp/server.py +78 -0
  19. {css_mcp-0.1.2 → css_mcp-0.2.0}/css_mcp/tools.py +39 -57
  20. css_mcp-0.2.0/mypy.ini +11 -0
  21. {css_mcp-0.1.2 → css_mcp-0.2.0}/pyproject.toml +10 -18
  22. css_mcp-0.2.0/settings/css-mcp.yaml +12 -0
  23. css_mcp-0.2.0/uv.lock +4937 -0
  24. css_mcp-0.1.2/.oneiric_cache/domain_activity.sqlite +0 -0
  25. css_mcp-0.1.2/.oneiric_cache/runtime_telemetry.json +0 -1
  26. css_mcp-0.1.2/css_mcp/server.py +0 -155
  27. css_mcp-0.1.2/uv.lock +0 -4726
  28. {css_mcp-0.1.2 → css_mcp-0.2.0}/.envrc +0 -0
  29. {css_mcp-0.1.2 → css_mcp-0.2.0}/LICENSE +0 -0
@@ -57,7 +57,20 @@ dmypy.json
57
57
  # Cache
58
58
  .css_mcp_cache/
59
59
  .cache/
60
+ .oneiric_cache/
61
+
62
+ # Local settings overrides
63
+ settings/local.yaml
60
64
 
61
65
  # OS
62
66
  .DS_Store
63
67
  Thumbs.db
68
+
69
+ # Backup Files (added by gitignore audit)
70
+ # ============================================================================
71
+ *.backup
72
+ *.bak
73
+ /.backups/
74
+ /.backup/
75
+ .backups/
76
+ .backup/
@@ -0,0 +1,12 @@
1
+ https://img.shields.io/badge/code%20style-crackerjack-000042,200,1781840750
2
+ https://github.com/astral-sh/uv,200,1781840751
3
+ https://github.com/lesleslie/crackerjack,200,1781840751
4
+ https://keepachangelog.com/en/1.0.0/,200,1781840750
5
+ https://img.shields.io/badge/runtime-oneiric-6e5494,200,1781840750
6
+ https://github.com/lesleslie/oneiric,200,1781840751
7
+ https://img.shields.io/badge/python-3.13%2B-green,200,1781840750
8
+ https://semver.org/spec/v2.0.0.html,200,1781840750
9
+ https://github.com/jlowin/fastmcp,200,1781840751
10
+ https://img.shields.io/badge/framework-FastMCP-0ea5e9,200,1781840750
11
+ https://www.python.org/downloads/,200,1781840750
12
+ https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json,200,1781840750
@@ -0,0 +1,38 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Module Organization
4
+
5
+ - `css_mcp/` contains the MCP server package, including tool implementations, parsing or analysis helpers, and server entrypoints.
6
+ - Tests should live under `tests/`, mirroring package structure when practical.
7
+ - Root files such as `pyproject.toml`, `uv.lock`, and `README.md` define packaging, dependency, and operator guidance; keep behavioral documentation there rather than scattering it across scripts.
8
+ - Generated output in `dist/` or coverage artifacts should not be edited manually.
9
+
10
+ ## Build, Test, and Development Commands
11
+
12
+ - `uv sync --group dev` installs development dependencies.
13
+ - `uv run pytest` runs the full test suite.
14
+ - `uv run mypy css_mcp` validates typing.
15
+ - `uv run ruff check css_mcp tests` and `uv run ruff format css_mcp tests` cover linting and formatting.
16
+ - Run the MCP server with the repo's documented local command before validating tool behavior.
17
+
18
+ ## Coding Style & Naming Conventions
19
+
20
+ - Use explicit type hints, small focused modules, and structured tool inputs and outputs.
21
+ - Keep module names snake_case and classes PascalCase.
22
+ - Prefer extending existing CSS analysis or documentation helpers rather than adding parallel tool paths.
23
+
24
+ ## Testing Guidelines
25
+
26
+ - Add tests with each tool or parser change, especially around CSS analysis edge cases and response formatting.
27
+ - Prefer deterministic fixture inputs over live or generated CSS blobs unless the case requires end-to-end validation.
28
+ - Review coverage locally after larger changes.
29
+
30
+ ## Commit & Pull Request Guidelines
31
+
32
+ - Use focused commits such as `fix(parser): handle nested rule output`.
33
+ - PRs should describe changed tools, commands run for validation, and any user-facing output differences.
34
+
35
+ ## Security & Configuration Tips
36
+
37
+ - Validate file paths and CSS inputs rigorously.
38
+ - Keep secrets and machine-specific paths out of version control.
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.0] - 2026-06-19
9
+
10
+ ### Internal
11
+
12
+ - gitignore: Add backup file patterns to silence checkpoint tool artifacts
13
+
8
14
  ## [0.1.2] - 2026-02-25
9
15
 
10
16
  ### Changed
@@ -2,6 +2,8 @@
2
2
 
3
3
  This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
4
 
5
+ For a shorter, tool-neutral bootstrap document, start with `AGENTS.md`.
6
+
5
7
  ## Project Overview
6
8
 
7
9
  CSS MCP Server is an MCP (Model Context Protocol) server for CSS analysis and documentation, designed for the FastBlocks ecosystem. It provides 9 tools for analyzing programmatically generated CSS from style adapters like Kelp UI and WebAwesome.
@@ -44,6 +46,7 @@ css_mcp/
44
46
  ### Key Components
45
47
 
46
48
  **CSSAnalyzer** (`analyzer.py`): The core analysis engine that parses CSS using tinycss2 and computes 150+ metrics including:
49
+
47
50
  - Complexity scores (0-100)
48
51
  - Specificity analysis with distribution
49
52
  - Selector patterns (ID, class, element, universal)
@@ -91,6 +94,7 @@ Environment variables (prefix: `CSS_MCP_`):
91
94
  ## FastBlocks Integration
92
95
 
93
96
  This server is designed for analyzing CSS generated by FastBlocks style adapters:
97
+
94
98
  - Kelp UI (custom lightweight framework)
95
99
  - WebAwesome (Font Awesome components)
96
100
  - Vanilla (minimal semantic styling)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: css-mcp
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: Universal CSS analysis and documentation MCP server with 150+ metrics
5
5
  Project-URL: Homepage, https://github.com/lesleslie/css-mcp
6
6
  Project-URL: Repository, https://github.com/lesleslie/css-mcp
@@ -13,13 +13,11 @@ Classifier: License :: OSI Approved :: BSD License
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.13
15
15
  Requires-Python: >=3.13
16
- Requires-Dist: cssselect>=1.2.0
17
16
  Requires-Dist: fastmcp>=0.6.0
18
- Requires-Dist: httpx>=0.27.0
19
- Requires-Dist: mcp-common>=0.1.0
20
- Requires-Dist: oneiric>=0.1.0
21
- Requires-Dist: pydantic>=2.0.0
22
- Requires-Dist: tinycss2>=1.3.0
17
+ Requires-Dist: httpx~=0.28.1
18
+ Requires-Dist: mcp-common~=0.16.4
19
+ Requires-Dist: pydantic~=2.13.4
20
+ Requires-Dist: tinycss2~=1.5.1
23
21
  Provides-Extra: dev
24
22
  Requires-Dist: mypy>=1.9.0; extra == 'dev'
25
23
  Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
@@ -30,6 +28,12 @@ Description-Content-Type: text/markdown
30
28
 
31
29
  # CSS MCP Server
32
30
 
31
+ [![Code style: crackerjack](https://img.shields.io/badge/code%20style-crackerjack-000042)](https://github.com/lesleslie/crackerjack)
32
+ [![Runtime: oneiric](https://img.shields.io/badge/runtime-oneiric-6e5494)](https://github.com/lesleslie/oneiric)
33
+ [![Framework: FastMCP](https://img.shields.io/badge/framework-FastMCP-0ea5e9)](https://github.com/jlowin/fastmcp)
34
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
35
+ [![Python: 3.13+](https://img.shields.io/badge/python-3.13%2B-green)](https://www.python.org/downloads/)
36
+
33
37
  Universal CSS Analysis and Documentation MCP Server. Analyze any CSS with 150+ metrics for complexity, specificity, and quality.
34
38
 
35
39
  ## Features
@@ -108,22 +112,26 @@ suggestions = analyzer.get_suggestions()
108
112
  The analyzer provides 150+ metrics including:
109
113
 
110
114
  ### Basic Metrics
115
+
111
116
  - Total rules, selectors, properties
112
117
  - File size (bytes, gzipped)
113
118
  - Lines of code
114
119
 
115
120
  ### Selector Metrics
121
+
116
122
  - ID, class, element, universal selectors
117
123
  - Pseudo-classes and pseudo-elements
118
124
  - Combinators (descendant, child, sibling)
119
125
  - Selector depth
120
126
 
121
127
  ### Specificity Metrics
128
+
122
129
  - Average, min, max specificity
123
130
  - High specificity rules
124
131
  - Specificity distribution
125
132
 
126
133
  ### Property Metrics
134
+
127
135
  - Unique properties
128
136
  - Category distribution (layout, typography, etc.)
129
137
  - Vendor prefixes
@@ -131,6 +139,7 @@ The analyzer provides 150+ metrics including:
131
139
  - CSS custom properties
132
140
 
133
141
  ### Quality Metrics
142
+
134
143
  - Duplicate selectors
135
144
  - Duplicate properties
136
145
  - Empty rules
@@ -140,6 +149,7 @@ The analyzer provides 150+ metrics including:
140
149
  ## Browser Compatibility
141
150
 
142
151
  Built-in compatibility data for common CSS properties across:
152
+
143
153
  - Chrome
144
154
  - Firefox
145
155
  - Safari
@@ -1,5 +1,11 @@
1
1
  # CSS MCP Server
2
2
 
3
+ [![Code style: crackerjack](https://img.shields.io/badge/code%20style-crackerjack-000042)](https://github.com/lesleslie/crackerjack)
4
+ [![Runtime: oneiric](https://img.shields.io/badge/runtime-oneiric-6e5494)](https://github.com/lesleslie/oneiric)
5
+ [![Framework: FastMCP](https://img.shields.io/badge/framework-FastMCP-0ea5e9)](https://github.com/jlowin/fastmcp)
6
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
7
+ [![Python: 3.13+](https://img.shields.io/badge/python-3.13%2B-green)](https://www.python.org/downloads/)
8
+
3
9
  Universal CSS Analysis and Documentation MCP Server. Analyze any CSS with 150+ metrics for complexity, specificity, and quality.
4
10
 
5
11
  ## Features
@@ -78,22 +84,26 @@ suggestions = analyzer.get_suggestions()
78
84
  The analyzer provides 150+ metrics including:
79
85
 
80
86
  ### Basic Metrics
87
+
81
88
  - Total rules, selectors, properties
82
89
  - File size (bytes, gzipped)
83
90
  - Lines of code
84
91
 
85
92
  ### Selector Metrics
93
+
86
94
  - ID, class, element, universal selectors
87
95
  - Pseudo-classes and pseudo-elements
88
96
  - Combinators (descendant, child, sibling)
89
97
  - Selector depth
90
98
 
91
99
  ### Specificity Metrics
100
+
92
101
  - Average, min, max specificity
93
102
  - High specificity rules
94
103
  - Specificity distribution
95
104
 
96
105
  ### Property Metrics
106
+
97
107
  - Unique properties
98
108
  - Category distribution (layout, typography, etc.)
99
109
  - Vendor prefixes
@@ -101,6 +111,7 @@ The analyzer provides 150+ metrics including:
101
111
  - CSS custom properties
102
112
 
103
113
  ### Quality Metrics
114
+
104
115
  - Duplicate selectors
105
116
  - Duplicate properties
106
117
  - Empty rules
@@ -110,6 +121,7 @@ The analyzer provides 150+ metrics including:
110
121
  ## Browser Compatibility
111
122
 
112
123
  Built-in compatibility data for common CSS properties across:
124
+
113
125
  - Chrome
114
126
  - Firefox
115
127
  - Safari
@@ -1,14 +1,17 @@
1
1
  """CSS MCP Server - CSS analysis and documentation for FastBlocks ecosystem."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  __version__ = "0.1.0"
4
6
  __author__ = "Les Leslie"
5
7
 
6
8
  from css_mcp.analyzer import CSSAnalyzer, CSSMetrics, CSSProperty
7
- from css_mcp.config import CSSMCPConfig
9
+ from css_mcp.config import CSSMCPConfig, CSSMCPSettings
8
10
 
9
11
  __all__ = [
10
12
  "CSSAnalyzer",
11
13
  "CSSMetrics",
12
- "CSSProperty",
13
14
  "CSSMCPConfig",
15
+ "CSSMCPSettings",
16
+ "CSSProperty",
14
17
  ]
@@ -1,6 +1,8 @@
1
1
  """Entry point for running CSS MCP as a module."""
2
2
 
3
- from css_mcp.server import main
3
+ from __future__ import annotations
4
+
5
+ from css_mcp.cli import main
4
6
 
5
7
  if __name__ == "__main__":
6
8
  main()