@ferrlabs/mcp-core 6.0.0 → 6.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.
@@ -2,6 +2,12 @@ interface RequestOptions {
2
2
  method?: string;
3
3
  body?: unknown;
4
4
  token?: string;
5
+ /**
6
+ * Override the API base URL for this call. Sub-MCPs targeting per-product
7
+ * APIs (e.g. `api.ferrgrowth.com`, `api.ferrfleet.com`) set this on each
8
+ * tool call. Falls back to `API_URL` env var, then `api.ferrlabs.com`.
9
+ */
10
+ baseUrl?: string;
5
11
  }
6
12
  export declare function apiRequest<T>(path: string, options?: RequestOptions): Promise<T>;
7
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC,CA0C1F"}
1
+ {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC,CA2C1F"}
@@ -1,6 +1,7 @@
1
- const API_URL = process.env.API_URL ?? 'https://api.ferrlabs.com';
1
+ const DEFAULT_API_URL = process.env.API_URL ?? 'https://api.ferrlabs.com';
2
2
  export async function apiRequest(path, options = {}) {
3
- const { method = 'GET', body, token } = options;
3
+ const { method = 'GET', body, token, baseUrl } = options;
4
+ const base = baseUrl ?? DEFAULT_API_URL;
4
5
  const headers = {
5
6
  'Content-Type': 'application/json',
6
7
  'User-Agent': 'ferrlabs-mcp/4.0.0',
@@ -9,7 +10,7 @@ export async function apiRequest(path, options = {}) {
9
10
  headers['x-api-token'] = token;
10
11
  headers['Authorization'] = `Bearer ${token}`;
11
12
  }
12
- const res = await fetch(`${API_URL}${path}`, {
13
+ const res = await fetch(`${base}${path}`, {
13
14
  method,
14
15
  headers,
15
16
  body: body ? JSON.stringify(body) : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferrlabs/mcp-core",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Shared core for FerrLabs MCP servers — auth, transports (stdio + Streamable HTTP), api-client, runner",
5
5
  "license": "MPL-2.0",
6
6
  "type": "module",