@magnetlab/mcp 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @magnetlab/mcp
2
2
 
3
- MCP server for [MagnetLab](https://magnetlab.ai) -- control your lead magnets, funnels, content pipeline, and analytics from Claude Code or Claude Desktop.
3
+ MCP server for [MagnetLab](https://magnetlab.app) -- control your lead magnets, funnels, content pipeline, and analytics from Claude Code or Claude Desktop.
4
4
 
5
5
  ## Quick Setup
6
6
 
@@ -42,7 +42,7 @@ Add to your `claude_desktop_config.json`:
42
42
 
43
43
  ## Getting Your API Key
44
44
 
45
- 1. Log in to [MagnetLab](https://magnetlab.ai)
45
+ 1. Log in to [MagnetLab](https://magnetlab.app)
46
46
  2. Go to **Settings > API Keys**
47
47
  3. Click **Create API Key**
48
48
  4. Copy the key (starts with `ml_live_`)
@@ -69,7 +69,7 @@ Add to your `claude_desktop_config.json`:
69
69
  | Variable | Required | Description |
70
70
  |----------|----------|-------------|
71
71
  | `MAGNETLAB_API_KEY` | Yes | Your MagnetLab API key (starts with `ml_live_`) |
72
- | `MAGNETLAB_BASE_URL` | No | Override the API base URL (default: `https://magnetlab.ai`) |
72
+ | `MAGNETLAB_BASE_URL` | No | Override the API base URL (default: `https://magnetlab.app`) |
73
73
 
74
74
  ## CLI Usage
75
75
 
package/dist/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // packages/mcp/src/client.ts
2
- const DEFAULT_BASE_URL = 'https://magnetlab.ai/api';
2
+ const DEFAULT_BASE_URL = 'https://www.magnetlab.app/api';
3
3
  export class MagnetLabClient {
4
4
  apiKey;
5
5
  baseUrl;
@@ -13,11 +13,24 @@ export class MagnetLabClient {
13
13
  Authorization: `Bearer ${this.apiKey}`,
14
14
  'Content-Type': 'application/json',
15
15
  };
16
- const response = await fetch(url, {
16
+ let response = await fetch(url, {
17
17
  method,
18
18
  headers,
19
19
  body: body ? JSON.stringify(body) : undefined,
20
+ redirect: 'manual',
20
21
  });
22
+ // Follow redirects manually to preserve the Authorization header
23
+ if (response.status >= 300 && response.status < 400) {
24
+ const location = response.headers.get('location');
25
+ if (location) {
26
+ response = await fetch(location, {
27
+ method,
28
+ headers,
29
+ body: body ? JSON.stringify(body) : undefined,
30
+ redirect: 'manual',
31
+ });
32
+ }
33
+ }
21
34
  if (!response.ok) {
22
35
  const error = await response.json().catch(() => ({ error: 'Unknown error' }));
23
36
  throw new Error(error.error || `Request failed: ${response.status}`);
@@ -43,7 +56,7 @@ export class MagnetLabClient {
43
56
  return this.request('GET', `/lead-magnet?${searchParams}`);
44
57
  }
45
58
  async getLeadMagnet(id) {
46
- return this.request('GET', `/external/lead-magnets/${id}`);
59
+ return this.request('GET', `/lead-magnet/${id}`);
47
60
  }
48
61
  async createLeadMagnet(params) {
49
62
  return this.request('POST', `/lead-magnet`, params);
@@ -55,13 +68,13 @@ export class MagnetLabClient {
55
68
  return this.request('POST', `/lead-magnet/ideate`, params);
56
69
  }
57
70
  async extractContent(leadMagnetId, params) {
58
- return this.request('POST', `/external/lead-magnets/${leadMagnetId}/extract`, params);
71
+ return this.request('POST', `/lead-magnet/extract`, params);
59
72
  }
60
73
  async generateContent(leadMagnetId, params) {
61
- return this.request('POST', `/external/lead-magnets/${leadMagnetId}/generate`, params);
74
+ return this.request('POST', `/lead-magnet/generate`, params);
62
75
  }
63
76
  async writeLinkedInPosts(leadMagnetId, params) {
64
- return this.request('POST', `/external/lead-magnets/${leadMagnetId}/write-posts`, params);
77
+ return this.request('POST', `/lead-magnet/write-post`, params);
65
78
  }
66
79
  async polishLeadMagnetContent(leadMagnetId) {
67
80
  return this.request('POST', `/lead-magnet/${leadMagnetId}/polish`, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magnetlab/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "MCP server for MagnetLab - control your lead magnets, funnels, content pipeline, and analytics from Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "url": "https://github.com/modernagencysales/magnetlab",
37
37
  "directory": "packages/mcp"
38
38
  },
39
- "homepage": "https://magnetlab.ai",
39
+ "homepage": "https://magnetlab.app",
40
40
  "dependencies": {
41
41
  "@modelcontextprotocol/sdk": "^1.0.0",
42
42
  "commander": "^12.0.0",