fds-mcp-server 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.
Files changed (151) hide show
  1. fds_mcp_server-0.1.0/.editorconfig +16 -0
  2. fds_mcp_server-0.1.0/.env.example +8 -0
  3. fds_mcp_server-0.1.0/.gitattributes +1 -0
  4. fds_mcp_server-0.1.0/.github/ISSUE_TEMPLATE/bug.md +10 -0
  5. fds_mcp_server-0.1.0/.github/ISSUE_TEMPLATE/feature.md +10 -0
  6. fds_mcp_server-0.1.0/.github/dependabot.yml +16 -0
  7. fds_mcp_server-0.1.0/.github/pull_request_template.md +11 -0
  8. fds_mcp_server-0.1.0/.github/workflows/ci.yml +45 -0
  9. fds_mcp_server-0.1.0/.github/workflows/publish.yml +38 -0
  10. fds_mcp_server-0.1.0/.gitignore +20 -0
  11. fds_mcp_server-0.1.0/.pre-commit-config.yaml +21 -0
  12. fds_mcp_server-0.1.0/.python-version +1 -0
  13. fds_mcp_server-0.1.0/AGENTS.md +337 -0
  14. fds_mcp_server-0.1.0/CLAUDE.md +1 -0
  15. fds_mcp_server-0.1.0/CONTRIBUTING.md +12 -0
  16. fds_mcp_server-0.1.0/LICENSE +24 -0
  17. fds_mcp_server-0.1.0/PKG-INFO +227 -0
  18. fds_mcp_server-0.1.0/README.fr.md +205 -0
  19. fds_mcp_server-0.1.0/README.md +200 -0
  20. fds_mcp_server-0.1.0/SECURITY.md +14 -0
  21. fds_mcp_server-0.1.0/docs/adr/0001-fastmcp-on-mcp-1x.fr.md +12 -0
  22. fds_mcp_server-0.1.0/docs/adr/0001-fastmcp-on-mcp-1x.md +12 -0
  23. fds_mcp_server-0.1.0/docs/adr/0002-own-namelist-parser.fr.md +14 -0
  24. fds_mcp_server-0.1.0/docs/adr/0002-own-namelist-parser.md +13 -0
  25. fds_mcp_server-0.1.0/docs/adr/0003-client-neutral-tools-and-http.fr.md +20 -0
  26. fds_mcp_server-0.1.0/docs/adr/0003-client-neutral-tools-and-http.md +17 -0
  27. fds_mcp_server-0.1.0/pyproject.toml +97 -0
  28. fds_mcp_server-0.1.0/scripts/extract_namelists.py +75 -0
  29. fds_mcp_server-0.1.0/src/fds_mcp/__init__.py +1 -0
  30. fds_mcp_server-0.1.0/src/fds_mcp/config.py +22 -0
  31. fds_mcp_server-0.1.0/src/fds_mcp/data/guide/best_practices.md +43 -0
  32. fds_mcp_server-0.1.0/src/fds_mcp/data/guide/common_errors.md +16 -0
  33. fds_mcp_server-0.1.0/src/fds_mcp/data/guide/mesh_resolution.md +40 -0
  34. fds_mcp_server-0.1.0/src/fds_mcp/data/guide/outputs.md +16 -0
  35. fds_mcp_server-0.1.0/src/fds_mcp/data/guide/workflow.md +21 -0
  36. fds_mcp_server-0.1.0/src/fds_mcp/data/namelists.json +1328 -0
  37. fds_mcp_server-0.1.0/src/fds_mcp/fires.py +195 -0
  38. fds_mcp_server-0.1.0/src/fds_mcp/geometry.py +260 -0
  39. fds_mcp_server-0.1.0/src/fds_mcp/guide.py +45 -0
  40. fds_mcp_server-0.1.0/src/fds_mcp/http.py +92 -0
  41. fds_mcp_server-0.1.0/src/fds_mcp/outfile.py +165 -0
  42. fds_mcp_server-0.1.0/src/fds_mcp/parser.py +268 -0
  43. fds_mcp_server-0.1.0/src/fds_mcp/reference.py +57 -0
  44. fds_mcp_server-0.1.0/src/fds_mcp/results.py +233 -0
  45. fds_mcp_server-0.1.0/src/fds_mcp/server.py +126 -0
  46. fds_mcp_server-0.1.0/src/fds_mcp/summary.py +184 -0
  47. fds_mcp_server-0.1.0/src/fds_mcp/tools/__init__.py +21 -0
  48. fds_mcp_server-0.1.0/src/fds_mcp/tools/common.py +33 -0
  49. fds_mcp_server-0.1.0/src/fds_mcp/tools/guide.py +45 -0
  50. fds_mcp_server-0.1.0/src/fds_mcp/tools/inputs.py +65 -0
  51. fds_mcp_server-0.1.0/src/fds_mcp/tools/paths.py +84 -0
  52. fds_mcp_server-0.1.0/src/fds_mcp/tools/results.py +74 -0
  53. fds_mcp_server-0.1.0/src/fds_mcp/tools/simulation.py +95 -0
  54. fds_mcp_server-0.1.0/src/fds_mcp/validation.py +519 -0
  55. fds_mcp_server-0.1.0/tests/__init__.py +0 -0
  56. fds_mcp_server-0.1.0/tests/conftest.py +57 -0
  57. fds_mcp_server-0.1.0/tests/data/LICENSE-NIST.md +5 -0
  58. fds_mcp_server-0.1.0/tests/data/README.md +19 -0
  59. fds_mcp_server-0.1.0/tests/data/inputs/Fires/HoC_Ideal.fds +15 -0
  60. fds_mcp_server-0.1.0/tests/data/inputs/Fires/HoC_NonIdeal.fds +14 -0
  61. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away1.fds +51 -0
  62. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away10.fds +53 -0
  63. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away11.fds +58 -0
  64. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away2.fds +60 -0
  65. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away3.fds +56 -0
  66. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away4.fds +63 -0
  67. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away5.fds +60 -0
  68. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away6.fds +75 -0
  69. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away7.fds +46 -0
  70. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away8.fds +63 -0
  71. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away9.fds +70 -0
  72. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away_2D.fds +52 -0
  73. fds_mcp_server-0.1.0/tests/data/inputs/Fires/box_burn_away_2D_residue.fds +65 -0
  74. fds_mcp_server-0.1.0/tests/data/inputs/Fires/circular_burner.fds +25 -0
  75. fds_mcp_server-0.1.0/tests/data/inputs/Fires/couch.fds +80 -0
  76. fds_mcp_server-0.1.0/tests/data/inputs/Fires/fire_const_gamma.fds +31 -0
  77. fds_mcp_server-0.1.0/tests/data/inputs/Fires/ftp.fds +46 -0
  78. fds_mcp_server-0.1.0/tests/data/inputs/Fires/simple_test.fds +21 -0
  79. fds_mcp_server-0.1.0/tests/data/inputs/Fires/spray_burner.fds +79 -0
  80. fds_mcp_server-0.1.0/tests/data/inputs/Fires/tmp_lower_limit_default.fds +52 -0
  81. fds_mcp_server-0.1.0/tests/data/inputs/Fires/tmp_lower_limit_simple.fds +27 -0
  82. fds_mcp_server-0.1.0/tests/data/inputs/Fires/tunnel_const_gamma.fds +36 -0
  83. fds_mcp_server-0.1.0/tests/data/inputs/Fires/tunnel_linear_cp.fds +45 -0
  84. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/blasius_128.fds +37 -0
  85. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/blasius_16.fds +33 -0
  86. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/blasius_32.fds +32 -0
  87. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/blasius_64.fds +33 -0
  88. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/cyl_test_1.fds +10 -0
  89. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/cyl_test_2.fds +10 -0
  90. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/cyl_test_3.fds +14 -0
  91. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/cyl_test_4.fds +14 -0
  92. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/divergence_test_1.fds +32 -0
  93. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/divergence_test_2.fds +24 -0
  94. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/divergence_test_3.fds +35 -0
  95. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/gas_filling.fds +17 -0
  96. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/helium_1d_const_gamma.fds +38 -0
  97. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/helium_1d_isothermal.fds +38 -0
  98. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/helium_2d_isothermal.fds +32 -0
  99. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/helium_air_jet_floor.fds +31 -0
  100. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/hole.fds +35 -0
  101. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/hot_layer_360.fds +111 -0
  102. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/jet_fan.fds +32 -0
  103. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/mass_heat_wall_device_test.fds +38 -0
  104. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/mass_heat_wall_device_test_2.fds +38 -0
  105. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/mwtest_cfl.fds +29 -0
  106. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/no_hole.fds +31 -0
  107. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/parabolic_profile.fds +25 -0
  108. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/particle_offgas_1.fds +28 -0
  109. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/particle_offgas_2.fds +31 -0
  110. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/particle_offgas_3.fds +30 -0
  111. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/particle_offgas_4.fds +30 -0
  112. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/realizable_mass_fractions.fds +36 -0
  113. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/simple_duct.fds +42 -0
  114. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/species_conservation_1.fds +24 -0
  115. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/species_conservation_2.fds +30 -0
  116. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/species_conservation_3.fds +52 -0
  117. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/species_conservation_4.fds +55 -0
  118. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/symmetry_test.fds +42 -0
  119. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/symmetry_test_2.fds +45 -0
  120. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/symmetry_test_mpi.fds +44 -0
  121. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/tangential_velocity.fds +30 -0
  122. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/uniform_shear_dudy.fds +28 -0
  123. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/uniform_shear_dudz.fds +28 -0
  124. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/uniform_shear_dvdz.fds +28 -0
  125. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/velocity_bc_test.fds +65 -0
  126. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/volume_flow_1.fds +16 -0
  127. fds_mcp_server-0.1.0/tests/data/inputs/Flowfields/volume_flow_2.fds +16 -0
  128. fds_mcp_server-0.1.0/tests/data/inputs/Validation/ATF_Corridors_050_kW.fds +261 -0
  129. fds_mcp_server-0.1.0/tests/data/inputs/Validation/FM_15cm_Burner_C3H8_2cm.fds +78 -0
  130. fds_mcp_server-0.1.0/tests/data/out/abridged.out +17 -0
  131. fds_mcp_server-0.1.0/tests/data/out/completed.out +77 -0
  132. fds_mcp_server-0.1.0/tests/data/out/instability.out +17 -0
  133. fds_mcp_server-0.1.0/tests/data/out/running.out +23 -0
  134. fds_mcp_server-0.1.0/tests/data/results/ATF_Corridors_050_kW_devc.csv +63 -0
  135. fds_mcp_server-0.1.0/tests/data/results/ATF_Corridors_050_kW_git.txt +1 -0
  136. fds_mcp_server-0.1.0/tests/data/results/FM_15cm_Burner_C3H8_2cm_devc.csv +68 -0
  137. fds_mcp_server-0.1.0/tests/data/results/FM_15cm_Burner_C3H8_2cm_git.txt +1 -0
  138. fds_mcp_server-0.1.0/tests/data/results/FM_15cm_Burner_C3H8_2cm_hrr.csv +68 -0
  139. fds_mcp_server-0.1.0/tests/test_fires.py +75 -0
  140. fds_mcp_server-0.1.0/tests/test_geometry.py +70 -0
  141. fds_mcp_server-0.1.0/tests/test_guide.py +23 -0
  142. fds_mcp_server-0.1.0/tests/test_http.py +95 -0
  143. fds_mcp_server-0.1.0/tests/test_outfile.py +76 -0
  144. fds_mcp_server-0.1.0/tests/test_parser.py +141 -0
  145. fds_mcp_server-0.1.0/tests/test_reference.py +30 -0
  146. fds_mcp_server-0.1.0/tests/test_results.py +133 -0
  147. fds_mcp_server-0.1.0/tests/test_server.py +67 -0
  148. fds_mcp_server-0.1.0/tests/test_summary.py +54 -0
  149. fds_mcp_server-0.1.0/tests/test_tools.py +222 -0
  150. fds_mcp_server-0.1.0/tests/test_validation.py +195 -0
  151. fds_mcp_server-0.1.0/uv.lock +2017 -0
@@ -0,0 +1,16 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 4
10
+
11
+ [*.{yml,yaml,json,toml,md}]
12
+ indent_size = 2
13
+
14
+ [tests/data/**]
15
+ trim_trailing_whitespace = false
16
+ insert_final_newline = false
@@ -0,0 +1,8 @@
1
+ # Workspace: only files inside this folder can be read by the tools.
2
+ # Optional for stdio, defaults to the current folder for --http.
3
+ FDS_MCP_WORKSPACE=
4
+ # Bearer token required by the HTTP transport (--http), at least 16 characters.
5
+ # Generate one with: python -c "import secrets; print(secrets.token_urlsafe(32))"
6
+ FDS_MCP_TOKEN=
7
+ # Planned for fds_run_simulation (not implemented yet): FDS executable (default: fds on PATH).
8
+ # FDS_EXECUTABLE=fds
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: Bug
3
+ about: Something does not work as expected
4
+ ---
5
+
6
+ **What happened** (tool, input file excerpt, output)
7
+
8
+ **What was expected**
9
+
10
+ **Acceptance criteria**
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: Feature
3
+ about: A new tool or check
4
+ ---
5
+
6
+ **Need**
7
+
8
+ **Proposal**
9
+
10
+ **Acceptance criteria**
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: uv
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ groups:
8
+ python:
9
+ patterns: ["*"]
10
+ - package-ecosystem: github-actions
11
+ directory: /
12
+ schedule:
13
+ interval: weekly
14
+ groups:
15
+ actions:
16
+ patterns: ["*"]
@@ -0,0 +1,11 @@
1
+ ## Why
2
+
3
+ <!-- Closes #… -->
4
+
5
+ ## What
6
+
7
+ ## Verified
8
+
9
+ - [ ] `uv run poe check` (ruff, pyright, pytest)
10
+
11
+ ## To test by a human
@@ -0,0 +1,45 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ check:
13
+ name: Checks (${{ matrix.os }}, Python ${{ matrix.python }})
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ os: [ubuntu-latest, windows-latest]
19
+ python: ["3.10", "3.13"]
20
+ steps:
21
+ - uses: actions/checkout@v7
22
+ - uses: astral-sh/setup-uv@v7
23
+ with:
24
+ python-version: ${{ matrix.python }}
25
+ - run: uv sync --locked
26
+ - run: uv run ruff check .
27
+ - run: uv run ruff format --check .
28
+ - run: uv run pyright
29
+ - run: uv run pytest --cov
30
+ - name: Build and run the package as uvx would
31
+ shell: bash
32
+ run: |
33
+ uv build
34
+ uvx --from "$(ls dist/*.whl)" fds-mcp-server --version
35
+
36
+ secrets:
37
+ name: Secret scan
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v7
41
+ with:
42
+ fetch-depth: 0
43
+ - uses: gitleaks/gitleaks-action@v3
44
+ env:
45
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,38 @@
1
+ name: Publish to PyPI
2
+
3
+ # Runs when a GitHub release is published. PyPI must first trust this workflow:
4
+ # pypi.org > Account > Publishing > add a pending publisher for project
5
+ # "fds-mcp-server", repository Skitourer/fds-mcp-server, workflow publish.yml, environment pypi.
6
+ on:
7
+ release:
8
+ types: [published]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+ - uses: astral-sh/setup-uv@v7
19
+ - run: uv build
20
+ - name: Smoke test the wheel as uvx would run it
21
+ run: uvx --from "$(ls dist/*.whl)" fds-mcp-server --version
22
+ - uses: actions/upload-artifact@v7
23
+ with:
24
+ name: dist
25
+ path: dist/
26
+
27
+ publish:
28
+ needs: build
29
+ runs-on: ubuntu-latest
30
+ environment: pypi
31
+ permissions:
32
+ id-token: write # trusted publishing (OIDC), no API token stored
33
+ steps:
34
+ - uses: actions/download-artifact@v8
35
+ with:
36
+ name: dist
37
+ path: dist/
38
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,20 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ build/
5
+ dist/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .coverage
10
+ coverage.xml
11
+ htmlcov/
12
+ .env
13
+ # FDS run outputs created next to inputs (tests/data keeps its curated files)
14
+ *.smv
15
+ *.sf
16
+ *.bf
17
+ *.s3d
18
+ *.prt5
19
+ *.restart
20
+ *.stop
@@ -0,0 +1,21 @@
1
+ # Same checks as CI. Install once with: uv run pre-commit install
2
+ exclude: ^tests/data/
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: end-of-file-fixer
8
+ - id: trailing-whitespace
9
+ - id: check-yaml
10
+ - id: check-toml
11
+ - id: check-added-large-files
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.17.6
14
+ hooks:
15
+ - id: ruff-check
16
+ args: [--fix]
17
+ - id: ruff-format
18
+ - repo: https://github.com/gitleaks/gitleaks
19
+ rev: v8.30.1
20
+ hooks:
21
+ - id: gitleaks
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,337 @@
1
+ # Agent instructions
2
+
3
+ Single source of truth for every coding agent (Claude Code, Codex, Copilot…); `CLAUDE.md`
4
+ only contains `@AGENTS.md`. Copied from the `skitourer/agent-conventions` template; the
5
+ last two sections are specific to fds-mcp. Written in English to save tokens; talk to the
6
+ user in French.
7
+
8
+ ## 1. Language
9
+
10
+ - Code, comments, docstrings, file names, commits, PRs/MRs, issues: English.
11
+ - Docs are bilingual: English is the source, French a mirror translation updated in the
12
+ same PR (same structure and headings).
13
+ - Chat with the user: French, concise, conclusion first, no recap of what is already
14
+ known; explain the technical "why" only when it helps a decision.
15
+ - Each project keeps a glossary (Project specifics); use its terms everywhere, no synonyms.
16
+ - User-facing app texts are never hard-coded: they live in translation resources, using
17
+ the stack's standard i18n mechanism (chosen with an ADR), so a new language needs no
18
+ code change.
19
+
20
+ ## 2. Code conventions
21
+
22
+ Tools enforce style; this file only holds what tools cannot check. Every repo has
23
+ `.editorconfig`, pre-commit hooks, and CI running the same checks.
24
+
25
+ | Language | Format | Analysis | Tests | Notes |
26
+ |---|---|---|---|---|
27
+ | Python | ruff format | ruff, pyright strict | pytest | type hints everywhere; uv only (no pip, no global env) |
28
+ | TypeScript / Svelte | prettier | TS `strict`, svelte-check | vitest | no ESLint unless needed |
29
+ | JavaScript (no build) | prettier | `tsc` `checkJs` + `strict`, types in JSDoc | vitest | ES modules served as is; `@types/*` for libraries |
30
+ | C / C++ | clang-format | clang-tidy; `-Wall -Wextra` as errors in CI | GoogleTest + CTest | CMake; sanitizers (address, undefined) in tests |
31
+ | Shell | shfmt | shellcheck | bats | `#!/usr/bin/env bash`, `set -euo pipefail`; beyond ~100 lines, use Python |
32
+ | PHP | PHP-CS-Fixer (PER-CS) | PHPStan | PHPUnit | `declare(strict_types=1);`, Composer |
33
+ | End-to-end | | | Playwright | |
34
+
35
+ **Unlisted language**: before writing the first file, propose the community-standard
36
+ formatter, linter, dependency manager and test framework; once approved, add a row here
37
+ (in the project and in this template).
38
+
39
+ - Readable without context: explicit names, no abbreviations except universal ones
40
+ (`id`, `url`).
41
+ - Small single-purpose functions; ~40 lines is a cue to split, not a hard limit.
42
+ - Comments explain **why** (business rule, source, workaround), never what. Numeric rules
43
+ cite their source.
44
+ - Docstring for modules and public functions (one sentence is enough).
45
+ - No dead or commented-out code: git remembers.
46
+ - Business logic is pure (no DB, network or files) in its own module; it gets the most
47
+ tests.
48
+ - Configuration through environment variables (12-factor), each documented in
49
+ `.env.example`.
50
+ - Simple first: no abstraction before two real uses. Every new dependency is justified
51
+ (maintenance, licence, weight); prefer the standard library.
52
+ - Fail early: validate inputs at boundaries; never swallow errors (no bare `except`).
53
+
54
+ ## 3. Repository
55
+
56
+ Rules apply to GitHub and GitLab ("PR" also means MR).
57
+
58
+ - GitHub Flow: `main` is always releasable and protected. Short branches named
59
+ `<type>/<short-description>`. One PR = one topic; it references its issue
60
+ (`Closes #12`) and states why, what was verified, and what a human must test.
61
+ - Squash merge; the PR title becomes the commit message.
62
+ - Conventional Commits: `feat`, `fix`, `docs`, `refactor`, `test`, `perf`, `ci`, `build`,
63
+ `chore`; `!` or `BREAKING CHANGE:` for breaking changes.
64
+ - Issues: clear title and acceptance criteria. Use existing labels; never create labels
65
+ without approval.
66
+ - Standard files: README, LICENSE, CONTRIBUTING, SECURITY, CHANGELOG (generated),
67
+ `.gitignore`, `.editorconfig`, `.gitattributes`, `.env.example`, short issue and PR/MR
68
+ templates.
69
+ - Licence: always ask the user, never pick a default.
70
+ - Never commit secrets, `.env` files or personal data.
71
+
72
+ | | GitHub | GitLab |
73
+ |---|---|---|
74
+ | CI | Actions | GitLab CI |
75
+ | Dependency updates | Dependabot | Renovate |
76
+ | Releases and CHANGELOG | release-please | semantic-release or release-please CLI |
77
+ | Static security analysis | CodeQL | SAST template (Semgrep) |
78
+
79
+ ### Repository settings
80
+
81
+ Propose them when a repository is created, apply them once approved:
82
+
83
+ - Squash merge only, PR title as message; delete branch after merge.
84
+ - Protected `main`: required CI checks, linear history, no force push, no deletion.
85
+ - Secret scanning and push protection; dependency alerts and security updates;
86
+ CodeQL (GitHub) or SAST (GitLab).
87
+ - Private vulnerability reporting on (SECURITY.md points to it).
88
+ - CI tokens read-only by default; CI cannot approve PRs.
89
+ - Unused features off (wiki, projects…).
90
+ - GitLab: protected branches, "Pipelines must succeed", squash required, delete source
91
+ branch.
92
+
93
+ ## 4. Confidentiality
94
+
95
+ - Before the first commit of a repo, **ask whether it is personal or professional**.
96
+ Never infer it from the folder or the forge.
97
+ - Personal: repo-local git identity, never the global one:
98
+ `git config user.name "Skitourer"` and
99
+ `git config user.email "149181038+Skitourer@users.noreply.github.com"`; check with
100
+ `git config --show-origin user.email`.
101
+ - Professional: keep the machine's professional identity.
102
+ - Personal projects: no professional login, email or machine name in commits, PRs,
103
+ issues, code, docs, screenshots or published logs. No absolute local paths
104
+ (`C:\Users\…`) in committed files, ever.
105
+ - Tests, examples and docs use fictitious data only.
106
+ - Secrets live only in `.env` (git-ignored) and forge secrets; never printed in logs or CI.
107
+ - Secret detection in every repo: gitleaks as a pre-commit hook and in CI (full history,
108
+ `fetch-depth: 0`); on GitHub also secret scanning and push protection.
109
+ - A committed secret is revoked immediately; rewriting history is not enough.
110
+ - No professional code or data in personal projects, and vice versa. No project data sent
111
+ to external services (online converters, pastebins, third-party APIs) without approval.
112
+ - Professional restrictions: none yet. List here the repos, code or data agents must not
113
+ process.
114
+ - AI use: agent commits keep the `Co-Authored-By: Claude …` trailer; the README states
115
+ the project is developed with Claude's help.
116
+
117
+ ## 5. Security
118
+
119
+ Based on OWASP Top 10 and ASVS level 1; applies to anything reachable over a network.
120
+
121
+ - Inputs: validated at boundaries with schemas (pydantic, zod…); parameterised queries or
122
+ ORM; never build shell commands from user data.
123
+ - Outputs: rely on framework escaping (no `{@html}` or `innerHTML` with user data); errors
124
+ returned to clients carry no stack trace or internals.
125
+ - Accounts: argon2 or scrypt hashing; rate-limited login; cookies `HttpOnly`, `Secure`,
126
+ `SameSite`; CSRF protection; authorisation checked server-side on every route, never
127
+ only in the UI.
128
+ - **Two-factor authentication: whenever a project manages accounts, ask the user whether
129
+ to support 2FA (TOTP, passkeys). The user decides.**
130
+ - Web: HTTPS only; security headers (CSP, HSTS, `X-Content-Type-Options`,
131
+ `frame-ancestors`); restrictive CORS; request and upload size limits.
132
+ - Least privilege: containers run as non-root on minimal images; CI tokens read-only by
133
+ default; service accounts narrowly scoped.
134
+ - Logs: no passwords, tokens or personal data.
135
+ - CI: dependency audit (pip-audit, npm audit) and static security analysis (ruff `S`
136
+ rules, CodeQL or Semgrep).
137
+ - C / C++: sanitizers in tests; no unbounded functions (`strcpy`, `sprintf`, `gets`).
138
+ - Before releasing a network-facing feature, the agent runs a security review of the diff.
139
+
140
+ ## 6. Quality and tests
141
+
142
+ - New or changed business rule → unit tests. Bug fix → first a failing test that
143
+ reproduces it.
144
+ - API or CLI → integration tests (temporary database, no network).
145
+ - End-to-end tests (Playwright) only for apps whose UI is used by others than the
146
+ developer: a few critical paths.
147
+ - Tests are fast (under a minute in total) and deterministic: no network, fixed dates and
148
+ seeds, fictitious data.
149
+ - Coverage is a CI floor (**80 % by default**), not a goal.
150
+ - Before saying "done": run the same checks as CI and report real results, failures
151
+ included; check UI changes in a real browser (screenshot); review the own diff; the PR
152
+ lists what a human must test.
153
+ - Automated dependency updates, grouped weekly; security alerts and fixes on.
154
+
155
+ ## 7. Documentation
156
+
157
+ - Updated in the same PR as the code it describes.
158
+ - Light Diátaxis: Guide (install, use) · Technical (architecture, algorithms, API, data) ·
159
+ Operations (deploy, backup, upgrade) · Contributing · Decisions (ADR).
160
+ - The agent writes an ADR for every structural choice (major dependency, architecture,
161
+ data format): context, decision, consequences, rejected alternatives, ~10 lines.
162
+ - Diagrams in Mermaid. API references are generated (OpenAPI, docstrings), never copied
163
+ by hand; for a new project, ask whether to generate one from docstrings (mkdocstrings).
164
+ - MkDocs Material for all docs, on GitHub and GitLab alike (no forge wiki); strict build
165
+ in CI, published on GitHub or GitLab Pages. Bilingual with mkdocs-static-i18n
166
+ (`page.md` English, `page.fr.md` mirror). C / C++: Doxygen for the API reference.
167
+ - README: what and for whom, a screenshot, quick start in ≤ 5 commands, links to the
168
+ docs, licence, "developed with the help of Claude".
169
+
170
+ ## 8. Environment
171
+
172
+ - Windows 11 with Git Bash and PowerShell. Documented commands work on Windows and Linux;
173
+ tooling in Python rather than shell beyond a few lines.
174
+ - `.gitattributes` with `* text=auto eol=lf`. Pinned tool versions (`.python-version`,
175
+ `engines` in `package.json`, compiler in CMake).
176
+ - Task runners: poe (Python), npm scripts, CMake presets. No Makefile.
177
+ - Docker and dev containers are optional.
178
+ - At the end of each coding session, restart the app's local servers and give the URLs.
179
+ Check that a port is free first; never kill a process the agent did not start.
180
+ - Scratch files, one-off scripts, screenshots and downloads go to the session's temporary
181
+ directory, never into the repo.
182
+
183
+ ### Ask at the start of a new project
184
+
185
+ Personal or professional · Linux environments to use (access, what is allowed) ·
186
+ professional network (proxy, corporate certificates, internal mirrors) · licence ·
187
+ generated API reference · deliverables · 2FA if there are accounts · repository settings.
188
+ Record the answers in Project specifics.
189
+
190
+ ## 9. Agent autonomy
191
+
192
+ **Without asking**: read, search, run tests, linters and local servers; edit code on a
193
+ work branch and commit locally; install already-declared dependencies (`uv sync`,
194
+ `npm ci`).
195
+
196
+ **Propose, then wait for approval.** The user will not think to ask: the agent proposes
197
+ at the right time ("the branch is ready, shall I push and open the PR?"), then acts once
198
+ approved. An approval covers the proposed action only.
199
+
200
+ - Push a branch, open a PR or MR; merge it.
201
+ - Create an issue.
202
+ - Add, remove or major-upgrade a dependency.
203
+ - Make a structural choice (with an ADR).
204
+ - Change CI, workflows or quality tools.
205
+ - Delete files or data the agent did not create.
206
+ - Extend the scope: extra ideas are proposed separately, never slipped into the PR.
207
+ - Sensitive actions, proposed with their consequences and what is irreversible: release,
208
+ tag, direct push to `main`, force push, history rewrite, deleting remote branches, repo
209
+ settings, branch protection, secrets, production or remote servers, writing outside the
210
+ project repo (other repos, external issues, online services).
211
+
212
+ **Way of working**
213
+
214
+ - For a decision that belongs to the user, give an argued recommendation, not a neutral
215
+ list of options.
216
+ - When blocked (permission denied, missing tool), explain and ask; never work around it.
217
+ - End of session: what was done, what was verified, what remains to test or decide.
218
+
219
+ **Token economy, without losing quality**
220
+
221
+ - Instruction files stay short and factual; nothing a tool already enforces.
222
+ - Read targeted excerpts (search, line ranges) rather than whole files; do not re-read a
223
+ file just edited.
224
+ - Filter long outputs (logs, CI) before reading them.
225
+ - Subagents only for truly parallel or large work.
226
+ - Do not repeat what is already established in the conversation.
227
+ - Never cut verification (tests, CI, screenshots) to save tokens.
228
+
229
+ ## 10. Releases and deployment
230
+
231
+ - SemVer derived from Conventional Commits (`fix` → patch, `feat` → minor, breaking →
232
+ major). release-please (GitHub) or semantic-release (GitLab) maintains a release PR and
233
+ the CHANGELOG; merging it publishes the release.
234
+ - The release bot uses a dedicated identity (GitHub App, GitLab project token), never the
235
+ user's account.
236
+ - Deliverables: an app is a Docker image on the forge registry, tagged with the version
237
+ and `latest`, multi-arch if needed; a library goes to PyPI or npm (or an internal
238
+ mirror); anything else is defined with the user.
239
+ - Deployment documented step by step: install, upgrade, backup, restore, rollback.
240
+ Configuration through environment variables, one `.env` per environment, never
241
+ versioned. Automated backups; restore tested at least once. Internet exposure only
242
+ behind HTTPS.
243
+
244
+ ## Project exceptions
245
+
246
+ - **Tool output language**: MCP tool results (messages, summaries) are in English and are
247
+ not translated resources (§1): their reader is an LLM client, which answers the user in
248
+ the user's language. No i18n layer is needed.
249
+ - **Documentation site**: MkDocs Material (§7) is not set up yet; until then the docs are
250
+ `README.md` / `README.fr.md` and `docs/adr/`.
251
+
252
+ ## Project specifics
253
+
254
+ ### Overview
255
+
256
+ MCP server (Python, FastMCP from the official `mcp` SDK 1.x) for Fire Dynamics Simulator
257
+ (FDS, NIST), usable from **any MCP client** (Claude, Copilot/VS Code, Cursor, ChatGPT,
258
+ Gemini CLI, local models). It validates and summarises `.fds` input files, reads
259
+ `_hrr.csv` / `_devc.csv` results and serves an FDS modelling guide. Running FDS
260
+ (`fds_run_simulation`, `fds_get_status`, `fds_stop_simulation`) is stubbed: FDS is not
261
+ installed in cloud sessions; execution will be developed on the user's Windows PC.
262
+ PyPI distribution: `fds-mcp-server` (`fds-mcp` is taken); commands `fds-mcp-server` and
263
+ `fds-mcp`.
264
+
265
+ Client-neutral rules (ADR 0003), for every new tool:
266
+
267
+ - a tool, never only a resource or prompt; name prefixed `fds_`; few tools;
268
+ - simple typed parameters, `Literal` enums instead of free text;
269
+ - self-contained description (Google-style docstring, dedented by `tools/common.tool`)
270
+ that names no particular client;
271
+ - errors raised as `ToolError` that say what to do next; compact structured output with
272
+ bounded lists;
273
+ - paths go through `PathPolicy` (workspace confinement); no tool accepts a command line.
274
+
275
+ ### Commands
276
+
277
+ ```bash
278
+ uv sync # install (dev group included)
279
+ uv run fds-mcp # stdio server
280
+ FDS_MCP_TOKEN=... uv run fds-mcp --http --workspace DIR # HTTP server on 127.0.0.1:8000/mcp
281
+ uv run mcp dev src/fds_mcp/server.py # MCP Inspector on the working copy
282
+ uv run poe check # lint + format check + pyright + tests (same as CI)
283
+ uv run poe format # format
284
+ uv build # wheel + sdist (published by .github/workflows/publish.yml)
285
+ uv run python scripts/extract_namelists.py <fds>/Source FDS-x.y.z # refresh reference
286
+ ```
287
+
288
+ ### Layout
289
+
290
+ ```
291
+ src/fds_mcp/
292
+ parser.py namelist records -> NamelistRecord(group, params, line)
293
+ reference.py known groups/parameters (data/namelists.json, from FDS Source/*.f90)
294
+ geometry.py meshes, MULT expansion, boxes
295
+ fires.py burning surfaces, HRR estimate, D*/dx
296
+ validation.py fds_validate_input checks (pure)
297
+ summary.py fds_summarize_input (pure)
298
+ results.py FDS CSV reader (fds_read_results)
299
+ outfile.py CHID.out parser (for fds_get_status)
300
+ guide.py fds_get_guide topics (data/guide/*.md)
301
+ config.py Settings (workspace)
302
+ http.py streamable HTTP app behind the bearer-token middleware
303
+ tools/ MCP layer: common.py (registration), paths.py (workspace), one module
304
+ per tool family
305
+ server.py CLI (stdio default, --http), build_server()
306
+ tests/data/ FDS Verification/Validation inputs, real CSV outputs, synthetic .out
307
+ ```
308
+
309
+ Business logic stays out of `tools/`; tools only check paths and turn exceptions into
310
+ `ToolError`. Tests call tools in process through `FastMCP.call_tool`; the HTTP app is
311
+ tested through `httpx.ASGITransport`.
312
+
313
+ ### Glossary
314
+
315
+ | Term | Meaning |
316
+ |---|---|
317
+ | record | one namelist entry `&GROUP ... /` in a `.fds` file |
318
+ | group | namelist name (`MESH`, `OBST`, …) |
319
+ | parameter | `NAME=value` inside a record; indexed forms like `MATL_ID(1,1)` |
320
+ | CHID | case identifier (`&HEAD CHID`), prefix of every output file |
321
+ | HRR / HRRPUA | heat release rate (kW) / per unit area (kW/m²) |
322
+ | D* | characteristic fire diameter; D*/dx is the mesh-resolution indicator |
323
+ | domain | union of all meshes after `MULT` expansion |
324
+ | issue | one validation finding: level `error` / `warning` / `info`, code, line |
325
+ | workspace | folder outside which tools refuse every path (mandatory for HTTP) |
326
+ | token | `FDS_MCP_TOKEN`, bearer token required by the HTTP transport |
327
+
328
+ ### Start-of-project answers
329
+
330
+ - Personal project (repo-local identity Skitourer / noreply email). Licence: MIT.
331
+ - Environments: cloud sessions (Linux, no FDS) for everything that does not run FDS;
332
+ the user's Windows 11 PC (VS Code) for FDS runs.
333
+ - FDS reference version: FDS-6.11.2 (namelists extracted from its `Source/`).
334
+ - Deliverable: PyPI package `fds-mcp-server`, run with `uvx fds-mcp-server`, published
335
+ by a GitHub release (trusted publishing).
336
+ - Not decided yet: professional network constraints, generated API reference,
337
+ repository settings. 2FA: not applicable (no accounts; HTTP uses a static token).
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -0,0 +1,12 @@
1
+ # Contributing
2
+
3
+ 1. `uv sync`, then `uv run pre-commit install`.
4
+ 2. Branch from `main` as `<type>/<short-description>`; Conventional Commits
5
+ (`feat:`, `fix:`, `docs:`…).
6
+ 3. Business rules go in pure modules (`parser`, `validation`, `fires`…) with unit tests;
7
+ `tools/` stays a thin MCP layer.
8
+ 4. Before opening a PR: `uv run poe check` (same checks as CI).
9
+ 5. Update `README.md` and its French mirror `README.fr.md` in the same PR.
10
+
11
+ To refresh the namelist reference for a new FDS release, see
12
+ `scripts/extract_namelists.py`.
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Skitourer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Files under tests/data/ come from the FDS repositories of NIST and keep their own
24
+ notice: see tests/data/README.md and tests/data/LICENSE-NIST.md.