mcp-isolarcloud 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 (54) hide show
  1. mcp_isolarcloud-0.1.0/.github/dependabot.yml +25 -0
  2. mcp_isolarcloud-0.1.0/.github/workflows/ci.yml +68 -0
  3. mcp_isolarcloud-0.1.0/.github/workflows/release-please.yml +89 -0
  4. mcp_isolarcloud-0.1.0/.gitignore +8 -0
  5. mcp_isolarcloud-0.1.0/.release-please-manifest.json +3 -0
  6. mcp_isolarcloud-0.1.0/CHANGELOG.md +9 -0
  7. mcp_isolarcloud-0.1.0/LICENSE +21 -0
  8. mcp_isolarcloud-0.1.0/PKG-INFO +93 -0
  9. mcp_isolarcloud-0.1.0/README.md +69 -0
  10. mcp_isolarcloud-0.1.0/openapi.json +9607 -0
  11. mcp_isolarcloud-0.1.0/openapi.yaml +7326 -0
  12. mcp_isolarcloud-0.1.0/pyproject.toml +45 -0
  13. mcp_isolarcloud-0.1.0/release-please-config.json +13 -0
  14. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/__init__.py +3 -0
  15. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/__init__.py +1 -0
  16. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/__init__.py +1 -0
  17. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-1-device-type-dictionary-definitions.md +49 -0
  18. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-10-control-parameter-definitions.md +101 -0
  19. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-2-api-error-code-definitions.md +43 -0
  20. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-3-plaintext-api-call-code-example.md +72 -0
  21. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-4-rsa-encryption-code-example.md +57 -0
  22. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-5-aes-encryption-code-example.md +54 -0
  23. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-6-aes-decryption-code-example.md +43 -0
  24. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-7-ciphertext-api-call-code-example.md +56 -0
  25. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-8-api-call-help-instructions.md +22 -0
  26. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/appendix-9-error-code-enumeration.md +87 -0
  27. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-battery-measuring-points.md +41 -0
  28. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-bsc-device-measuring-points.md +14 -0
  29. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-charger-measuring-points.md +19 -0
  30. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-cmu-device-measuring-points.md +15 -0
  31. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-combiner-box-measuring-points.md +36 -0
  32. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-communications-device-measuring-points.md +26 -0
  33. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-communications-module-measuring-points.md +9 -0
  34. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-ems-device-measuring-points.md +18 -0
  35. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-energy-meter-measuring-points.md +47 -0
  36. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-energy-storage-inverter-measuring-points.md +115 -0
  37. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-environment-monitoring-device-measuring-points.md +61 -0
  38. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-ihomemanage-measuring-points.md +13 -0
  39. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-inverter-measuring-points.md +176 -0
  40. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-lc-device-measuring-points.md +16 -0
  41. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-microinverter-measuring-points.md +49 -0
  42. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-pcs-device-measuring-points.md +16 -0
  43. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/common-plant-measuring-points.md +81 -0
  44. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/getting-started-2.md +65 -0
  45. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/getting-started-3.md +65 -0
  46. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/getting-started.md +98 -0
  47. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/live-data-subscription-function-usage-instructions.md +145 -0
  48. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/docs/quick-start.md +395 -0
  49. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/knowledge/documents.json +194 -0
  50. mcp_isolarcloud-0.1.0/src/mcp_isolarcloud/server.py +121 -0
  51. mcp_isolarcloud-0.1.0/tests/test_server.py +39 -0
  52. mcp_isolarcloud-0.1.0/tools/_isc_client.py +86 -0
  53. mcp_isolarcloud-0.1.0/tools/build_openapi.py +153 -0
  54. mcp_isolarcloud-0.1.0/tools/refresh_docs.py +85 -0
@@ -0,0 +1,25 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 5
8
+ commit-message:
9
+ prefix: "chore(deps)"
10
+ labels: ["dependencies", "github-actions"]
11
+ groups:
12
+ github-actions:
13
+ patterns: ["*"]
14
+ - package-ecosystem: "pip"
15
+ directory: "/"
16
+ schedule:
17
+ interval: "weekly"
18
+ open-pull-requests-limit: 5
19
+ commit-message:
20
+ prefix: "chore(deps)"
21
+ prefix-development: "chore(deps-dev)"
22
+ labels: ["dependencies", "python"]
23
+ groups:
24
+ python:
25
+ patterns: ["*"]
@@ -0,0 +1,68 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 10
20
+ steps:
21
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
24
+ with:
25
+ python-version: "3.13"
26
+ enable-cache: true
27
+ cache-dependency-glob: "pyproject.toml"
28
+ - name: Install
29
+ run: |
30
+ uv venv --python 3.13
31
+ uv pip install -e '.[dev]'
32
+ - name: Lint
33
+ run: uv run ruff check src/ tests/ tools/
34
+ - name: Format check
35
+ run: uv run ruff format --check src/ tests/ tools/
36
+ - name: Test
37
+ run: uv run pytest -q
38
+ - name: Build (verify docs are packaged)
39
+ run: |
40
+ uv build
41
+ uv run python -c "import zipfile,glob; w=glob.glob('dist/*.whl')[0]; names=zipfile.ZipFile(w).namelist(); assert any('knowledge/documents.json' in n for n in names), 'knowledge not packaged'; print('knowledge bundled OK')"
42
+
43
+ openapi:
44
+ # Regenerate the OpenAPI spec from the live iSolarCloud doc portal and fail if
45
+ # the committed openapi.json/.yaml are out of date (run tools/build_openapi.py
46
+ # and commit the result).
47
+ runs-on: ubuntu-latest
48
+ timeout-minutes: 10
49
+ steps:
50
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
51
+ - name: Install uv
52
+ uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
53
+ with:
54
+ python-version: "3.13"
55
+ enable-cache: true
56
+ cache-dependency-glob: "pyproject.toml"
57
+ - name: Install tooling
58
+ run: |
59
+ uv venv --python 3.13
60
+ uv pip install -e '.[tools]'
61
+ - name: Regenerate OpenAPI spec
62
+ run: uv run python tools/build_openapi.py
63
+ - name: Verify openapi.json / openapi.yaml are up to date
64
+ run: |
65
+ if ! git diff --exit-code openapi.json openapi.yaml; then
66
+ echo "::error::openapi.json/.yaml are stale. Run 'python tools/build_openapi.py' and commit the result."
67
+ exit 1
68
+ fi
@@ -0,0 +1,89 @@
1
+ name: Release Please
2
+
3
+ # On push to main, release-please maintains a release PR (bumping pyproject.toml
4
+ # and CHANGELOG.md from Conventional Commits). Merging it tags the release and,
5
+ # via the release_created output, publishes to PyPI with trusted publishing.
6
+ #
7
+ # Build/publish are inlined (not a reusable workflow) because PyPI Trusted
8
+ # Publishing does not support reusable workflows.
9
+
10
+ on:
11
+ push:
12
+ branches: [main]
13
+
14
+ permissions:
15
+ contents: write
16
+ pull-requests: write
17
+
18
+ concurrency:
19
+ group: release-please
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ release-please:
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 10
26
+ outputs:
27
+ release_created: ${{ steps.release.outputs.release_created }}
28
+ tag_name: ${{ steps.release.outputs.tag_name }}
29
+ steps:
30
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
31
+ id: release
32
+ with:
33
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
34
+ config-file: release-please-config.json
35
+ manifest-file: .release-please-manifest.json
36
+
37
+ build:
38
+ needs: release-please
39
+ if: ${{ needs.release-please.outputs.release_created == 'true' }}
40
+ runs-on: ubuntu-latest
41
+ timeout-minutes: 10
42
+ steps:
43
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
44
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
45
+ with:
46
+ python-version: "3.13"
47
+ - name: Build distributions
48
+ run: |
49
+ python -m pip install --upgrade pip build
50
+ python -m build
51
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
52
+ with:
53
+ name: release-dists
54
+ path: dist/
55
+
56
+ pypi-publish:
57
+ name: Publish release to PyPI
58
+ needs: build
59
+ runs-on: ubuntu-latest
60
+ timeout-minutes: 10
61
+ environment:
62
+ name: pypi
63
+ url: https://pypi.org/p/mcp-isolarcloud
64
+ permissions:
65
+ id-token: write
66
+ steps:
67
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
68
+ with:
69
+ name: release-dists
70
+ path: dist/
71
+ - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
72
+ with:
73
+ packages-dir: dist/
74
+
75
+ upload-openapi:
76
+ # Attach the committed OpenAPI spec to the GitHub release.
77
+ needs: release-please
78
+ if: ${{ needs.release-please.outputs.release_created == 'true' }}
79
+ runs-on: ubuntu-latest
80
+ timeout-minutes: 5
81
+ permissions:
82
+ contents: write
83
+ steps:
84
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
85
+ - name: Attach OpenAPI spec to the release
86
+ env:
87
+ GH_TOKEN: ${{ github.token }}
88
+ TAG: ${{ needs.release-please.outputs.tag_name }}
89
+ run: gh release upload "$TAG" openapi.json openapi.yaml --clobber
@@ -0,0 +1,8 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ dist/
5
+ build/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .ruff_cache/
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0"
3
+ }
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-07-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * iSolarCloud docs MCP server ([b9b9029](https://github.com/KRoperUK/mcp-isolarcloud/commit/b9b90290c513a4e8b87dd2cbd7a7c81794adb6ec))
9
+ * OpenAPI spec and doc/OpenAPI refresh tooling ([d24a4fb](https://github.com/KRoperUK/mcp-isolarcloud/commit/d24a4fbd20d3cc860c25ba1db3762feb69604750))
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KRoperUK
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.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-isolarcloud
3
+ Version: 0.1.0
4
+ Summary: MCP server serving Sungrow iSolarCloud OpenAPI documentation, control-parameter reference and how-to skills.
5
+ Project-URL: Homepage, https://github.com/KRoperUK/mcp-isolarcloud
6
+ Project-URL: Issues, https://github.com/KRoperUK/mcp-isolarcloud/issues
7
+ Author: KRoperUK
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: documentation,isolarcloud,mcp,solar,sungrow
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Home Automation
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: fastmcp>=2.0.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest; extra == 'dev'
18
+ Requires-Dist: ruff==0.15.16; extra == 'dev'
19
+ Provides-Extra: tools
20
+ Requires-Dist: cryptography; extra == 'tools'
21
+ Requires-Dist: markdownify; extra == 'tools'
22
+ Requires-Dist: pyyaml; extra == 'tools'
23
+ Description-Content-Type: text/markdown
24
+
25
+ # mcp-isolarcloud
26
+
27
+ An [MCP](https://modelcontextprotocol.io) server that serves the **Sungrow iSolarCloud OpenAPI documentation** — the official developer docs, control-parameter reference, device-type dictionary, error codes and measuring-point tables — as searchable tools, resources and how-to "skill" prompts.
28
+
29
+ The full documentation set is **bundled with the package**, so the server needs no network access or credentials at runtime.
30
+
31
+ ## Why
32
+
33
+ Building against the iSolarCloud API (e.g. the [`sungrow-isolarcloud`](https://github.com/KRoperUK/pysolarcloud) client or the [Home Assistant integration](https://github.com/KRoperUK/sungrow-hass)) means constantly cross-referencing the developer portal — whose docs live behind a JavaScript app. This server puts them one tool call away for any MCP-capable assistant, including the authoritative **Appendix 10: Control Parameter Definitions** (param codes, units and value encodings — e.g. SOC is sent as tenths of a percent, power in watts).
34
+
35
+ ## Run it
36
+
37
+ With [`uv`](https://docs.astral.sh/uv/) (recommended — no install step):
38
+
39
+ ```bash
40
+ uvx mcp-isolarcloud
41
+ ```
42
+
43
+ Or add it to an MCP client (Claude Desktop / Claude Code / etc.):
44
+
45
+ ```json
46
+ {
47
+ "mcpServers": {
48
+ "isolarcloud": {
49
+ "command": "uvx",
50
+ "args": ["mcp-isolarcloud"]
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ For Claude Code: `claude mcp add isolarcloud -- uvx mcp-isolarcloud`
57
+
58
+ ## What it exposes
59
+
60
+ **Tools**
61
+ - `list_docs()` — every documentation page (slug, title, type)
62
+ - `read_doc(slug)` — the full markdown of one page
63
+ - `search_docs(query, limit=8)` — keyword search, title-weighted, with snippets
64
+
65
+ **Resources**
66
+ - `isolarcloud://docs/{slug}` — each page as an MCP resource
67
+
68
+ **Prompts (skills)**
69
+ - `find_control_parameter(what)` — locate a dispatch/control parameter and its value encoding
70
+ - `api_call_walkthrough(endpoint)` — walk through calling a specific API endpoint
71
+
72
+ ## Updating the docs
73
+
74
+ The bundled docs are refreshed from the portal with:
75
+
76
+ ```bash
77
+ pip install cryptography markdownify
78
+ python tools/refresh_docs.py
79
+ ```
80
+
81
+ The portal's doc API is public (no login); `refresh_docs.py` reproduces its request-encryption scheme using the public keys embedded in the portal's own web app.
82
+
83
+ ## Development
84
+
85
+ ```bash
86
+ uv venv && uv pip install -e '.[dev]'
87
+ ruff check src/ tests/
88
+ pytest
89
+ ```
90
+
91
+ ## License
92
+
93
+ MIT
@@ -0,0 +1,69 @@
1
+ # mcp-isolarcloud
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server that serves the **Sungrow iSolarCloud OpenAPI documentation** — the official developer docs, control-parameter reference, device-type dictionary, error codes and measuring-point tables — as searchable tools, resources and how-to "skill" prompts.
4
+
5
+ The full documentation set is **bundled with the package**, so the server needs no network access or credentials at runtime.
6
+
7
+ ## Why
8
+
9
+ Building against the iSolarCloud API (e.g. the [`sungrow-isolarcloud`](https://github.com/KRoperUK/pysolarcloud) client or the [Home Assistant integration](https://github.com/KRoperUK/sungrow-hass)) means constantly cross-referencing the developer portal — whose docs live behind a JavaScript app. This server puts them one tool call away for any MCP-capable assistant, including the authoritative **Appendix 10: Control Parameter Definitions** (param codes, units and value encodings — e.g. SOC is sent as tenths of a percent, power in watts).
10
+
11
+ ## Run it
12
+
13
+ With [`uv`](https://docs.astral.sh/uv/) (recommended — no install step):
14
+
15
+ ```bash
16
+ uvx mcp-isolarcloud
17
+ ```
18
+
19
+ Or add it to an MCP client (Claude Desktop / Claude Code / etc.):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "isolarcloud": {
25
+ "command": "uvx",
26
+ "args": ["mcp-isolarcloud"]
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ For Claude Code: `claude mcp add isolarcloud -- uvx mcp-isolarcloud`
33
+
34
+ ## What it exposes
35
+
36
+ **Tools**
37
+ - `list_docs()` — every documentation page (slug, title, type)
38
+ - `read_doc(slug)` — the full markdown of one page
39
+ - `search_docs(query, limit=8)` — keyword search, title-weighted, with snippets
40
+
41
+ **Resources**
42
+ - `isolarcloud://docs/{slug}` — each page as an MCP resource
43
+
44
+ **Prompts (skills)**
45
+ - `find_control_parameter(what)` — locate a dispatch/control parameter and its value encoding
46
+ - `api_call_walkthrough(endpoint)` — walk through calling a specific API endpoint
47
+
48
+ ## Updating the docs
49
+
50
+ The bundled docs are refreshed from the portal with:
51
+
52
+ ```bash
53
+ pip install cryptography markdownify
54
+ python tools/refresh_docs.py
55
+ ```
56
+
57
+ The portal's doc API is public (no login); `refresh_docs.py` reproduces its request-encryption scheme using the public keys embedded in the portal's own web app.
58
+
59
+ ## Development
60
+
61
+ ```bash
62
+ uv venv && uv pip install -e '.[dev]'
63
+ ruff check src/ tests/
64
+ pytest
65
+ ```
66
+
67
+ ## License
68
+
69
+ MIT