rhombus-node-mcp 0.1.7 → 0.1.8

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 (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ const RHOMBUS_API_KEY = process.env.RHOMBUS_API_KEY;
8
8
  if (!RHOMBUS_API_KEY) {
9
9
  console.error("Missing RHOMBUS_API_KEY");
10
10
  }
11
+ const enableLogs = process.env.ENABLE_LOGS;
11
12
  const BASE_URL = "https://api2.rhombussystems.com/api";
12
13
  const STATIC_HEADERS = {
13
14
  "Content-Type": "application/json",
@@ -31,14 +32,20 @@ const STATIC_ARGS = {
31
32
  .optional(z.any())
32
33
  .describe("Optional headers accepted by tools. LLM should never ever use this. 😅"),
33
34
  };
35
+ const log = (msg) => {
36
+ if (!enableLogs)
37
+ return;
38
+ console.error(msg);
39
+ };
34
40
  async function postApi(url, body, customHeaders) {
35
41
  let headers = {
36
42
  ...(customHeaders || AUTH_HEADERS),
37
43
  ...STATIC_HEADERS,
38
44
  };
39
45
  try {
40
- console.error(`[POSTAPI] - ${url} - ${body} - ${JSON.stringify(customHeaders)}`);
46
+ log(`[POSTAPI] REQUEST - ${url} - ${body} - ${JSON.stringify(customHeaders)}`);
41
47
  const response = await fetch(url, { method: "POST", headers, body });
48
+ log(`[POSTAPI] RESPONSE - ${JSON.stringify(response || {})}`);
42
49
  if (!response.ok) {
43
50
  if (response.status === 401 || response.status === 403) {
44
51
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhombus-node-mcp",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "MCP server for Rhombus API",
5
5
  "keywords": [
6
6
  "ai",