@warmio/mcp 7.0.1 → 9.0.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.
@@ -1,4 +1,5 @@
1
- import { getWarmApiKeyPath, readConfigFile, } from './config-paths.js';
1
+ import { getWarmApiKeyPath, readConfigFile } from './config-paths.js';
2
+ import { WARM_MCP_CREDENTIALS, WARM_MCP_INSTALLER_COMMANDS, } from '@warmio/contracts/mcp';
2
3
  const DEFAULT_API_URL = process.env.WARM_API_URL || 'https://app.warm.io';
3
4
  const DEFAULT_REQUEST_TIMEOUT_MS = (() => {
4
5
  const raw = Number(process.env.WARM_API_TIMEOUT_MS || 10_000);
@@ -27,7 +28,7 @@ export function getConfiguredApiKey(audience = 'context') {
27
28
  if (cachedApiKeys.has(audience)) {
28
29
  return cachedApiKeys.get(audience) ?? null;
29
30
  }
30
- const environmentKey = audience === 'automation' ? 'WARM_AUTOMATION_API_KEY' : 'WARM_CONTEXT_API_KEY';
31
+ const environmentKey = WARM_MCP_CREDENTIALS[audience].apiKeyEnv;
31
32
  const apiKey = process.env[environmentKey]?.trim() || readConfigFile(getWarmApiKeyPath(audience));
32
33
  cachedApiKeys.set(audience, apiKey);
33
34
  return apiKey;
@@ -65,7 +66,7 @@ async function requestWarmApi(request, options) {
65
66
  const requestOptions = createWarmApiClientConfig(options);
66
67
  const apiKey = requestOptions.apiKeyResolver?.() ?? getConfiguredApiKey(requestOptions.audience);
67
68
  if (!apiKey) {
68
- throw new Error(`No ${requestOptions.audience} API key configured. Run "npx @warmio/mcp install --mode ${requestOptions.audience}" or set ${requestOptions.audience === 'automation' ? 'WARM_AUTOMATION_API_KEY' : 'WARM_CONTEXT_API_KEY'}.`);
69
+ throw new Error(`No ${requestOptions.audience} API key configured. Run "${WARM_MCP_INSTALLER_COMMANDS[requestOptions.audience]}" or set ${WARM_MCP_CREDENTIALS[requestOptions.audience].apiKeyEnv}.`);
69
70
  }
70
71
  const url = new URL(request.endpoint, requestOptions.apiUrl);
71
72
  Object.entries(request.query || {}).forEach(([key, value]) => {
@@ -147,11 +148,15 @@ export function createWarmApiClient(options = {}) {
147
148
  const expectedAudience = createWarmApiClientConfig(options).audience;
148
149
  if (!result.valid || result.audience !== expectedAudience) {
149
150
  const article = expectedAudience === 'automation' ? 'an' : 'a';
150
- throw new Error(`This MCP mode requires ${article} ${expectedAudience} API key. Run "npx @warmio/mcp install --mode ${expectedAudience}" to configure a separate key.`);
151
+ throw new Error(`This MCP mode requires ${article} ${expectedAudience} API key. Run "${WARM_MCP_INSTALLER_COMMANDS[expectedAudience]}" to configure a separate key.`);
151
152
  }
152
153
  return result;
153
154
  };
154
- const searchOperations = async (query) => await requestSuccessfulJson({ body: query ? { query } : {}, endpoint: '/api/automation/operations/search', method: 'POST' }, options);
155
+ const searchOperations = async (query) => await requestSuccessfulJson({
156
+ body: query ? { query } : {},
157
+ endpoint: '/api/automation/operations/search',
158
+ method: 'POST',
159
+ }, options);
155
160
  const describeOperation = async (operationId, input) => await requestSuccessfulJson({
156
161
  body: { operation_id: operationId, ...(input ? { input } : {}) },
157
162
  endpoint: '/api/automation/operations/describe',
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@warmio/mcp",
3
- "version": "7.0.1",
3
+ "version": "9.0.0",
4
4
  "mcpName": "io.github.jasonstockman/warmio",
5
5
  "description": "Warm CLI and compact context or automation MCP server",
6
6
  "type": "module",
7
+ "engines": {
8
+ "node": ">=18"
9
+ },
7
10
  "main": "dist/index.js",
8
11
  "types": "dist/index.d.ts",
9
12
  "publishConfig": {
@@ -34,7 +37,7 @@
34
37
  "dist"
35
38
  ],
36
39
  "scripts": {
37
- "build": "tsc",
40
+ "build": "node scripts/clean.mjs && tsc",
38
41
  "test": "npm run build && node --test test/*.mjs",
39
42
  "start": "node dist/index.js mcp",
40
43
  "start:http": "node dist/index.js http",
@@ -52,7 +55,12 @@
52
55
  "chatgpt"
53
56
  ],
54
57
  "license": "MIT",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/jasonstockman/warm-mcp.git"
61
+ },
55
62
  "dependencies": {
63
+ "@warmio/contracts": "1.1.0",
56
64
  "@modelcontextprotocol/sdk": "^1.27.1",
57
65
  "dotenv": "^17.2.3",
58
66
  "zod": "^3.25.76"