elements-mcp 0.1.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.
- elements_mcp-0.1.0/MANIFEST.in +3 -0
- elements_mcp-0.1.0/PKG-INFO +334 -0
- elements_mcp-0.1.0/README.md +323 -0
- elements_mcp-0.1.0/README.zh-CN.md +533 -0
- elements_mcp-0.1.0/docs/mcp-user-guide-zh.md +760 -0
- elements_mcp-0.1.0/docs/pypi-publish-and-user-install-zh.md +434 -0
- elements_mcp-0.1.0/pyproject.toml +32 -0
- elements_mcp-0.1.0/setup.cfg +4 -0
- elements_mcp-0.1.0/src/elements_mcp/__init__.py +4 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/partner/README.md +12 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/accessibility-standards/SKILL.md +164 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/api-integration/SKILL.md +120 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/api-integration/templates/cross-dc-service.template.mdx +22 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/api-integration/templates/direct-service-call.template.mdx +33 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/api-integration/templates/global-service.template.mdx +23 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/api-integration/templates/module-service.template.mdx +30 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/code-quality/SKILL.md +193 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/component-catalog/SKILL.md +544 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/i18n-usage/SKILL.md +233 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/license-knowledge/SKILL.md +44 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/naming-conventions/SKILL.md +48 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/page-structure/SKILL.md +91 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/performance-optimization/SKILL.md +146 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/security-standards/SKILL.md +524 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-component-guidelines/SKILL.md +492 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-standard-layout/SKILL.md +155 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-standard-layout/templates/change-processor.template.mdx +46 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-standard-layout/templates/license-gated-layout.template.mdx +155 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-standard-layout/templates/page-shell.template.mdx +178 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column/SKILL.md +132 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column/templates/interactive-renderers.template.mdx +98 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column/templates/rich-renderers.template.mdx +132 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column/templates/text-renderers.template.mdx +111 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column-filter/SKILL.md +262 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column-filter/templates/column-definition.template.mdx +31 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column-filter/templates/filter-recipes.template.mdx +243 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column-filter/templates/request-input.template.yaml +50 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column-filter/templates/standard-table.template.mdx +587 -0
- elements_mcp-0.1.0/src/elements_mcp/content/skills/ui/ui-table-column-filter/templates/view-management.template.mdx +74 -0
- elements_mcp-0.1.0/src/elements_mcp/registry.py +158 -0
- elements_mcp-0.1.0/src/elements_mcp/server.py +80 -0
- elements_mcp-0.1.0/src/elements_mcp.egg-info/PKG-INFO +334 -0
- elements_mcp-0.1.0/src/elements_mcp.egg-info/SOURCES.txt +47 -0
- elements_mcp-0.1.0/src/elements_mcp.egg-info/dependency_links.txt +1 -0
- elements_mcp-0.1.0/src/elements_mcp.egg-info/entry_points.txt +2 -0
- elements_mcp-0.1.0/src/elements_mcp.egg-info/requires.txt +4 -0
- elements_mcp-0.1.0/src/elements_mcp.egg-info/top_level.txt +1 -0
- elements_mcp-0.1.0/tests/test_registry.py +73 -0
- elements_mcp-0.1.0/tests/test_server_contract.py +7 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: elements-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for shared Elements project skills and templates.
|
|
5
|
+
Author: Elements Team
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: fastmcp==3.0.0
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
11
|
+
|
|
12
|
+
# elements-mcp
|
|
13
|
+
|
|
14
|
+
`elements-mcp` is a local MCP server for shared Elements engineering skills and templates. It exposes repository guidance as read-only MCP resources, tools, and prompts so multiple projects can consume the same standards without copying `.github/skills` into every repository.
|
|
15
|
+
|
|
16
|
+
This project is intended to be published as an internal Python package. Users install the package, configure Codex to start the MCP server, then ask Codex to read project skills and templates through MCP.
|
|
17
|
+
|
|
18
|
+
中文工程说明见 [README.zh-CN.md](README.zh-CN.md)。
|
|
19
|
+
|
|
20
|
+
中文安装与使用说明见 [docs/mcp-user-guide-zh.md](docs/mcp-user-guide-zh.md)。
|
|
21
|
+
|
|
22
|
+
## Current Scopes
|
|
23
|
+
|
|
24
|
+
Current scope IDs:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
ui
|
|
28
|
+
partner
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The `ui` scope currently contains:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
ui/
|
|
35
|
+
accessibility-standards/
|
|
36
|
+
api-integration/
|
|
37
|
+
code-quality/
|
|
38
|
+
component-catalog/
|
|
39
|
+
i18n-usage/
|
|
40
|
+
license-knowledge/
|
|
41
|
+
naming-conventions/
|
|
42
|
+
page-structure/
|
|
43
|
+
performance-optimization/
|
|
44
|
+
security-standards/
|
|
45
|
+
ui-component-guidelines/
|
|
46
|
+
ui-standard-layout/
|
|
47
|
+
ui-table-column/
|
|
48
|
+
ui-table-column-filter/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The `partner` scope is reserved for Partner-specific engineering skills and templates.
|
|
52
|
+
|
|
53
|
+
## What The MCP Server Provides
|
|
54
|
+
|
|
55
|
+
Tools:
|
|
56
|
+
|
|
57
|
+
- `list_skill_scopes()`
|
|
58
|
+
- `list_project_skills(scope: str | None = None)`
|
|
59
|
+
- `read_project_skill(scope: str, skill_name: str)`
|
|
60
|
+
- `search_project_skills(query: str, scope: str | None = None)`
|
|
61
|
+
- `list_skill_templates(scope: str, skill_name: str)`
|
|
62
|
+
- `read_skill_template(scope: str, skill_name: str, template_name: str)`
|
|
63
|
+
|
|
64
|
+
Resources:
|
|
65
|
+
|
|
66
|
+
- `elements-skill://{scope}/{skill_name}/SKILL.md`
|
|
67
|
+
- `elements-template://{scope}/{skill_name}/{template_name}`
|
|
68
|
+
|
|
69
|
+
Prompts:
|
|
70
|
+
|
|
71
|
+
- `apply_project_skill(scope: str, skill_name: str, task: str)`
|
|
72
|
+
|
|
73
|
+
## Maintainer Setup
|
|
74
|
+
|
|
75
|
+
Use this when developing or publishing `elements-mcp`.
|
|
76
|
+
|
|
77
|
+
```powershell
|
|
78
|
+
cd C:\Code\elements-mcp
|
|
79
|
+
python -m venv .venv
|
|
80
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Run tests:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Run the MCP server directly:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
.\.venv\Scripts\python.exe -m elements_mcp.server
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The direct server command is a long-running stdio MCP process. In normal usage, Codex starts and manages it.
|
|
96
|
+
|
|
97
|
+
## Publishing A Package
|
|
98
|
+
|
|
99
|
+
Install packaging tools:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
.\.venv\Scripts\python.exe -m pip install build twine
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Build source distribution and wheel:
|
|
106
|
+
|
|
107
|
+
```powershell
|
|
108
|
+
.\.venv\Scripts\python.exe -m build
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Expected output:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
dist/elements_mcp-0.1.0.tar.gz
|
|
115
|
+
dist/elements_mcp-0.1.0-py3-none-any.whl
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Publish to the company Python package feed:
|
|
119
|
+
|
|
120
|
+
```powershell
|
|
121
|
+
.\.venv\Scripts\python.exe -m twine upload --repository-url https://your-private-pypi.example/repository/pypi-internal/ dist/*
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Replace the URL with the actual internal PyPI-compatible repository.
|
|
125
|
+
|
|
126
|
+
## User Installation
|
|
127
|
+
|
|
128
|
+
Recommended user setup is a dedicated virtual environment. This keeps the MCP server dependency tree separate from system Python and project-specific frontend tooling.
|
|
129
|
+
|
|
130
|
+
```powershell
|
|
131
|
+
mkdir C:\Tools\elements-mcp
|
|
132
|
+
cd C:\Tools\elements-mcp
|
|
133
|
+
python -m venv .venv
|
|
134
|
+
.\.venv\Scripts\python.exe -m pip install --index-url https://your-private-pypi.example/repository/pypi-internal/simple elements-mcp==0.1.0
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
If the package is shared as a wheel file before the internal package feed is ready:
|
|
138
|
+
|
|
139
|
+
```powershell
|
|
140
|
+
mkdir C:\Tools\elements-mcp
|
|
141
|
+
cd C:\Tools\elements-mcp
|
|
142
|
+
python -m venv .venv
|
|
143
|
+
.\.venv\Scripts\python.exe -m pip install C:\Path\To\elements_mcp-0.1.0-py3-none-any.whl
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Verify the package can be imported:
|
|
147
|
+
|
|
148
|
+
```powershell
|
|
149
|
+
.\.venv\Scripts\python.exe -c "from elements_mcp.registry import SkillRegistry; print(SkillRegistry().list_scopes())"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Expected output includes:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
['partner', 'ui']
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Verify the server can be created:
|
|
159
|
+
|
|
160
|
+
```powershell
|
|
161
|
+
.\.venv\Scripts\python.exe -c "from elements_mcp.server import create_server; print(create_server().name)"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Expected output:
|
|
165
|
+
|
|
166
|
+
```text
|
|
167
|
+
Elements MCP
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Codex Configuration For Users
|
|
171
|
+
|
|
172
|
+
Add the MCP server to the user's Codex config file.
|
|
173
|
+
|
|
174
|
+
Typical Windows path:
|
|
175
|
+
|
|
176
|
+
```text
|
|
177
|
+
C:\Users\<user>\.codex\config.toml
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Recommended configuration when installed into `C:\Tools\elements-mcp\.venv`:
|
|
181
|
+
|
|
182
|
+
```toml
|
|
183
|
+
[mcp_servers.elements]
|
|
184
|
+
command = "C:\\Tools\\elements-mcp\\.venv\\Scripts\\python.exe"
|
|
185
|
+
args = ["-m", "elements_mcp.server"]
|
|
186
|
+
cwd = "C:\\Tools\\elements-mcp"
|
|
187
|
+
startup_timeout_sec = 20
|
|
188
|
+
tool_timeout_sec = 60
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Restart Codex after editing the config.
|
|
192
|
+
|
|
193
|
+
Check connection in Codex:
|
|
194
|
+
|
|
195
|
+
```text
|
|
196
|
+
/mcp
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Or from a terminal:
|
|
200
|
+
|
|
201
|
+
```powershell
|
|
202
|
+
codex mcp list
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Expected result: an MCP server named `elements` is listed and available.
|
|
206
|
+
|
|
207
|
+
## Business Repository Guidance
|
|
208
|
+
|
|
209
|
+
Each business repository should tell agents to use this MCP server. Add a short note to that repository's `AGENTS.md`.
|
|
210
|
+
|
|
211
|
+
Example:
|
|
212
|
+
|
|
213
|
+
```markdown
|
|
214
|
+
## Project Skills
|
|
215
|
+
|
|
216
|
+
This repository uses the `elements` MCP server for shared project skills and templates.
|
|
217
|
+
|
|
218
|
+
- For UI work, use scope `ui`.
|
|
219
|
+
- For Partner work, use scope `partner`.
|
|
220
|
+
- Before editing UIStandardLayout pages, read `ui-standard-layout`.
|
|
221
|
+
- Before adding API services, read `api-integration`.
|
|
222
|
+
- Before adding table cell renderers, read `ui-table-column`.
|
|
223
|
+
- Before adding table filters, read `ui-table-column-filter`.
|
|
224
|
+
- Do not hardcode user-visible strings; read `i18n-usage`.
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Example Codex Usage
|
|
228
|
+
|
|
229
|
+
After the MCP server is connected, users can ask Codex:
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
Use the elements MCP server. Read the ui-standard-layout skill from scope ui and the page-shell template before changing this page.
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Useful MCP calls for agents:
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
list_skill_scopes()
|
|
239
|
+
list_project_skills(scope="ui")
|
|
240
|
+
read_project_skill(scope="ui", skill_name="ui-standard-layout")
|
|
241
|
+
list_skill_templates(scope="ui", skill_name="ui-standard-layout")
|
|
242
|
+
read_skill_template(scope="ui", skill_name="ui-standard-layout", template_name="page-shell.template.mdx")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Updating Users To A New Version
|
|
246
|
+
|
|
247
|
+
Publish a new package version, then users upgrade their dedicated environment:
|
|
248
|
+
|
|
249
|
+
```powershell
|
|
250
|
+
C:\Tools\elements-mcp\.venv\Scripts\python.exe -m pip install --upgrade --index-url https://your-private-pypi.example/repository/pypi-internal/simple elements-mcp==0.2.0
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Restart Codex after upgrading.
|
|
254
|
+
|
|
255
|
+
If a user needs to roll back:
|
|
256
|
+
|
|
257
|
+
```powershell
|
|
258
|
+
C:\Tools\elements-mcp\.venv\Scripts\python.exe -m pip install --force-reinstall --index-url https://your-private-pypi.example/repository/pypi-internal/simple elements-mcp==0.1.0
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Adding New Skills
|
|
262
|
+
|
|
263
|
+
Add shared content under:
|
|
264
|
+
|
|
265
|
+
```text
|
|
266
|
+
src/elements_mcp/content/skills/<scope>/<skill-name>/
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Required:
|
|
270
|
+
|
|
271
|
+
```text
|
|
272
|
+
SKILL.md
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Optional:
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
templates/*.template.mdx
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
src/elements_mcp/content/skills/ui/new-skill/
|
|
285
|
+
SKILL.md
|
|
286
|
+
templates/
|
|
287
|
+
example.template.mdx
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Then run:
|
|
291
|
+
|
|
292
|
+
```powershell
|
|
293
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
294
|
+
.\.venv\Scripts\python.exe -m build
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Content Rules
|
|
298
|
+
|
|
299
|
+
- Keep this server read-only.
|
|
300
|
+
- Do not add tools that write files or execute shell commands.
|
|
301
|
+
- Add new shared project guidance under `src/elements_mcp/content/skills/<scope>/<skill-name>`.
|
|
302
|
+
- Each skill directory must contain `SKILL.md`.
|
|
303
|
+
- Optional templates belong under `templates/` inside the skill directory.
|
|
304
|
+
- Use safe names with letters, numbers, dots, underscores, and hyphens only.
|
|
305
|
+
- Pin released package versions for users, such as `elements-mcp==0.1.0`.
|
|
306
|
+
|
|
307
|
+
## Troubleshooting
|
|
308
|
+
|
|
309
|
+
`No module named elements_mcp`:
|
|
310
|
+
|
|
311
|
+
The Codex config is pointing at a Python environment where `elements-mcp` is not installed. Use the Python path from the dedicated virtual environment.
|
|
312
|
+
|
|
313
|
+
`No module named fastmcp`:
|
|
314
|
+
|
|
315
|
+
The package was not installed with dependencies. Reinstall with `pip install elements-mcp==<version>` instead of copying source files manually.
|
|
316
|
+
|
|
317
|
+
`/mcp` does not show `elements`:
|
|
318
|
+
|
|
319
|
+
Restart Codex after editing `config.toml`, then check that the configured `command` path exists.
|
|
320
|
+
|
|
321
|
+
Server starts then exits:
|
|
322
|
+
|
|
323
|
+
Run the configured command manually:
|
|
324
|
+
|
|
325
|
+
```powershell
|
|
326
|
+
C:\Tools\elements-mcp\.venv\Scripts\python.exe -m elements_mcp.server
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
If it reports import errors, reinstall the package in that virtual environment.
|
|
330
|
+
|
|
331
|
+
## References
|
|
332
|
+
|
|
333
|
+
- Codex MCP configuration: `~/.codex/config.toml`, `[mcp_servers.<name>]`, `/mcp`, and `codex mcp list`
|
|
334
|
+
- FastMCP packaging dependency: `fastmcp==3.0.0`
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# elements-mcp
|
|
2
|
+
|
|
3
|
+
`elements-mcp` is a local MCP server for shared Elements engineering skills and templates. It exposes repository guidance as read-only MCP resources, tools, and prompts so multiple projects can consume the same standards without copying `.github/skills` into every repository.
|
|
4
|
+
|
|
5
|
+
This project is intended to be published as an internal Python package. Users install the package, configure Codex to start the MCP server, then ask Codex to read project skills and templates through MCP.
|
|
6
|
+
|
|
7
|
+
中文工程说明见 [README.zh-CN.md](README.zh-CN.md)。
|
|
8
|
+
|
|
9
|
+
中文安装与使用说明见 [docs/mcp-user-guide-zh.md](docs/mcp-user-guide-zh.md)。
|
|
10
|
+
|
|
11
|
+
## Current Scopes
|
|
12
|
+
|
|
13
|
+
Current scope IDs:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
ui
|
|
17
|
+
partner
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The `ui` scope currently contains:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
ui/
|
|
24
|
+
accessibility-standards/
|
|
25
|
+
api-integration/
|
|
26
|
+
code-quality/
|
|
27
|
+
component-catalog/
|
|
28
|
+
i18n-usage/
|
|
29
|
+
license-knowledge/
|
|
30
|
+
naming-conventions/
|
|
31
|
+
page-structure/
|
|
32
|
+
performance-optimization/
|
|
33
|
+
security-standards/
|
|
34
|
+
ui-component-guidelines/
|
|
35
|
+
ui-standard-layout/
|
|
36
|
+
ui-table-column/
|
|
37
|
+
ui-table-column-filter/
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The `partner` scope is reserved for Partner-specific engineering skills and templates.
|
|
41
|
+
|
|
42
|
+
## What The MCP Server Provides
|
|
43
|
+
|
|
44
|
+
Tools:
|
|
45
|
+
|
|
46
|
+
- `list_skill_scopes()`
|
|
47
|
+
- `list_project_skills(scope: str | None = None)`
|
|
48
|
+
- `read_project_skill(scope: str, skill_name: str)`
|
|
49
|
+
- `search_project_skills(query: str, scope: str | None = None)`
|
|
50
|
+
- `list_skill_templates(scope: str, skill_name: str)`
|
|
51
|
+
- `read_skill_template(scope: str, skill_name: str, template_name: str)`
|
|
52
|
+
|
|
53
|
+
Resources:
|
|
54
|
+
|
|
55
|
+
- `elements-skill://{scope}/{skill_name}/SKILL.md`
|
|
56
|
+
- `elements-template://{scope}/{skill_name}/{template_name}`
|
|
57
|
+
|
|
58
|
+
Prompts:
|
|
59
|
+
|
|
60
|
+
- `apply_project_skill(scope: str, skill_name: str, task: str)`
|
|
61
|
+
|
|
62
|
+
## Maintainer Setup
|
|
63
|
+
|
|
64
|
+
Use this when developing or publishing `elements-mcp`.
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
cd C:\Code\elements-mcp
|
|
68
|
+
python -m venv .venv
|
|
69
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Run tests:
|
|
73
|
+
|
|
74
|
+
```powershell
|
|
75
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Run the MCP server directly:
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
.\.venv\Scripts\python.exe -m elements_mcp.server
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The direct server command is a long-running stdio MCP process. In normal usage, Codex starts and manages it.
|
|
85
|
+
|
|
86
|
+
## Publishing A Package
|
|
87
|
+
|
|
88
|
+
Install packaging tools:
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
.\.venv\Scripts\python.exe -m pip install build twine
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Build source distribution and wheel:
|
|
95
|
+
|
|
96
|
+
```powershell
|
|
97
|
+
.\.venv\Scripts\python.exe -m build
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Expected output:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
dist/elements_mcp-0.1.0.tar.gz
|
|
104
|
+
dist/elements_mcp-0.1.0-py3-none-any.whl
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Publish to the company Python package feed:
|
|
108
|
+
|
|
109
|
+
```powershell
|
|
110
|
+
.\.venv\Scripts\python.exe -m twine upload --repository-url https://your-private-pypi.example/repository/pypi-internal/ dist/*
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Replace the URL with the actual internal PyPI-compatible repository.
|
|
114
|
+
|
|
115
|
+
## User Installation
|
|
116
|
+
|
|
117
|
+
Recommended user setup is a dedicated virtual environment. This keeps the MCP server dependency tree separate from system Python and project-specific frontend tooling.
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
mkdir C:\Tools\elements-mcp
|
|
121
|
+
cd C:\Tools\elements-mcp
|
|
122
|
+
python -m venv .venv
|
|
123
|
+
.\.venv\Scripts\python.exe -m pip install --index-url https://your-private-pypi.example/repository/pypi-internal/simple elements-mcp==0.1.0
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If the package is shared as a wheel file before the internal package feed is ready:
|
|
127
|
+
|
|
128
|
+
```powershell
|
|
129
|
+
mkdir C:\Tools\elements-mcp
|
|
130
|
+
cd C:\Tools\elements-mcp
|
|
131
|
+
python -m venv .venv
|
|
132
|
+
.\.venv\Scripts\python.exe -m pip install C:\Path\To\elements_mcp-0.1.0-py3-none-any.whl
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Verify the package can be imported:
|
|
136
|
+
|
|
137
|
+
```powershell
|
|
138
|
+
.\.venv\Scripts\python.exe -c "from elements_mcp.registry import SkillRegistry; print(SkillRegistry().list_scopes())"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Expected output includes:
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
['partner', 'ui']
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Verify the server can be created:
|
|
148
|
+
|
|
149
|
+
```powershell
|
|
150
|
+
.\.venv\Scripts\python.exe -c "from elements_mcp.server import create_server; print(create_server().name)"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Expected output:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
Elements MCP
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Codex Configuration For Users
|
|
160
|
+
|
|
161
|
+
Add the MCP server to the user's Codex config file.
|
|
162
|
+
|
|
163
|
+
Typical Windows path:
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
C:\Users\<user>\.codex\config.toml
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Recommended configuration when installed into `C:\Tools\elements-mcp\.venv`:
|
|
170
|
+
|
|
171
|
+
```toml
|
|
172
|
+
[mcp_servers.elements]
|
|
173
|
+
command = "C:\\Tools\\elements-mcp\\.venv\\Scripts\\python.exe"
|
|
174
|
+
args = ["-m", "elements_mcp.server"]
|
|
175
|
+
cwd = "C:\\Tools\\elements-mcp"
|
|
176
|
+
startup_timeout_sec = 20
|
|
177
|
+
tool_timeout_sec = 60
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Restart Codex after editing the config.
|
|
181
|
+
|
|
182
|
+
Check connection in Codex:
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
/mcp
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Or from a terminal:
|
|
189
|
+
|
|
190
|
+
```powershell
|
|
191
|
+
codex mcp list
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Expected result: an MCP server named `elements` is listed and available.
|
|
195
|
+
|
|
196
|
+
## Business Repository Guidance
|
|
197
|
+
|
|
198
|
+
Each business repository should tell agents to use this MCP server. Add a short note to that repository's `AGENTS.md`.
|
|
199
|
+
|
|
200
|
+
Example:
|
|
201
|
+
|
|
202
|
+
```markdown
|
|
203
|
+
## Project Skills
|
|
204
|
+
|
|
205
|
+
This repository uses the `elements` MCP server for shared project skills and templates.
|
|
206
|
+
|
|
207
|
+
- For UI work, use scope `ui`.
|
|
208
|
+
- For Partner work, use scope `partner`.
|
|
209
|
+
- Before editing UIStandardLayout pages, read `ui-standard-layout`.
|
|
210
|
+
- Before adding API services, read `api-integration`.
|
|
211
|
+
- Before adding table cell renderers, read `ui-table-column`.
|
|
212
|
+
- Before adding table filters, read `ui-table-column-filter`.
|
|
213
|
+
- Do not hardcode user-visible strings; read `i18n-usage`.
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Example Codex Usage
|
|
217
|
+
|
|
218
|
+
After the MCP server is connected, users can ask Codex:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
Use the elements MCP server. Read the ui-standard-layout skill from scope ui and the page-shell template before changing this page.
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Useful MCP calls for agents:
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
list_skill_scopes()
|
|
228
|
+
list_project_skills(scope="ui")
|
|
229
|
+
read_project_skill(scope="ui", skill_name="ui-standard-layout")
|
|
230
|
+
list_skill_templates(scope="ui", skill_name="ui-standard-layout")
|
|
231
|
+
read_skill_template(scope="ui", skill_name="ui-standard-layout", template_name="page-shell.template.mdx")
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Updating Users To A New Version
|
|
235
|
+
|
|
236
|
+
Publish a new package version, then users upgrade their dedicated environment:
|
|
237
|
+
|
|
238
|
+
```powershell
|
|
239
|
+
C:\Tools\elements-mcp\.venv\Scripts\python.exe -m pip install --upgrade --index-url https://your-private-pypi.example/repository/pypi-internal/simple elements-mcp==0.2.0
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Restart Codex after upgrading.
|
|
243
|
+
|
|
244
|
+
If a user needs to roll back:
|
|
245
|
+
|
|
246
|
+
```powershell
|
|
247
|
+
C:\Tools\elements-mcp\.venv\Scripts\python.exe -m pip install --force-reinstall --index-url https://your-private-pypi.example/repository/pypi-internal/simple elements-mcp==0.1.0
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Adding New Skills
|
|
251
|
+
|
|
252
|
+
Add shared content under:
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
src/elements_mcp/content/skills/<scope>/<skill-name>/
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Required:
|
|
259
|
+
|
|
260
|
+
```text
|
|
261
|
+
SKILL.md
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Optional:
|
|
265
|
+
|
|
266
|
+
```text
|
|
267
|
+
templates/*.template.mdx
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Example:
|
|
271
|
+
|
|
272
|
+
```text
|
|
273
|
+
src/elements_mcp/content/skills/ui/new-skill/
|
|
274
|
+
SKILL.md
|
|
275
|
+
templates/
|
|
276
|
+
example.template.mdx
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Then run:
|
|
280
|
+
|
|
281
|
+
```powershell
|
|
282
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
283
|
+
.\.venv\Scripts\python.exe -m build
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Content Rules
|
|
287
|
+
|
|
288
|
+
- Keep this server read-only.
|
|
289
|
+
- Do not add tools that write files or execute shell commands.
|
|
290
|
+
- Add new shared project guidance under `src/elements_mcp/content/skills/<scope>/<skill-name>`.
|
|
291
|
+
- Each skill directory must contain `SKILL.md`.
|
|
292
|
+
- Optional templates belong under `templates/` inside the skill directory.
|
|
293
|
+
- Use safe names with letters, numbers, dots, underscores, and hyphens only.
|
|
294
|
+
- Pin released package versions for users, such as `elements-mcp==0.1.0`.
|
|
295
|
+
|
|
296
|
+
## Troubleshooting
|
|
297
|
+
|
|
298
|
+
`No module named elements_mcp`:
|
|
299
|
+
|
|
300
|
+
The Codex config is pointing at a Python environment where `elements-mcp` is not installed. Use the Python path from the dedicated virtual environment.
|
|
301
|
+
|
|
302
|
+
`No module named fastmcp`:
|
|
303
|
+
|
|
304
|
+
The package was not installed with dependencies. Reinstall with `pip install elements-mcp==<version>` instead of copying source files manually.
|
|
305
|
+
|
|
306
|
+
`/mcp` does not show `elements`:
|
|
307
|
+
|
|
308
|
+
Restart Codex after editing `config.toml`, then check that the configured `command` path exists.
|
|
309
|
+
|
|
310
|
+
Server starts then exits:
|
|
311
|
+
|
|
312
|
+
Run the configured command manually:
|
|
313
|
+
|
|
314
|
+
```powershell
|
|
315
|
+
C:\Tools\elements-mcp\.venv\Scripts\python.exe -m elements_mcp.server
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
If it reports import errors, reinstall the package in that virtual environment.
|
|
319
|
+
|
|
320
|
+
## References
|
|
321
|
+
|
|
322
|
+
- Codex MCP configuration: `~/.codex/config.toml`, `[mcp_servers.<name>]`, `/mcp`, and `codex mcp list`
|
|
323
|
+
- FastMCP packaging dependency: `fastmcp==3.0.0`
|