vcluster-yaml-mcp-server 1.3.0 → 1.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vcluster-yaml-mcp-server",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "MCP server for querying vcluster YAML configurations using jq",
5
5
  "repository": {
6
6
  "type": "git",
@@ -123,25 +123,31 @@ export function getMcpServerOptions() {
123
123
  tools: {},
124
124
  resources: {}
125
125
  },
126
- instructions: "vCluster configuration assistant. Read server://changelog on first use. If changes are dated within the current week AND relevant to your current task, briefly mention and offer details. Otherwise adapt silently. Use smart-query for any configuration questions (natural language search). Use create-vcluster-config when generating configs - it auto-validates. Use list-versions first to discover available versions. Use validate-config for user-provided YAML. Use extract-validation-rules to understand semantic constraints."
126
+ instructions: "vCluster configuration assistant. Call get-changelog on first use - if changes are within current week AND relevant to user's task, briefly mention. Use smart-query for configuration questions. Use create-vcluster-config when generating configs (auto-validates). Use list-versions to discover versions. Use validate-config for user YAML. Use extract-validation-rules for semantic constraints."
127
127
  };
128
128
  }
129
129
 
130
+ const CHANGELOG_URL = 'https://raw.githubusercontent.com/Piotr1215/vcluster-yaml-mcp/main/CHANGELOG.md';
131
+
130
132
  /**
131
- * Get changelog from CHANGELOG.md file
132
- * @returns {Object} Changelog with version and content
133
+ * Fetch changelog from GitHub
134
+ * @returns {Promise<Object>} Changelog with version and content
133
135
  */
134
- export function getChangelog() {
136
+ export async function getChangelog() {
135
137
  try {
136
- const content = readFileSync(join(__dirname, '../CHANGELOG.md'), 'utf-8');
138
+ const response = await fetch(CHANGELOG_URL);
139
+ if (!response.ok) {
140
+ throw new Error(`HTTP ${response.status}`);
141
+ }
142
+ const content = await response.text();
137
143
  return {
138
144
  version: packageJson.version,
139
145
  content
140
146
  };
141
- } catch {
147
+ } catch (error) {
142
148
  return {
143
149
  version: packageJson.version,
144
- content: 'Changelog unavailable'
150
+ content: `Changelog unavailable: ${error.message}`
145
151
  };
146
152
  }
147
153
  }
package/src/server.js CHANGED
@@ -112,6 +112,32 @@ export function createServer() {
112
112
  }
113
113
  );
114
114
 
115
+ // Register: get-server-info (tool wrapper for clients that don't support resources)
116
+ server.registerTool(
117
+ 'get-server-info',
118
+ {
119
+ description: 'Get server version, available tools, and metadata. Call on first use to check for updates.',
120
+ inputSchema: z.object({}),
121
+ annotations: { readOnlyHint: true }
122
+ },
123
+ async () => ({
124
+ content: [{ type: 'text', text: JSON.stringify(getServerInfo(), null, 2) }]
125
+ })
126
+ );
127
+
128
+ // Register: get-changelog
129
+ server.registerTool(
130
+ 'get-changelog',
131
+ {
132
+ description: 'Get recent release history. Check for changes relevant to your task.',
133
+ inputSchema: z.object({}),
134
+ annotations: { readOnlyHint: true }
135
+ },
136
+ async () => ({
137
+ content: [{ type: 'text', text: JSON.stringify(await getChangelog(), null, 2) }]
138
+ })
139
+ );
140
+
115
141
  // Register resource: server://info
116
142
  server.registerResource(
117
143
  'server-info',
@@ -144,7 +170,7 @@ export function createServer() {
144
170
  {
145
171
  uri: uri.href,
146
172
  mimeType: 'application/json',
147
- text: JSON.stringify(getChangelog(), null, 2)
173
+ text: JSON.stringify(await getChangelog(), null, 2)
148
174
  }
149
175
  ]
150
176
  })