@uluops/registry-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +152 -0
- package/README.md +228 -0
- package/dist/client/sdk-error-mapper.d.ts +30 -0
- package/dist/client/sdk-error-mapper.d.ts.map +1 -0
- package/dist/client/sdk-error-mapper.js +129 -0
- package/dist/client/sdk-error-mapper.js.map +1 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +92 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/tool-registry.d.ts +9 -0
- package/dist/config/tool-registry.d.ts.map +1 -0
- package/dist/config/tool-registry.js +386 -0
- package/dist/config/tool-registry.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +160 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/definition-types.d.ts +6 -0
- package/dist/resources/definition-types.d.ts.map +1 -0
- package/dist/resources/definition-types.js +31 -0
- package/dist/resources/definition-types.js.map +1 -0
- package/dist/resources/definitions.d.ts +7 -0
- package/dist/resources/definitions.d.ts.map +1 -0
- package/dist/resources/definitions.js +11 -0
- package/dist/resources/definitions.js.map +1 -0
- package/dist/resources/index.d.ts +12 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +19 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/models.d.ts +7 -0
- package/dist/resources/models.d.ts.map +1 -0
- package/dist/resources/models.js +11 -0
- package/dist/resources/models.js.map +1 -0
- package/dist/resources/providers.d.ts +7 -0
- package/dist/resources/providers.d.ts.map +1 -0
- package/dist/resources/providers.js +11 -0
- package/dist/resources/providers.js.map +1 -0
- package/dist/resources/response-helpers.d.ts +8 -0
- package/dist/resources/response-helpers.d.ts.map +1 -0
- package/dist/resources/response-helpers.js +51 -0
- package/dist/resources/response-helpers.js.map +1 -0
- package/dist/tools/archive-definition.d.ts +24 -0
- package/dist/tools/archive-definition.d.ts.map +1 -0
- package/dist/tools/archive-definition.js +19 -0
- package/dist/tools/archive-definition.js.map +1 -0
- package/dist/tools/batch-publish.d.ts +38 -0
- package/dist/tools/batch-publish.d.ts.map +1 -0
- package/dist/tools/batch-publish.js +64 -0
- package/dist/tools/batch-publish.js.map +1 -0
- package/dist/tools/batch-users.d.ts +17 -0
- package/dist/tools/batch-users.d.ts.map +1 -0
- package/dist/tools/batch-users.js +14 -0
- package/dist/tools/batch-users.js.map +1 -0
- package/dist/tools/check-forkable.d.ts +23 -0
- package/dist/tools/check-forkable.d.ts.map +1 -0
- package/dist/tools/check-forkable.js +17 -0
- package/dist/tools/check-forkable.js.map +1 -0
- package/dist/tools/compare-effectiveness.d.ts +23 -0
- package/dist/tools/compare-effectiveness.d.ts.map +1 -0
- package/dist/tools/compare-effectiveness.js +17 -0
- package/dist/tools/compare-effectiveness.js.map +1 -0
- package/dist/tools/create-definition.d.ts +107 -0
- package/dist/tools/create-definition.d.ts.map +1 -0
- package/dist/tools/create-definition.js +30 -0
- package/dist/tools/create-definition.js.map +1 -0
- package/dist/tools/delete-definition.d.ts +23 -0
- package/dist/tools/delete-definition.d.ts.map +1 -0
- package/dist/tools/delete-definition.js +17 -0
- package/dist/tools/delete-definition.js.map +1 -0
- package/dist/tools/deprecate-definition.d.ts +29 -0
- package/dist/tools/deprecate-definition.d.ts.map +1 -0
- package/dist/tools/deprecate-definition.js +23 -0
- package/dist/tools/deprecate-definition.js.map +1 -0
- package/dist/tools/diff-versions.d.ts +32 -0
- package/dist/tools/diff-versions.d.ts.map +1 -0
- package/dist/tools/diff-versions.js +20 -0
- package/dist/tools/diff-versions.js.map +1 -0
- package/dist/tools/fork-definition.d.ts +29 -0
- package/dist/tools/fork-definition.d.ts.map +1 -0
- package/dist/tools/fork-definition.js +22 -0
- package/dist/tools/fork-definition.js.map +1 -0
- package/dist/tools/get-definition.d.ts +35 -0
- package/dist/tools/get-definition.d.ts.map +1 -0
- package/dist/tools/get-definition.js +32 -0
- package/dist/tools/get-definition.js.map +1 -0
- package/dist/tools/get-dependencies.d.ts +26 -0
- package/dist/tools/get-dependencies.d.ts.map +1 -0
- package/dist/tools/get-dependencies.js +23 -0
- package/dist/tools/get-dependencies.js.map +1 -0
- package/dist/tools/get-dependents.d.ts +23 -0
- package/dist/tools/get-dependents.d.ts.map +1 -0
- package/dist/tools/get-dependents.js +17 -0
- package/dist/tools/get-dependents.js.map +1 -0
- package/dist/tools/get-diff-impact.d.ts +26 -0
- package/dist/tools/get-diff-impact.d.ts.map +1 -0
- package/dist/tools/get-diff-impact.js +18 -0
- package/dist/tools/get-diff-impact.js.map +1 -0
- package/dist/tools/get-ecosystem-overview.d.ts +11 -0
- package/dist/tools/get-ecosystem-overview.d.ts.map +1 -0
- package/dist/tools/get-ecosystem-overview.js +12 -0
- package/dist/tools/get-ecosystem-overview.js.map +1 -0
- package/dist/tools/get-effectiveness.d.ts +23 -0
- package/dist/tools/get-effectiveness.d.ts.map +1 -0
- package/dist/tools/get-effectiveness.js +17 -0
- package/dist/tools/get-effectiveness.js.map +1 -0
- package/dist/tools/get-evolution.d.ts +20 -0
- package/dist/tools/get-evolution.d.ts.map +1 -0
- package/dist/tools/get-evolution.js +16 -0
- package/dist/tools/get-evolution.js.map +1 -0
- package/dist/tools/get-execution-stats.d.ts +26 -0
- package/dist/tools/get-execution-stats.d.ts.map +1 -0
- package/dist/tools/get-execution-stats.js +18 -0
- package/dist/tools/get-execution-stats.js.map +1 -0
- package/dist/tools/get-fork-lineage.d.ts +23 -0
- package/dist/tools/get-fork-lineage.d.ts.map +1 -0
- package/dist/tools/get-fork-lineage.js +17 -0
- package/dist/tools/get-fork-lineage.js.map +1 -0
- package/dist/tools/get-health.d.ts +23 -0
- package/dist/tools/get-health.d.ts.map +1 -0
- package/dist/tools/get-health.js +17 -0
- package/dist/tools/get-health.js.map +1 -0
- package/dist/tools/get-language.d.ts +17 -0
- package/dist/tools/get-language.d.ts.map +1 -0
- package/dist/tools/get-language.js +14 -0
- package/dist/tools/get-language.js.map +1 -0
- package/dist/tools/get-lineage.d.ts +20 -0
- package/dist/tools/get-lineage.d.ts.map +1 -0
- package/dist/tools/get-lineage.js +16 -0
- package/dist/tools/get-lineage.js.map +1 -0
- package/dist/tools/get-model.d.ts +20 -0
- package/dist/tools/get-model.d.ts.map +1 -0
- package/dist/tools/get-model.js +15 -0
- package/dist/tools/get-model.js.map +1 -0
- package/dist/tools/get-translation-analytics.d.ts +20 -0
- package/dist/tools/get-translation-analytics.d.ts.map +1 -0
- package/dist/tools/get-translation-analytics.js +16 -0
- package/dist/tools/get-translation-analytics.js.map +1 -0
- package/dist/tools/get-translator-version.d.ts +11 -0
- package/dist/tools/get-translator-version.d.ts.map +1 -0
- package/dist/tools/get-translator-version.js +12 -0
- package/dist/tools/get-translator-version.js.map +1 -0
- package/dist/tools/get-user.d.ts +17 -0
- package/dist/tools/get-user.d.ts.map +1 -0
- package/dist/tools/get-user.js +14 -0
- package/dist/tools/get-user.js.map +1 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +136 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-aliases.d.ts +11 -0
- package/dist/tools/list-aliases.d.ts.map +1 -0
- package/dist/tools/list-aliases.js +12 -0
- package/dist/tools/list-aliases.js.map +1 -0
- package/dist/tools/list-definitions.d.ts +53 -0
- package/dist/tools/list-definitions.d.ts.map +1 -0
- package/dist/tools/list-definitions.js +56 -0
- package/dist/tools/list-definitions.js.map +1 -0
- package/dist/tools/list-forks.d.ts +23 -0
- package/dist/tools/list-forks.d.ts.map +1 -0
- package/dist/tools/list-forks.js +17 -0
- package/dist/tools/list-forks.js.map +1 -0
- package/dist/tools/list-languages.d.ts +11 -0
- package/dist/tools/list-languages.d.ts.map +1 -0
- package/dist/tools/list-languages.js +12 -0
- package/dist/tools/list-languages.js.map +1 -0
- package/dist/tools/list-models.d.ts +23 -0
- package/dist/tools/list-models.d.ts.map +1 -0
- package/dist/tools/list-models.js +17 -0
- package/dist/tools/list-models.js.map +1 -0
- package/dist/tools/list-providers.d.ts +11 -0
- package/dist/tools/list-providers.d.ts.map +1 -0
- package/dist/tools/list-providers.js +12 -0
- package/dist/tools/list-providers.js.map +1 -0
- package/dist/tools/list-versions.d.ts +26 -0
- package/dist/tools/list-versions.d.ts.map +1 -0
- package/dist/tools/list-versions.js +21 -0
- package/dist/tools/list-versions.js.map +1 -0
- package/dist/tools/publish-definition.d.ts +23 -0
- package/dist/tools/publish-definition.d.ts.map +1 -0
- package/dist/tools/publish-definition.js +26 -0
- package/dist/tools/publish-definition.js.map +1 -0
- package/dist/tools/record-execution.d.ts +29 -0
- package/dist/tools/record-execution.d.ts.map +1 -0
- package/dist/tools/record-execution.js +22 -0
- package/dist/tools/record-execution.js.map +1 -0
- package/dist/tools/render-definition.d.ts +33 -0
- package/dist/tools/render-definition.d.ts.map +1 -0
- package/dist/tools/render-definition.js +97 -0
- package/dist/tools/render-definition.js.map +1 -0
- package/dist/tools/resolve-alias.d.ts +17 -0
- package/dist/tools/resolve-alias.d.ts.map +1 -0
- package/dist/tools/resolve-alias.js +14 -0
- package/dist/tools/resolve-alias.js.map +1 -0
- package/dist/tools/retranslate-definition.d.ts +26 -0
- package/dist/tools/retranslate-definition.d.ts.map +1 -0
- package/dist/tools/retranslate-definition.js +23 -0
- package/dist/tools/retranslate-definition.js.map +1 -0
- package/dist/tools/search-definitions.d.ts +44 -0
- package/dist/tools/search-definitions.d.ts.map +1 -0
- package/dist/tools/search-definitions.js +35 -0
- package/dist/tools/search-definitions.js.map +1 -0
- package/dist/tools/set-default-type.d.ts +10 -0
- package/dist/tools/set-default-type.d.ts.map +1 -0
- package/dist/tools/set-default-type.js +31 -0
- package/dist/tools/set-default-type.js.map +1 -0
- package/dist/tools/sync-models.d.ts +12 -0
- package/dist/tools/sync-models.d.ts.map +1 -0
- package/dist/tools/sync-models.js +32 -0
- package/dist/tools/sync-models.js.map +1 -0
- package/dist/tools/update-and-publish.d.ts +44 -0
- package/dist/tools/update-and-publish.d.ts.map +1 -0
- package/dist/tools/update-and-publish.js +111 -0
- package/dist/tools/update-and-publish.js.map +1 -0
- package/dist/tools/update-definition.d.ts +129 -0
- package/dist/tools/update-definition.d.ts.map +1 -0
- package/dist/tools/update-definition.js +85 -0
- package/dist/tools/update-definition.js.map +1 -0
- package/dist/tools/upgrade-definition.d.ts +27 -0
- package/dist/tools/upgrade-definition.d.ts.map +1 -0
- package/dist/tools/upgrade-definition.js +22 -0
- package/dist/tools/upgrade-definition.js.map +1 -0
- package/dist/tools/validate-definition.d.ts +24 -0
- package/dist/tools/validate-definition.d.ts.map +1 -0
- package/dist/tools/validate-definition.js +21 -0
- package/dist/tools/validate-definition.js.map +1 -0
- package/dist/types/config.d.ts +40 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +5 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mcp.d.ts +21 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +34 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/schemas.d.ts +113 -0
- package/dist/types/schemas.d.ts.map +1 -0
- package/dist/types/schemas.js +65 -0
- package/dist/types/schemas.js.map +1 -0
- package/dist/types/server.d.ts +29 -0
- package/dist/types/server.d.ts.map +1 -0
- package/dist/types/server.js +5 -0
- package/dist/types/server.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +94 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/normalize-keys.d.ts +11 -0
- package/dist/utils/normalize-keys.d.ts.map +1 -0
- package/dist/utils/normalize-keys.js +41 -0
- package/dist/utils/normalize-keys.js.map +1 -0
- package/dist/utils/read-yaml-file.d.ts +27 -0
- package/dist/utils/read-yaml-file.d.ts.map +1 -0
- package/dist/utils/read-yaml-file.js +89 -0
- package/dist/utils/read-yaml-file.js.map +1 -0
- package/dist/utils/session-state.d.ts +20 -0
- package/dist/utils/session-state.d.ts.map +1 -0
- package/dist/utils/session-state.js +21 -0
- package/dist/utils/session-state.js.map +1 -0
- package/dist/utils/tool-handler.d.ts +61 -0
- package/dist/utils/tool-handler.d.ts.map +1 -0
- package/dist/utils/tool-handler.js +184 -0
- package/dist/utils/tool-handler.js.map +1 -0
- package/dist/utils/trim-definition.d.ts +13 -0
- package/dist/utils/trim-definition.d.ts.map +1 -0
- package/dist/utils/trim-definition.js +28 -0
- package/dist/utils/trim-definition.js.map +1 -0
- package/package.json +83 -0
- package/tool-policies.json +66 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Bumps `@uluops/sdk-core` from `^0.9.0` to `0.11.0` (exact pin) and `@uluops/registry-sdk`
|
|
13
|
+
to `0.30.0` (exact pin). Aligns with the sdk-core schema-removal cascade. The MCP server's
|
|
14
|
+
own Zod-based tool input parsing is unaffected — it never used sdk-core's `options.schema`.
|
|
15
|
+
|
|
16
|
+
## [1.14.0] - 2026-05-20
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Custom credential redaction replaced with `sdk-core` `sanitizeString`
|
|
20
|
+
|
|
21
|
+
## [1.13.0] - 2026-05-18
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- `check_forkable` MCP tool renamed to `is_forkable`
|
|
25
|
+
- SDK method calls updated for `registry-sdk` v0.21.0 renames
|
|
26
|
+
|
|
27
|
+
## [1.12.0] - 2026-05-15
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- `forks.getLineage` renamed to `forks.getAncestry` after SDK rename
|
|
31
|
+
|
|
32
|
+
## [1.11.0] - 2026-05-07
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- `nextAvailable` version surfaced in 409 conflict MCP response
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- Definition write tool limits bumped to 1MB for large agent YAML files
|
|
39
|
+
|
|
40
|
+
## [1.10.0] - 2026-04-30
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- `target` and `model` params on `render_definition` MCP tool
|
|
44
|
+
|
|
45
|
+
## [1.9.0] - 2026-04-28
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
- 402 `SubscriptionRequired` error handling with `source=mcp` tracking
|
|
49
|
+
|
|
50
|
+
## [1.8.0] - 2026-04-27
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- `provenance` input on `create_definition` and `update_definition` tools
|
|
54
|
+
- `authorshipType` filter on `list_definitions` and `search_definitions` tools
|
|
55
|
+
|
|
56
|
+
## [1.7.0] - 2026-04-15
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
- `get_diff_impact` handler parameter access corrected
|
|
60
|
+
|
|
61
|
+
## [1.6.0] - 2026-04-12
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
- Pagination on `list_versions` tool
|
|
65
|
+
- `format` param on `diff_versions` tool (field-level, unified, summary)
|
|
66
|
+
- Session token authentication as alternative to API keys
|
|
67
|
+
|
|
68
|
+
## [1.5.0] - 2026-04-09
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
- `file_path` resolved before Zod parse in `update_and_publish`
|
|
72
|
+
|
|
73
|
+
## [1.4.0] - 2026-04-07
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
- `archive_definition` MCP tool
|
|
77
|
+
- `archived` status added to `DefinitionStatusSchema`
|
|
78
|
+
- `is_fork` filter on `list_definitions` and `search_definitions`
|
|
79
|
+
- 8 analytics tools: `get_effectiveness`, `compare_effectiveness`, `get_execution_stats`, `get_evolution`, `get_health`, `get_ecosystem_overview`, `get_translation_analytics`, `get_translator_version`
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
- `archive_definition` tool spec added to security registry
|
|
83
|
+
- `isFork` uses camelCase after `normalizeKeys` transformation
|
|
84
|
+
|
|
85
|
+
## [1.3.0] - 2026-03-29
|
|
86
|
+
|
|
87
|
+
### Added
|
|
88
|
+
- Org slug support via `ULUOPS_ORG_SLUG` env var
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
- Error handling overhauled for actionable agent-facing messages
|
|
92
|
+
|
|
93
|
+
## [1.2.0] - 2026-03-01
|
|
94
|
+
|
|
95
|
+
### Added
|
|
96
|
+
- Composite workflow tools: `update_and_publish`, `batch_publish`
|
|
97
|
+
- Summary mode as default for version diff
|
|
98
|
+
- `cognitive-lens` and `explorer` added to domain enum
|
|
99
|
+
- Production URL default so users only need API key
|
|
100
|
+
|
|
101
|
+
### Fixed
|
|
102
|
+
- String-typed numeric params coerced before Zod validation
|
|
103
|
+
- Symlink traversal prevented in file reads and writes (CWE-59)
|
|
104
|
+
|
|
105
|
+
## [1.1.0] - 2026-02-21
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
- `file_path` parameter on `create_definition`, `validate_definition`, `update_definition`, and `upgrade_definition` — read YAML from disk
|
|
109
|
+
- `output_path` on `render_definition` for direct file writing
|
|
110
|
+
- Session defaults, richer search, and response field selection
|
|
111
|
+
- Smart version-up on published or missing versions in `update_definition`
|
|
112
|
+
- Mutation tool responses trimmed of `yaml`/`runtimeMd` for conciseness
|
|
113
|
+
- `fields` meta-parameter exposed in MCP tool schemas
|
|
114
|
+
|
|
115
|
+
### Security
|
|
116
|
+
- Directory containment on `output_path` in `render_definition` (CWE-22)
|
|
117
|
+
- Directory containment on `file_path` in YAML tools (CWE-22)
|
|
118
|
+
|
|
119
|
+
### Fixed
|
|
120
|
+
- Redundant type assertions removed in `trimDefinitionResponse`
|
|
121
|
+
- Template expression safety for `fsError.code` in `readYamlFile`
|
|
122
|
+
- Double assertion pattern replaced with runtime type guard
|
|
123
|
+
- Dynamic imports replaced with static imports in `render_definition` catch block
|
|
124
|
+
- 70+ ship pipeline validation issues resolved across security, docs, type safety, and tests
|
|
125
|
+
|
|
126
|
+
## [1.0.0] - 2026-02-16
|
|
127
|
+
|
|
128
|
+
### Added
|
|
129
|
+
- Initial release of UluOps Registry MCP client
|
|
130
|
+
- 31 tools across 8 domains: definitions, models, versions, dependencies, forks, executions, translation, users
|
|
131
|
+
- 4 resources via `registry://` URI scheme
|
|
132
|
+
- `createToolHandler` factory with Zod validation, snake_case→camelCase normalization, and SDK error mapping
|
|
133
|
+
- Security hardening via `mcp-secure-server` with per-tool rate limits and payload size controls
|
|
134
|
+
- Error sanitization stripping sensitive data (API keys, tokens, stack traces) from MCP responses
|
|
135
|
+
- Test suite with 194 tests covering all tools, resources, and registry config
|
|
136
|
+
|
|
137
|
+
[Unreleased]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.14.0...HEAD
|
|
138
|
+
[1.14.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.13.0...v1.14.0
|
|
139
|
+
[1.13.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.12.0...v1.13.0
|
|
140
|
+
[1.12.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.11.0...v1.12.0
|
|
141
|
+
[1.11.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.10.0...v1.11.0
|
|
142
|
+
[1.10.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.9.0...v1.10.0
|
|
143
|
+
[1.9.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.8.0...v1.9.0
|
|
144
|
+
[1.8.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.7.0...v1.8.0
|
|
145
|
+
[1.7.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.6.0...v1.7.0
|
|
146
|
+
[1.6.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.5.0...v1.6.0
|
|
147
|
+
[1.5.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.4.0...v1.5.0
|
|
148
|
+
[1.4.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.3.0...v1.4.0
|
|
149
|
+
[1.3.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.2.0...v1.3.0
|
|
150
|
+
[1.2.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.1.0...v1.2.0
|
|
151
|
+
[1.1.0]: https://github.com/Uluops/-uluops-registry-mcp/compare/v1.0.0...v1.1.0
|
|
152
|
+
[1.0.0]: https://github.com/Uluops/-uluops-registry-mcp/releases/tag/v1.0.0
|
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# UluOps Registry MCP Client v1.1.0
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) client for the UluOps Registry API. Provides **31 tools** and **4 resources** that enable Claude Code to browse, create, validate, and manage AI workflow definitions (agents, commands, workflows, pipelines).
|
|
4
|
+
|
|
5
|
+
## Quick Setup (30 seconds)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone git@github.com:Uluops/-uluops-registry-mcp.git
|
|
9
|
+
cd -uluops-registry-mcp
|
|
10
|
+
./setup.sh YOUR_API_KEY
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The setup script installs dependencies, builds the project, and prints the `.mcp.json` config snippet to paste into your project or `~/.claude/.mcp.json`.
|
|
14
|
+
|
|
15
|
+
Or do it manually:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install && npm run build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then add to your `.mcp.json`:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"uluops-registry": {
|
|
27
|
+
"command": "node",
|
|
28
|
+
"args": ["/absolute/path/to/registry-uluops-mcp/dist/index.js"],
|
|
29
|
+
"env": {
|
|
30
|
+
"ULUOPS_REGISTRY_URL": "http://localhost:3001/api/v1",
|
|
31
|
+
"ULUOPS_API_KEY": "your-api-key"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Restart Claude Code to pick up the new server.
|
|
39
|
+
|
|
40
|
+
## Design Philosophy
|
|
41
|
+
|
|
42
|
+
**Thin Client Pattern**: This MCP client contains **zero business logic**. All data processing, validation, storage, and rendering are handled by the registry API. The client's sole responsibility is protocol translation between MCP's stdio-based JSON-RPC and the backend's REST API.
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
All configuration is passed via environment variables in the `env` block of `.mcp.json`. No `.env` file needed.
|
|
47
|
+
|
|
48
|
+
| Variable | Description | Required | Default |
|
|
49
|
+
|----------|-------------|----------|---------|
|
|
50
|
+
| `ULUOPS_REGISTRY_URL` | Registry API URL | Yes | - |
|
|
51
|
+
| `ULUOPS_API_KEY` | API authentication key | Yes | - |
|
|
52
|
+
| `ULUOPS_REGISTRY_TIMEOUT` | Request timeout (ms) | No | 30000 |
|
|
53
|
+
| `ULUOPS_REGISTRY_RETRIES` | Retry attempts | No | 3 |
|
|
54
|
+
| `LOG_LEVEL` | Logging level | No | info |
|
|
55
|
+
| `ENABLE_FILE_LOGGING` | Write logs to disk | No | false |
|
|
56
|
+
| `LOG_DIR` | Log file directory | No | ./logs |
|
|
57
|
+
| `VERBOSE_LOGGING` | Verbose security decision logging | No | false |
|
|
58
|
+
| `LOG_PERFORMANCE_METRICS` | Log performance metrics | No | false |
|
|
59
|
+
| `WORKSPACE_DIR` | Base directory for `file_path` containment (CWE-22 protection) | No | cwd |
|
|
60
|
+
| `OUTPUT_BASE_DIR` | Base directory for `output_path` containment (CWE-22 protection) | No | cwd |
|
|
61
|
+
|
|
62
|
+
A `.env.example` is included as a template showing available variables. This file is **not** auto-loaded — copy it to `.env` or set variables directly in `.mcp.json`.
|
|
63
|
+
|
|
64
|
+
## Quick Start Examples
|
|
65
|
+
|
|
66
|
+
Once configured, Claude Code can use the registry tools:
|
|
67
|
+
|
|
68
|
+
```jsonc
|
|
69
|
+
// These are MCP tool calls — Claude Code invokes them automatically.
|
|
70
|
+
|
|
71
|
+
// Browse published definitions
|
|
72
|
+
list_definitions({ "type": "agent", "status": "published", "limit": 10 })
|
|
73
|
+
|
|
74
|
+
// Get a specific definition with its rendered YAML
|
|
75
|
+
get_definition({ type: "agent", name: "code-validator", include_yaml: true })
|
|
76
|
+
|
|
77
|
+
// Search across all definition types
|
|
78
|
+
search_definitions({ query: "validation", type: "agent" })
|
|
79
|
+
|
|
80
|
+
// Resolve a model alias
|
|
81
|
+
resolve_alias({ alias: "sonnet" })
|
|
82
|
+
|
|
83
|
+
// Validate YAML before publishing
|
|
84
|
+
validate_definition({ type: "agent", yaml: "..." })
|
|
85
|
+
|
|
86
|
+
// Or validate from a file path instead of inline YAML
|
|
87
|
+
validate_definition({ type: "agent", file_path: "/path/to/agent.yaml" })
|
|
88
|
+
|
|
89
|
+
// Create and publish a definition
|
|
90
|
+
create_definition({ type: "agent", name: "my-agent", yaml: "name: my-agent\nversion: 1.0.0\n..." })
|
|
91
|
+
publish_definition({ type: "agent", name: "my-agent", version: "1.0.0" })
|
|
92
|
+
|
|
93
|
+
// Compare versions — section summary (default)
|
|
94
|
+
diff_versions({ type: "agent", name: "code-validator", from: "1.0.0", to: "1.1.0" })
|
|
95
|
+
|
|
96
|
+
// Compare versions — structural diff with classification
|
|
97
|
+
diff_versions({ type: "agent", name: "code-validator", from: "1.0.0", to: "1.1.0", format: "fields" })
|
|
98
|
+
// Returns: fields[], classified[], suggestedBump, summary, sections
|
|
99
|
+
|
|
100
|
+
// Compare versions — unified line diff
|
|
101
|
+
diff_versions({ type: "agent", name: "code-validator", from: "1.0.0", to: "1.1.0", format: "unified" })
|
|
102
|
+
// Returns: unified (git-style diff string)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Available Tools
|
|
106
|
+
|
|
107
|
+
### Core Tools (P0)
|
|
108
|
+
| Tool | Description |
|
|
109
|
+
|------|-------------|
|
|
110
|
+
| `list_definitions` | List definitions with filters (type, status, domain, visibility, search, tags, pagination) |
|
|
111
|
+
| `get_definition` | Get a single definition by type+name, optionally with YAML/runtime/refs |
|
|
112
|
+
| `search_definitions` | Search definitions by keyword |
|
|
113
|
+
| `list_models` | List AI models with optional filters |
|
|
114
|
+
| `resolve_alias` | Resolve alias (e.g. "sonnet") to provider+modelId |
|
|
115
|
+
| `validate_definition` | Validate YAML without storing (accepts `yaml` or `file_path`) |
|
|
116
|
+
| `render_definition` | Get rendered markdown for a definition. Use `output_path` to write directly to a file |
|
|
117
|
+
|
|
118
|
+
### Definition Management Tools (P1)
|
|
119
|
+
| Tool | Description |
|
|
120
|
+
|------|-------------|
|
|
121
|
+
| `create_definition` | Create a new draft definition (accepts `yaml` or `file_path`) |
|
|
122
|
+
| `update_definition` | Update a draft definition (`yaml`/`file_path`, visibility, description, tags). Smart version-up: if the target version is published or doesn't exist and YAML is provided, automatically creates a new draft instead of failing |
|
|
123
|
+
| `publish_definition` | Publish a draft definition |
|
|
124
|
+
| `deprecate_definition` | Deprecate with reason and optional successor |
|
|
125
|
+
| `delete_definition` | Delete a draft (published definitions cannot be deleted) |
|
|
126
|
+
|
|
127
|
+
### Version & Dependency Tools (P1)
|
|
128
|
+
| Tool | Description |
|
|
129
|
+
|------|-------------|
|
|
130
|
+
| `list_versions` | List all versions of a definition |
|
|
131
|
+
| `diff_versions` | Compare two versions. Supports `format`: `sections` (default summary), `fields` (structural diff with classification + suggested bump), `unified` (git-style line diff) |
|
|
132
|
+
| `get_dependencies` | Forward dependency graph |
|
|
133
|
+
| `get_dependents` | Reverse dependency graph |
|
|
134
|
+
| `get_execution_stats` | Execution statistics for a definition version |
|
|
135
|
+
| `list_forks` | List forks of a definition |
|
|
136
|
+
|
|
137
|
+
### Fork Tools (P2)
|
|
138
|
+
| Tool | Description |
|
|
139
|
+
|------|-------------|
|
|
140
|
+
| `fork_definition` | Fork a definition |
|
|
141
|
+
| `is_forkable` | Check if a definition version can be forked |
|
|
142
|
+
| `get_fork_lineage` | Fork ancestry chain |
|
|
143
|
+
|
|
144
|
+
### Translation Tools (P2)
|
|
145
|
+
| Tool | Description |
|
|
146
|
+
|------|-------------|
|
|
147
|
+
| `retranslate_definition` | Retranslate with the latest translator version |
|
|
148
|
+
| `upgrade_definition` | Upgrade a definition from legacy format (accepts `yaml` or `file_path`) |
|
|
149
|
+
| `get_translator_version` | Get current translator version |
|
|
150
|
+
|
|
151
|
+
### Model Tools (P2)
|
|
152
|
+
| Tool | Description |
|
|
153
|
+
|------|-------------|
|
|
154
|
+
| `get_model` | Get specific model details by provider+modelId |
|
|
155
|
+
| `list_providers` | List AI providers |
|
|
156
|
+
| `list_aliases` | List all model aliases |
|
|
157
|
+
| `sync_models` | Sync model catalog (admin) |
|
|
158
|
+
|
|
159
|
+
### Execution & User Tools (P2)
|
|
160
|
+
| Tool | Description |
|
|
161
|
+
|------|-------------|
|
|
162
|
+
| `record_execution` | Record a definition execution (idempotent) |
|
|
163
|
+
| `get_user` | Get public user profile |
|
|
164
|
+
| `batch_users` | Batch user lookup (max 100) |
|
|
165
|
+
|
|
166
|
+
## Available Resources
|
|
167
|
+
|
|
168
|
+
MCP resources provide read-only access to registry data via the `registry://` URI scheme.
|
|
169
|
+
|
|
170
|
+
| Resource | URI | Description |
|
|
171
|
+
|----------|-----|-------------|
|
|
172
|
+
| Definitions | `registry://definitions` | Published definitions (up to 100) |
|
|
173
|
+
| Models | `registry://models` | AI model catalog |
|
|
174
|
+
| Definition Types | `registry://definition-types` | Static list: agent, command, workflow, pipeline |
|
|
175
|
+
| Providers | `registry://providers` | AI provider list |
|
|
176
|
+
|
|
177
|
+
### Resource Usage
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
// List published definitions
|
|
181
|
+
read_resource("registry://definitions")
|
|
182
|
+
|
|
183
|
+
// Browse available AI models
|
|
184
|
+
read_resource("registry://models")
|
|
185
|
+
|
|
186
|
+
// Get supported definition types with descriptions
|
|
187
|
+
read_resource("registry://definition-types")
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Rate Limiting Configuration
|
|
191
|
+
|
|
192
|
+
This client uses [mcp-secure-server](https://github.com/anthropics/mcp-secure-server) with configuration optimized for Claude Code's usage patterns. Source of truth: `src/index.ts` (global) and `src/config/tool-registry.ts` (per-tool).
|
|
193
|
+
|
|
194
|
+
| Setting | Value | Notes |
|
|
195
|
+
|---------|-------|-------|
|
|
196
|
+
| Security level | `basic` | |
|
|
197
|
+
| Max requests/min | 120 | Global rate limit |
|
|
198
|
+
| Burst threshold | 15 | Requests within burst window |
|
|
199
|
+
| Burst window | 5000ms | |
|
|
200
|
+
| Automation detection | Disabled | Claude Code is trusted automation |
|
|
201
|
+
|
|
202
|
+
Per-tool quotas are configured in `src/config/tool-registry.ts`. Read-heavy tools (list, get, search) allow up to 240 req/min. Write tools (create, update, publish) are 30-60 req/min. Admin operations like `sync_models` are tightly limited (10 req/min).
|
|
203
|
+
|
|
204
|
+
## Development
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Install dependencies
|
|
208
|
+
npm install
|
|
209
|
+
|
|
210
|
+
# Development mode with watch
|
|
211
|
+
npm run dev
|
|
212
|
+
|
|
213
|
+
# Run tests
|
|
214
|
+
npm test
|
|
215
|
+
|
|
216
|
+
# Type checking
|
|
217
|
+
npm run typecheck
|
|
218
|
+
|
|
219
|
+
# Linting
|
|
220
|
+
npm run lint
|
|
221
|
+
|
|
222
|
+
# Build for production
|
|
223
|
+
npm run build
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## License
|
|
227
|
+
|
|
228
|
+
MIT
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error mapper for converting Registry SDK errors to MCP-safe responses
|
|
3
|
+
*
|
|
4
|
+
* Maps @uluops/registry-sdk error hierarchy to sanitized MCP tool responses.
|
|
5
|
+
* Credential redaction delegated to @uluops/sdk-core's sanitizeString().
|
|
6
|
+
*/
|
|
7
|
+
import { sanitizeString } from '@uluops/sdk-core';
|
|
8
|
+
import type { McpToolResponse } from '../types/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize an error message for safe client exposure.
|
|
11
|
+
* Delegates to @uluops/sdk-core's sanitizeString() for credential redaction
|
|
12
|
+
* and truncation.
|
|
13
|
+
*/
|
|
14
|
+
export declare const sanitizeErrorMessage: typeof sanitizeString;
|
|
15
|
+
/**
|
|
16
|
+
* Map an SDK error to an MCP tool response.
|
|
17
|
+
*
|
|
18
|
+
* Preserves error context including:
|
|
19
|
+
* - Original error messages (with credential redaction only)
|
|
20
|
+
* - HTTP status codes when available
|
|
21
|
+
* - Retry-after information for rate limits
|
|
22
|
+
* - Field-level validation details
|
|
23
|
+
*/
|
|
24
|
+
export declare function mapSdkErrorToMcp(error: unknown): McpToolResponse;
|
|
25
|
+
/**
|
|
26
|
+
* Map a Zod validation error to an MCP tool response.
|
|
27
|
+
* Shows all validation errors with field paths and expected values.
|
|
28
|
+
*/
|
|
29
|
+
export declare function mapZodErrorToMcp(error: unknown): McpToolResponse;
|
|
30
|
+
//# sourceMappingURL=sdk-error-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-error-mapper.d.ts","sourceRoot":"","sources":["../../src/client/sdk-error-mapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,uBAAiB,CAAC;AAkCnD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAqGhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAahE"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error mapper for converting Registry SDK errors to MCP-safe responses
|
|
3
|
+
*
|
|
4
|
+
* Maps @uluops/registry-sdk error hierarchy to sanitized MCP tool responses.
|
|
5
|
+
* Credential redaction delegated to @uluops/sdk-core's sanitizeString().
|
|
6
|
+
*/
|
|
7
|
+
import { isRegistryApiError, isNotFoundError, isRateLimitError, isValidationError, UnauthorizedError, ForbiddenError, isConflictError, isUnprocessableError, } from '@uluops/registry-sdk/errors';
|
|
8
|
+
import { sanitizeString } from '@uluops/sdk-core';
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize an error message for safe client exposure.
|
|
11
|
+
* Delegates to @uluops/sdk-core's sanitizeString() for credential redaction
|
|
12
|
+
* and truncation.
|
|
13
|
+
*/
|
|
14
|
+
export const sanitizeErrorMessage = sanitizeString;
|
|
15
|
+
/** Safely extract a message from an unknown error value */
|
|
16
|
+
function getErrorMessage(error, fallback) {
|
|
17
|
+
if (error instanceof Error)
|
|
18
|
+
return error.message;
|
|
19
|
+
if (typeof error === 'object' && error !== null && 'message' in error) {
|
|
20
|
+
return String(error.message);
|
|
21
|
+
}
|
|
22
|
+
return fallback;
|
|
23
|
+
}
|
|
24
|
+
/** Extract HTTP status code from SDK errors when available */
|
|
25
|
+
function getStatusCode(error) {
|
|
26
|
+
if (error && typeof error === 'object' && 'statusCode' in error) {
|
|
27
|
+
return error.statusCode;
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
/** Build a structured error response with optional metadata */
|
|
32
|
+
function buildErrorResponse(message, metadata) {
|
|
33
|
+
const payload = { error: message };
|
|
34
|
+
if (metadata) {
|
|
35
|
+
Object.assign(payload, metadata);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Map an SDK error to an MCP tool response.
|
|
44
|
+
*
|
|
45
|
+
* Preserves error context including:
|
|
46
|
+
* - Original error messages (with credential redaction only)
|
|
47
|
+
* - HTTP status codes when available
|
|
48
|
+
* - Retry-after information for rate limits
|
|
49
|
+
* - Field-level validation details
|
|
50
|
+
*/
|
|
51
|
+
export function mapSdkErrorToMcp(error) {
|
|
52
|
+
const statusCode = getStatusCode(error);
|
|
53
|
+
if (isNotFoundError(error)) {
|
|
54
|
+
return buildErrorResponse(sanitizeErrorMessage(getErrorMessage(error, 'Resource not found')), statusCode ? { status: statusCode } : undefined);
|
|
55
|
+
}
|
|
56
|
+
if (isRateLimitError(error)) {
|
|
57
|
+
const retryAfter = error.retryAfter;
|
|
58
|
+
return buildErrorResponse(retryAfter
|
|
59
|
+
? `Rate limit exceeded. Retry after ${String(retryAfter)} seconds.`
|
|
60
|
+
: 'Rate limit exceeded, please retry later.', { status: 429, ...(retryAfter ? { retry_after_seconds: retryAfter } : {}) });
|
|
61
|
+
}
|
|
62
|
+
if (isValidationError(error)) {
|
|
63
|
+
return buildErrorResponse(sanitizeErrorMessage(getErrorMessage(error, 'Invalid request parameters')), statusCode ? { status: statusCode } : undefined);
|
|
64
|
+
}
|
|
65
|
+
if (error instanceof UnauthorizedError) {
|
|
66
|
+
return buildErrorResponse('Authentication required. Verify ULUOPS_API_KEY is set to a valid ulr_* key.', { status: 401 });
|
|
67
|
+
}
|
|
68
|
+
if (error instanceof ForbiddenError) {
|
|
69
|
+
return buildErrorResponse(sanitizeErrorMessage(getErrorMessage(error, 'Access denied')), { status: 403 });
|
|
70
|
+
}
|
|
71
|
+
// 402 Subscription Required — content gating (spec Section 9.2)
|
|
72
|
+
if (statusCode === 402) {
|
|
73
|
+
const details = error.details ?? {};
|
|
74
|
+
const requiredTier = details.requiredTier;
|
|
75
|
+
const currentTier = details.currentTier;
|
|
76
|
+
const def = details.definition;
|
|
77
|
+
const upgradeUrl = details.upgradeUrl;
|
|
78
|
+
const sep = upgradeUrl?.includes('?') ? '&' : '?';
|
|
79
|
+
const trackedUrl = upgradeUrl ? `${upgradeUrl}${sep}source=mcp` : undefined;
|
|
80
|
+
const defLabel = def?.name ? `${def.type ?? 'definition'}/${def.name}` : 'this definition';
|
|
81
|
+
const tierLabel = requiredTier ? ` Requires ${requiredTier} tier or higher.` : '';
|
|
82
|
+
const currentLabel = currentTier ? ` Your current tier: ${currentTier}.` : '';
|
|
83
|
+
return buildErrorResponse(`Subscription required to access ${defLabel}.${tierLabel}${currentLabel}` +
|
|
84
|
+
(trackedUrl ? ` Upgrade: ${trackedUrl}` : ''), {
|
|
85
|
+
status: 402,
|
|
86
|
+
...(requiredTier ? { required_tier: requiredTier } : {}),
|
|
87
|
+
...(currentTier ? { current_tier: currentTier } : {}),
|
|
88
|
+
...(def ? { definition: def } : {}),
|
|
89
|
+
...(trackedUrl ? { upgrade_url: trackedUrl } : {}),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (isConflictError(error)) {
|
|
93
|
+
// Extract details (e.g. nextAvailable version) from SDK ConflictError
|
|
94
|
+
const details = 'details' in error
|
|
95
|
+
? error.details
|
|
96
|
+
: undefined;
|
|
97
|
+
return buildErrorResponse(sanitizeErrorMessage(getErrorMessage(error, 'Resource conflict')), {
|
|
98
|
+
...(statusCode ? { status: statusCode } : {}),
|
|
99
|
+
...(details?.nextAvailable ? { nextAvailable: details.nextAvailable } : {}),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (isUnprocessableError(error)) {
|
|
103
|
+
return buildErrorResponse(sanitizeErrorMessage(getErrorMessage(error, 'Unprocessable request')), statusCode ? { status: statusCode } : undefined);
|
|
104
|
+
}
|
|
105
|
+
if (isRegistryApiError(error)) {
|
|
106
|
+
return buildErrorResponse(sanitizeErrorMessage(getErrorMessage(error, 'Internal server error')), statusCode ? { status: statusCode } : undefined);
|
|
107
|
+
}
|
|
108
|
+
if (error instanceof Error) {
|
|
109
|
+
return buildErrorResponse(sanitizeErrorMessage(error.message));
|
|
110
|
+
}
|
|
111
|
+
return buildErrorResponse('An unexpected error occurred');
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Map a Zod validation error to an MCP tool response.
|
|
115
|
+
* Shows all validation errors with field paths and expected values.
|
|
116
|
+
*/
|
|
117
|
+
export function mapZodErrorToMcp(error) {
|
|
118
|
+
let message = 'Invalid input parameters';
|
|
119
|
+
if (error instanceof Error && 'issues' in error) {
|
|
120
|
+
const zodError = error;
|
|
121
|
+
const details = zodError.issues
|
|
122
|
+
.map((e) => `${e.path.join('.')}: ${e.message}`)
|
|
123
|
+
.join('; ');
|
|
124
|
+
const count = zodError.issues.length;
|
|
125
|
+
message = `Validation failed (${String(count)} error${count > 1 ? 's' : ''}): ${details}`;
|
|
126
|
+
}
|
|
127
|
+
return buildErrorResponse(message, { status: 400 });
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=sdk-error-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-error-mapper.js","sourceRoot":"","sources":["../../src/client/sdk-error-mapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD,2DA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8BAA8B,CAAC,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,OAAO,GAAG,0BAA0B,CAAC;IAEzC,IAAI,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,KAA0B,CAAC;QAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM;aAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/C,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACrC,OAAO,GAAG,sBAAsB,MAAM,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,OAAO,EAAE,CAAC;IAC5F,CAAC;IAED,OAAO,kBAAkB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration loader for registry MCP client
|
|
3
|
+
*
|
|
4
|
+
* Loads configuration from environment variables with sensible defaults.
|
|
5
|
+
*/
|
|
6
|
+
import type { RegistryMcpConfig } from '../types/index.js';
|
|
7
|
+
/** Package version read from package.json at module load time. */
|
|
8
|
+
export declare const VERSION: string;
|
|
9
|
+
/**
|
|
10
|
+
* Load configuration from environment variables.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadConfig(): RegistryMcpConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Validate that required configuration is present and well-formed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateConfig(config: RegistryMcpConfig): void;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAY,MAAM,mBAAmB,CAAC;AAKrE,kEAAkE;AAClE,eAAO,MAAM,OAAO,QAAa,CAAC;AA0BlC;;GAEG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,CA2B9C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CA4B9D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration loader for registry MCP client
|
|
3
|
+
*
|
|
4
|
+
* Loads configuration from environment variables with sensible defaults.
|
|
5
|
+
*/
|
|
6
|
+
import { createRequire } from 'module';
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const { version: pkgVersion } = require('../../package.json');
|
|
9
|
+
/** Package version read from package.json at module load time. */
|
|
10
|
+
export const VERSION = pkgVersion;
|
|
11
|
+
const DEFAULT_BASE_URL = 'https://api.uluops.ai/api/v1/registry';
|
|
12
|
+
const DEFAULT_TIMEOUT = 30000;
|
|
13
|
+
const DEFAULT_RETRIES = 3;
|
|
14
|
+
const DEFAULT_LOG_LEVEL = 'info';
|
|
15
|
+
function parseLogLevel(value) {
|
|
16
|
+
const validLevels = ['debug', 'info', 'warn', 'error'];
|
|
17
|
+
if (value !== undefined && value !== '' && validLevels.includes(value)) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
return DEFAULT_LOG_LEVEL;
|
|
21
|
+
}
|
|
22
|
+
function parseBoolean(value, defaultValue) {
|
|
23
|
+
if (value === undefined)
|
|
24
|
+
return defaultValue;
|
|
25
|
+
return value.toLowerCase() === 'true' || value === '1';
|
|
26
|
+
}
|
|
27
|
+
function parseInteger(value, defaultValue) {
|
|
28
|
+
if (value === undefined)
|
|
29
|
+
return defaultValue;
|
|
30
|
+
const parsed = parseInt(value, 10);
|
|
31
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load configuration from environment variables.
|
|
35
|
+
*/
|
|
36
|
+
export function loadConfig() {
|
|
37
|
+
// Treat both unset (undefined) and empty string as "use default" — the test
|
|
38
|
+
// suite documents this intent. `??` alone would keep empty string as a value.
|
|
39
|
+
const apiUrl = process.env['ULUOPS_REGISTRY_URL'] || DEFAULT_BASE_URL; // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing
|
|
40
|
+
const apiKey = process.env['ULUOPS_API_KEY'];
|
|
41
|
+
const orgSlug = process.env['ULUOPS_ORG_SLUG'];
|
|
42
|
+
return {
|
|
43
|
+
api: {
|
|
44
|
+
baseUrl: apiUrl,
|
|
45
|
+
apiKey,
|
|
46
|
+
orgSlug,
|
|
47
|
+
timeout: parseInteger(process.env['ULUOPS_REGISTRY_TIMEOUT'], DEFAULT_TIMEOUT),
|
|
48
|
+
retries: parseInteger(process.env['ULUOPS_REGISTRY_RETRIES'], DEFAULT_RETRIES),
|
|
49
|
+
},
|
|
50
|
+
server: {
|
|
51
|
+
name: 'uluops-registry-client',
|
|
52
|
+
version: pkgVersion,
|
|
53
|
+
},
|
|
54
|
+
security: {
|
|
55
|
+
logLevel: parseLogLevel(process.env['LOG_LEVEL']),
|
|
56
|
+
enableLogging: parseBoolean(process.env['ENABLE_FILE_LOGGING'], false),
|
|
57
|
+
logDir: process.env['LOG_DIR'],
|
|
58
|
+
verboseLogging: parseBoolean(process.env['VERBOSE_LOGGING'], false),
|
|
59
|
+
logPerformanceMetrics: parseBoolean(process.env['LOG_PERFORMANCE_METRICS'], false),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Validate that required configuration is present and well-formed.
|
|
65
|
+
*/
|
|
66
|
+
export function validateConfig(config) {
|
|
67
|
+
if (!config.api.baseUrl) {
|
|
68
|
+
throw new Error('Registry API base URL is required');
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const parsed = new URL(config.api.baseUrl);
|
|
72
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
73
|
+
throw new Error(`Registry API URL must use http or https scheme, got: ${parsed.protocol}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (error instanceof Error && error.message.includes('scheme')) {
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
throw new Error(`Invalid Registry API URL: ${config.api.baseUrl}`);
|
|
81
|
+
}
|
|
82
|
+
if (config.api.apiKey === undefined || config.api.apiKey === '') {
|
|
83
|
+
throw new Error('API key is required. Set ULUOPS_API_KEY');
|
|
84
|
+
}
|
|
85
|
+
if (config.api.timeout <= 0) {
|
|
86
|
+
throw new Error('Timeout must be a positive number');
|
|
87
|
+
}
|
|
88
|
+
if (config.api.retries < 0) {
|
|
89
|
+
throw new Error('Retries must be a non-negative number');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|