zernio-mcp 1.0.0 → 1.1.1
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 +113 -91
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +36 -35
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -48
- package/dist/index.js.map +1 -0
- package/dist/tools/accounts.d.ts +52 -0
- package/dist/tools/accounts.d.ts.map +1 -0
- package/dist/tools/accounts.js +16 -1
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/analytics.d.ts +167 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +90 -1
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/comments.d.ts +91 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +124 -14
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/messages.d.ts +121 -0
- package/dist/tools/messages.d.ts.map +1 -0
- package/dist/tools/messages.js +112 -12
- package/dist/tools/messages.js.map +1 -0
- package/dist/tools/reviews.d.ts +74 -0
- package/dist/tools/reviews.d.ts.map +1 -0
- package/dist/tools/reviews.js +72 -10
- package/dist/tools/reviews.js.map +1 -0
- package/package.json +46 -38
package/README.md
CHANGED
|
@@ -1,143 +1,165 @@
|
|
|
1
1
|
# zernio-mcp
|
|
2
2
|
|
|
3
|
-
A Model Context Protocol (MCP) server that gives Claude
|
|
3
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that gives Claude full access to your [Zernio](https://zernio.com) social media accounts — inbox, analytics, comments, DMs, and reviews.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Zernio's official MCP only covers post scheduling. This server adds everything else: 27 tools covering your entire social media management workflow.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Quick Start
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- "Reply to the comment from @user123 saying thanks for your feedback!"
|
|
11
|
-
- "List my unread DMs on Facebook"
|
|
12
|
-
- "What are my follower stats this month on Instagram?"
|
|
13
|
-
- "Show me all 1-star Google reviews in the last 30 days"
|
|
14
|
-
- "Reply to that review with an apology and our contact info"
|
|
15
|
-
- "What's the best time to post on TikTok?"
|
|
16
|
-
- "How many impressions did my last 5 posts get?"
|
|
9
|
+
### Option 1: npx (recommended)
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
No installation needed. Add this to your `claude_desktop_config.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"zernio": {
|
|
17
|
+
"command": "npx",
|
|
18
|
+
"args": ["zernio-mcp"],
|
|
19
|
+
"env": {
|
|
20
|
+
"ZERNIO_API_KEY": "your_zernio_api_key_here"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Option 2: Local install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git clone https://github.com/Eyalm321/zernio-mcp.git
|
|
31
|
+
cd zernio-mcp
|
|
32
|
+
npm install
|
|
33
|
+
npm run build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then configure Claude Desktop:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"zernio": {
|
|
42
|
+
"command": "node",
|
|
43
|
+
"args": ["/absolute/path/to/zernio-mcp/dist/index.js"],
|
|
44
|
+
"env": {
|
|
45
|
+
"ZERNIO_API_KEY": "your_zernio_api_key_here"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Getting your API key
|
|
53
|
+
|
|
54
|
+
1. Log in to [zernio.com](https://zernio.com)
|
|
55
|
+
2. Go to **Settings → API Keys**
|
|
56
|
+
3. Create a new key and copy it
|
|
57
|
+
|
|
58
|
+
> **Required add-ons:** Enable the **Inbox** and **Analytics** add-ons in your Zernio plan to unlock all 27 tools.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Tools
|
|
19
63
|
|
|
20
64
|
### Accounts (2 tools)
|
|
21
65
|
| Tool | Description |
|
|
22
66
|
|------|-------------|
|
|
23
|
-
| `zernio_list_accounts` | List all connected social accounts with platform, username, and
|
|
24
|
-
| `zernio_get_follower_stats` | Get follower count and stats for
|
|
67
|
+
| `zernio_list_accounts` | List all connected social accounts with platform, username, and follower count |
|
|
68
|
+
| `zernio_get_follower_stats` | Get follower count and growth stats for a specific account |
|
|
25
69
|
|
|
26
70
|
### Comments (7 tools)
|
|
27
71
|
| Tool | Description |
|
|
28
72
|
|------|-------------|
|
|
29
|
-
| `zernio_list_commented_posts` | List posts
|
|
30
|
-
| `zernio_get_post_comments` | Get
|
|
31
|
-
| `zernio_reply_to_comment` | Reply to a comment
|
|
32
|
-
| `zernio_private_reply_to_comment` | Send a private
|
|
73
|
+
| `zernio_list_commented_posts` | List posts that have received comments |
|
|
74
|
+
| `zernio_get_post_comments` | Get all comments on a specific post |
|
|
75
|
+
| `zernio_reply_to_comment` | Reply publicly to a comment |
|
|
76
|
+
| `zernio_private_reply_to_comment` | Send a private reply to a comment (Facebook/Instagram) |
|
|
33
77
|
| `zernio_like_comment` | Like a comment |
|
|
34
78
|
| `zernio_hide_comment` | Hide a comment from public view |
|
|
35
|
-
| `zernio_delete_comment` |
|
|
79
|
+
| `zernio_delete_comment` | Delete a comment |
|
|
36
80
|
|
|
37
81
|
### Messages / DMs (5 tools)
|
|
38
82
|
| Tool | Description |
|
|
39
83
|
|------|-------------|
|
|
40
|
-
| `zernio_list_conversations` | List all DM conversations |
|
|
41
|
-
| `zernio_get_conversation` | Get
|
|
42
|
-
| `zernio_list_messages` |
|
|
43
|
-
| `zernio_send_message` | Send a DM
|
|
44
|
-
| `zernio_update_conversation_status` | Mark conversations read
|
|
84
|
+
| `zernio_list_conversations` | List all DM conversations across platforms |
|
|
85
|
+
| `zernio_get_conversation` | Get full message thread for a conversation |
|
|
86
|
+
| `zernio_list_messages` | List messages with optional filters |
|
|
87
|
+
| `zernio_send_message` | Send a DM reply to a conversation |
|
|
88
|
+
| `zernio_update_conversation_status` | Mark conversations as read/unread/archived |
|
|
45
89
|
|
|
46
90
|
### Reviews (3 tools)
|
|
47
91
|
| Tool | Description |
|
|
48
92
|
|------|-------------|
|
|
49
|
-
| `zernio_list_reviews` | List
|
|
50
|
-
| `zernio_reply_to_review` | Reply to a
|
|
51
|
-
| `zernio_delete_review_reply` | Delete
|
|
93
|
+
| `zernio_list_reviews` | List reviews across connected review platforms |
|
|
94
|
+
| `zernio_reply_to_review` | Reply to a review |
|
|
95
|
+
| `zernio_delete_review_reply` | Delete a review reply |
|
|
52
96
|
|
|
53
97
|
### Analytics (10 tools)
|
|
54
98
|
| Tool | Description |
|
|
55
99
|
|------|-------------|
|
|
56
|
-
| `zernio_get_post_analytics` |
|
|
57
|
-
| `zernio_get_follower_analytics` | Follower growth over time |
|
|
58
|
-
| `zernio_get_best_times_to_post` | Optimal posting times based on your audience |
|
|
59
|
-
| `zernio_get_daily_metrics` | Day-by-day
|
|
60
|
-
| `zernio_get_content_decay` | How post performance
|
|
61
|
-
| `zernio_get_instagram_insights` | Instagram reach, impressions, profile visits |
|
|
62
|
-
| `zernio_get_instagram_demographics` | Instagram audience age, gender, location |
|
|
63
|
-
| `zernio_get_google_business_performance` |
|
|
64
|
-
| `zernio_get_google_business_keywords` |
|
|
65
|
-
| `zernio_get_youtube_analytics` | YouTube daily
|
|
100
|
+
| `zernio_get_post_analytics` | Post-level metrics: impressions, reach, likes, comments, shares, saves, clicks |
|
|
101
|
+
| `zernio_get_follower_analytics` | Follower growth over time for an account |
|
|
102
|
+
| `zernio_get_best_times_to_post` | Optimal posting times based on your audience's engagement |
|
|
103
|
+
| `zernio_get_daily_metrics` | Day-by-day impressions, reach, engagement, and profile visits |
|
|
104
|
+
| `zernio_get_content_decay` | How post performance decays over time after publishing |
|
|
105
|
+
| `zernio_get_instagram_insights` | Instagram-specific reach, impressions, and profile visits |
|
|
106
|
+
| `zernio_get_instagram_demographics` | Instagram audience age, gender, and location breakdown |
|
|
107
|
+
| `zernio_get_google_business_performance` | Google Business Profile views, calls, direction requests *(requires Google Business connected)* |
|
|
108
|
+
| `zernio_get_google_business_keywords` | Search keywords people use to find your Google Business Profile *(requires Google Business connected)* |
|
|
109
|
+
| `zernio_get_youtube_analytics` | YouTube daily view counts and watch time for a specific video *(requires YouTube connected)* |
|
|
66
110
|
|
|
67
111
|
---
|
|
68
112
|
|
|
69
|
-
##
|
|
70
|
-
|
|
71
|
-
### 1. Prerequisites
|
|
72
|
-
|
|
73
|
-
- [Node.js](https://nodejs.org/) v18 or later
|
|
74
|
-
- A [Zernio](https://zernio.com) account with connected social media accounts
|
|
75
|
-
- [Claude Desktop](https://claude.ai/download)
|
|
76
|
-
|
|
77
|
-
### 2. Get Your Zernio API Key
|
|
78
|
-
|
|
79
|
-
Go to [zernio.com/dashboard/api-keys](https://zernio.com/dashboard/api-keys) and create an API key.
|
|
80
|
-
|
|
81
|
-
### 3. Install the MCP Server
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
git clone https://github.com/YOUR_USERNAME/zernio-mcp.git
|
|
85
|
-
cd zernio-mcp
|
|
86
|
-
npm install
|
|
87
|
-
npm run build
|
|
88
|
-
```
|
|
113
|
+
## Example prompts
|
|
89
114
|
|
|
90
|
-
|
|
115
|
+
Once configured, you can ask Claude things like:
|
|
91
116
|
|
|
92
|
-
|
|
117
|
+
- *"What comments came in today across all my social accounts?"*
|
|
118
|
+
- *"Reply to all unanswered DMs with a friendly acknowledgment"*
|
|
119
|
+
- *"Show me the engagement stats for my last 5 Facebook posts"*
|
|
120
|
+
- *"What's the best time to post on Instagram based on my audience?"*
|
|
121
|
+
- *"Summarize all new reviews and draft replies for the 1-star ones"*
|
|
122
|
+
- *"How have my follower counts changed over the past 30 days?"*
|
|
93
123
|
|
|
94
|
-
|
|
95
|
-
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
96
|
-
|
|
97
|
-
Add the Zernio MCP server:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"mcpServers": {
|
|
102
|
-
"zernio": {
|
|
103
|
-
"command": "node",
|
|
104
|
-
"args": ["/absolute/path/to/zernio-mcp/dist/index.js"],
|
|
105
|
-
"env": {
|
|
106
|
-
"ZERNIO_API_KEY": "your_api_key_here"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
```
|
|
124
|
+
---
|
|
112
125
|
|
|
113
|
-
|
|
126
|
+
## Supported platforms
|
|
114
127
|
|
|
115
|
-
|
|
128
|
+
Platforms depend on which accounts you've connected in Zernio:
|
|
116
129
|
|
|
117
|
-
|
|
130
|
+
- Facebook
|
|
131
|
+
- Instagram
|
|
132
|
+
- TikTok
|
|
133
|
+
- YouTube *(analytics only)*
|
|
134
|
+
- Google Business Profile *(analytics and reviews)*
|
|
135
|
+
- LinkedIn
|
|
136
|
+
- Twitter/X
|
|
137
|
+
- Threads
|
|
118
138
|
|
|
119
139
|
---
|
|
120
140
|
|
|
121
|
-
##
|
|
141
|
+
## Configuration reference
|
|
122
142
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
143
|
+
| Config key | Description |
|
|
144
|
+
|------------|-------------|
|
|
145
|
+
| `ZERNIO_API_KEY` | Your Zernio API key (required) |
|
|
126
146
|
|
|
127
147
|
---
|
|
128
148
|
|
|
129
149
|
## Development
|
|
130
150
|
|
|
131
151
|
```bash
|
|
132
|
-
|
|
133
|
-
|
|
152
|
+
npm install
|
|
153
|
+
npm run build # compile TypeScript
|
|
154
|
+
npm start # run the server
|
|
155
|
+
```
|
|
134
156
|
|
|
135
|
-
|
|
136
|
-
|
|
157
|
+
Built with:
|
|
158
|
+
- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
159
|
+
- [Zod](https://zod.dev) for schema validation
|
|
160
|
+
- TypeScript / Node.js
|
|
137
161
|
|
|
138
|
-
|
|
139
|
-
ZERNIO_API_KEY=your_key npm start
|
|
140
|
-
```
|
|
162
|
+
---
|
|
141
163
|
|
|
142
164
|
## License
|
|
143
165
|
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAQA,wBAAsB,aAAa,CAAC,CAAC,EACnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GAC7D,OAAO,CAAC,CAAC,CAAC,CA8BZ"}
|
package/dist/client.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zernioRequest = zernioRequest;
|
|
4
|
-
const BASE_URL = "https://zernio.com/api";
|
|
5
|
-
function getApiKey() {
|
|
6
|
-
const key = process.env.ZERNIO_API_KEY;
|
|
7
|
-
if (!key)
|
|
8
|
-
throw new Error("ZERNIO_API_KEY environment variable is not set");
|
|
9
|
-
return key;
|
|
10
|
-
}
|
|
11
|
-
async function zernioRequest(method, path, body, params) {
|
|
12
|
-
const url = new URL(`${BASE_URL}${path}`);
|
|
13
|
-
if (params) {
|
|
14
|
-
for (const [key, value] of Object.entries(params)) {
|
|
15
|
-
if (value !== undefined && value !== null && value !== "") {
|
|
16
|
-
url.searchParams.set(key, String(value));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const headers = {
|
|
21
|
-
Authorization: `Bearer ${getApiKey()}`,
|
|
22
|
-
"Content-Type": "application/json",
|
|
23
|
-
};
|
|
24
|
-
const options = {
|
|
25
|
-
method,
|
|
26
|
-
headers,
|
|
27
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
28
|
-
};
|
|
29
|
-
const res = await fetch(url.toString(), options);
|
|
30
|
-
if (!res.ok) {
|
|
31
|
-
const text = await res.text().catch(() => "");
|
|
32
|
-
throw new Error(`Zernio API error ${res.status}: ${text}`);
|
|
33
|
-
}
|
|
34
|
-
return res.json();
|
|
35
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zernioRequest = zernioRequest;
|
|
4
|
+
const BASE_URL = "https://zernio.com/api";
|
|
5
|
+
function getApiKey() {
|
|
6
|
+
const key = process.env.ZERNIO_API_KEY;
|
|
7
|
+
if (!key)
|
|
8
|
+
throw new Error("ZERNIO_API_KEY environment variable is not set");
|
|
9
|
+
return key;
|
|
10
|
+
}
|
|
11
|
+
async function zernioRequest(method, path, body, params) {
|
|
12
|
+
const url = new URL(`${BASE_URL}${path}`);
|
|
13
|
+
if (params) {
|
|
14
|
+
for (const [key, value] of Object.entries(params)) {
|
|
15
|
+
if (value !== undefined && value !== null && value !== "") {
|
|
16
|
+
url.searchParams.set(key, String(value));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const headers = {
|
|
21
|
+
Authorization: `Bearer ${getApiKey()}`,
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
};
|
|
24
|
+
const options = {
|
|
25
|
+
method,
|
|
26
|
+
headers,
|
|
27
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
28
|
+
};
|
|
29
|
+
const res = await fetch(url.toString(), options);
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
const text = await res.text().catch(() => "");
|
|
32
|
+
throw new Error(`Zernio API error ${res.status}: ${text}`);
|
|
33
|
+
}
|
|
34
|
+
return res.json();
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;AAQA,sCAmCC;AA3CD,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAE1C,SAAS,SAAS;IAChB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IACvC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAC5E,OAAO,GAAG,CAAC;AACb,CAAC;AAEM,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,IAAY,EACZ,IAA8B,EAC9B,MAA8D;IAE9D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,QAAQ,GAAG,IAAI,EAAE,CAAC,CAAC;IAE1C,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;gBAC1D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAA2B;QACtC,aAAa,EAAE,UAAU,SAAS,EAAE,EAAE;QACtC,cAAc,EAAE,kBAAkB;KACnC,CAAC;IAEF,MAAM,OAAO,GAAgB;QAC3B,MAAM;QACN,OAAO;QACP,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9C,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAEjD,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,EAAgB,CAAC;AAClC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,48 +1,58 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
5
|
-
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
|
-
const accounts_js_1 = require("./tools/accounts.js");
|
|
7
|
-
const comments_js_1 = require("./tools/comments.js");
|
|
8
|
-
const messages_js_1 = require("./tools/messages.js");
|
|
9
|
-
const reviews_js_1 = require("./tools/reviews.js");
|
|
10
|
-
const analytics_js_1 = require("./tools/analytics.js");
|
|
11
|
-
const server = new mcp_js_1.McpServer({
|
|
12
|
-
name: "zernio-mcp",
|
|
13
|
-
version: "1.
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
18
|
-
...
|
|
19
|
-
...
|
|
20
|
-
...
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
5
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
|
+
const accounts_js_1 = require("./tools/accounts.js");
|
|
7
|
+
const comments_js_1 = require("./tools/comments.js");
|
|
8
|
+
const messages_js_1 = require("./tools/messages.js");
|
|
9
|
+
const reviews_js_1 = require("./tools/reviews.js");
|
|
10
|
+
const analytics_js_1 = require("./tools/analytics.js");
|
|
11
|
+
const server = new mcp_js_1.McpServer({
|
|
12
|
+
name: "zernio-mcp",
|
|
13
|
+
version: "1.1.0",
|
|
14
|
+
});
|
|
15
|
+
// Combine all tool modules
|
|
16
|
+
const allTools = [
|
|
17
|
+
...accounts_js_1.accountTools,
|
|
18
|
+
...comments_js_1.commentTools,
|
|
19
|
+
...messages_js_1.messageTools,
|
|
20
|
+
...reviews_js_1.reviewTools,
|
|
21
|
+
...analytics_js_1.analyticsTools,
|
|
22
|
+
];
|
|
23
|
+
// Register every tool with the MCP server
|
|
24
|
+
for (const tool of allTools) {
|
|
25
|
+
server.tool(tool.name, tool.description, tool.inputSchema.shape,
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
async (args) => {
|
|
28
|
+
try {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
const result = await tool.handler(args);
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: "text",
|
|
35
|
+
text: JSON.stringify(result, null, 2),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async function main() {
|
|
50
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
51
|
+
await server.connect(transport);
|
|
52
|
+
console.error("Zernio MCP server running");
|
|
53
|
+
}
|
|
54
|
+
main().catch((err) => {
|
|
55
|
+
console.error("Fatal error:", err);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,oEAAoE;AACpE,wEAAiF;AACjF,qDAAmD;AACnD,qDAAmD;AACnD,qDAAmD;AACnD,mDAAiD;AACjD,uDAAsD;AAEtD,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IAC3B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,2BAA2B;AAC3B,MAAM,QAAQ,GAAG;IACf,GAAG,0BAAY;IACf,GAAG,0BAAY;IACf,GAAG,0BAAY;IACf,GAAG,wBAAW;IACd,GAAG,6BAAc;CAClB,CAAC;AAEF,0CAA0C;AAC1C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;IAC5B,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,WAAW,CAAC,KAAY;IAC7B,8DAA8D;IAC9D,KAAK,EAAE,IAAS,EAAE,EAAE;QAClB,IAAI,CAAC;YACH,8DAA8D;YAC9D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAW,CAAC,CAAC;YAC/C,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC7C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const accountTools: ({
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: z.ZodObject<{
|
|
6
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
platform?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
platform?: string | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
handler: (args: {
|
|
13
|
+
platform?: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
accounts: unknown[];
|
|
16
|
+
}>;
|
|
17
|
+
} | {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
inputSchema: z.ZodObject<{
|
|
21
|
+
accountId: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
accountId: string;
|
|
24
|
+
}, {
|
|
25
|
+
accountId: string;
|
|
26
|
+
}>;
|
|
27
|
+
handler: (args: {
|
|
28
|
+
accountId: string;
|
|
29
|
+
}) => Promise<unknown>;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: z.ZodObject<{
|
|
34
|
+
accountId: z.ZodString;
|
|
35
|
+
dateFrom: z.ZodOptional<z.ZodString>;
|
|
36
|
+
dateTo: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
accountId: string;
|
|
39
|
+
dateFrom?: string | undefined;
|
|
40
|
+
dateTo?: string | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
accountId: string;
|
|
43
|
+
dateFrom?: string | undefined;
|
|
44
|
+
dateTo?: string | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
handler: (args: {
|
|
47
|
+
accountId: string;
|
|
48
|
+
dateFrom?: string;
|
|
49
|
+
dateTo?: string;
|
|
50
|
+
}) => Promise<unknown>;
|
|
51
|
+
})[];
|
|
52
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY;;;;;;;;;;oBAaC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;kBACI,OAAO,EAAE;;;;;;;;;;;;oBAgBlC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;oBAerB;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAOlF,CAAC"}
|
package/dist/tools/accounts.js
CHANGED
|
@@ -30,5 +30,20 @@ exports.accountTools = [
|
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
+
{
|
|
34
|
+
name: "zernio_get_linkedin_mentions",
|
|
35
|
+
description: "Get LinkedIn mentions — posts and comments where your LinkedIn page was tagged or mentioned.",
|
|
36
|
+
inputSchema: zod_1.z.object({
|
|
37
|
+
accountId: zod_1.z.string().describe("The Zernio LinkedIn account ID"),
|
|
38
|
+
dateFrom: zod_1.z.string().optional().describe("Start date (ISO format)"),
|
|
39
|
+
dateTo: zod_1.z.string().optional().describe("End date (ISO format)"),
|
|
40
|
+
}),
|
|
41
|
+
handler: async (args) => {
|
|
42
|
+
return (0, client_js_1.zernioRequest)("GET", `/v1/accounts/${args.accountId}/linkedin-mentions`, undefined, {
|
|
43
|
+
dateFrom: args.dateFrom,
|
|
44
|
+
dateTo: args.dateTo,
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
},
|
|
33
48
|
];
|
|
34
|
-
//# sourceMappingURL=accounts.js.map
|
|
49
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAA6C;AAEhC,QAAA,YAAY,GAAG;IAC1B;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,mHAAmH;QACrH,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,OAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,mGAAmG,CACpG;SACJ,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,IAA2B,EAAE,EAAE;YAC7C,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAa,EAC9B,KAAK,EACL,cAAc,EACd,SAAS,EACT,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAC5B,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,WAAW,EACT,sEAAsE;QACxE,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;SACxD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,IAA2B,EAAE,EAAE;YAC7C,OAAO,IAAA,yBAAa,EAAC,KAAK,EAAE,6BAA6B,EAAE,SAAS,EAAE;gBACpE,UAAU,EAAE,IAAI,CAAC,SAAS;aAC3B,CAAC,CAAC;QACL,CAAC;KACF;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,WAAW,EACT,8FAA8F;QAChG,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;YAChE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;YACnE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;SAChE,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,IAA+D,EAAE,EAAE;YACjF,OAAO,IAAA,yBAAa,EAAC,KAAK,EAAE,gBAAgB,IAAI,CAAC,SAAS,oBAAoB,EAAE,SAAS,EAAE;gBACzF,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
|