@webeyez/mcp-server 1.0.6 → 1.0.7
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 +91 -48
- package/dist/client.js +108 -0
- package/package.json +6 -3
- package/dist/claude-proxy.js +0 -377
- package/dist/index.js +0 -146
- package/dist/install-env.js +0 -83
- package/dist/setup.js +0 -56
- package/dist/tools/agents.proto +0 -20
- package/dist/tools/auth.js +0 -138
- package/dist/tools/job-store.js +0 -31
- package/dist/tools/organization.proto +0 -102
- package/dist/tools/public.js +0 -423
- package/dist/utils/paths.js +0 -22
package/dist/tools/agents.proto
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package agents;
|
|
4
|
-
|
|
5
|
-
service AgentsService {
|
|
6
|
-
rpc AskWz (AskWzRequest) returns (AskWzResponse) {}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
message AskWzRequest {
|
|
10
|
-
string question = 1;
|
|
11
|
-
string domain = 2;
|
|
12
|
-
int32 customerId = 3;
|
|
13
|
-
string dateRange = 4;
|
|
14
|
-
string conversationId = 5;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
message AskWzResponse {
|
|
18
|
-
string response = 1; // JSON serialized string of the response
|
|
19
|
-
string conversationId = 2;
|
|
20
|
-
}
|
package/dist/tools/auth.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupAuthTools = setupAuthTools;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
// Helper function to simulate checking auth
|
|
6
|
-
// In a real implementation, you might extract the token from the Request
|
|
7
|
-
// or expect it in the tool arguments, but usually in MCP over SSE, you
|
|
8
|
-
// can pass connection-level context. For now, we simulate returning a requires_auth error if needed.
|
|
9
|
-
const checkAuth = (authProvided) => {
|
|
10
|
-
if (!authProvided) {
|
|
11
|
-
return {
|
|
12
|
-
status: "requires_auth",
|
|
13
|
-
summary: "This action requires a Webeyez account connection.",
|
|
14
|
-
next_action: "Ask the user to connect Webeyez using OAuth.",
|
|
15
|
-
auth_url: "https://app.webeyez.com/oauth/authorize..."
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return null;
|
|
19
|
-
};
|
|
20
|
-
function setupAuthTools(server) {
|
|
21
|
-
server.tool("list_accounts", "List all accounts the authenticated user has access to.", {
|
|
22
|
-
access_token: zod_1.z.string().describe("OAuth access token")
|
|
23
|
-
}, async ({ access_token }) => {
|
|
24
|
-
const authError = checkAuth(!!access_token);
|
|
25
|
-
if (authError)
|
|
26
|
-
return { content: [{ type: "text", text: JSON.stringify(authError) }] };
|
|
27
|
-
return {
|
|
28
|
-
content: [{
|
|
29
|
-
type: "text",
|
|
30
|
-
text: JSON.stringify({
|
|
31
|
-
status: "success",
|
|
32
|
-
summary: "Retrieved accounts.",
|
|
33
|
-
data: {
|
|
34
|
-
accounts: [
|
|
35
|
-
{ account_id: "acc_1", name: "Acme Corp" }
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
}]
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
server.tool("list_sites", "List all sites for the authenticated user/account.", {
|
|
43
|
-
access_token: zod_1.z.string().describe("OAuth access token")
|
|
44
|
-
}, async ({ access_token }) => {
|
|
45
|
-
const authError = checkAuth(!!access_token);
|
|
46
|
-
if (authError)
|
|
47
|
-
return { content: [{ type: "text", text: JSON.stringify(authError) }] };
|
|
48
|
-
return {
|
|
49
|
-
content: [{
|
|
50
|
-
type: "text",
|
|
51
|
-
text: JSON.stringify({
|
|
52
|
-
status: "success",
|
|
53
|
-
summary: "Retrieved sites.",
|
|
54
|
-
data: {
|
|
55
|
-
sites: [
|
|
56
|
-
{ site_id: "site_1", domain: "acme.com", status: "active" }
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
}]
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
server.tool("get_site_status", "Get the status of a specific site.", {
|
|
64
|
-
access_token: zod_1.z.string(),
|
|
65
|
-
site_id: zod_1.z.string()
|
|
66
|
-
}, async ({ access_token, site_id }) => {
|
|
67
|
-
const authError = checkAuth(!!access_token);
|
|
68
|
-
if (authError)
|
|
69
|
-
return { content: [{ type: "text", text: JSON.stringify(authError) }] };
|
|
70
|
-
return {
|
|
71
|
-
content: [{
|
|
72
|
-
type: "text",
|
|
73
|
-
text: JSON.stringify({
|
|
74
|
-
status: "success",
|
|
75
|
-
summary: `Status for site ${site_id}`,
|
|
76
|
-
data: { site_id, active: true, tracking: true }
|
|
77
|
-
})
|
|
78
|
-
}]
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
server.tool("get_revenue_loss_estimate", "Get the estimated revenue loss for a site over a date range.", {
|
|
82
|
-
access_token: zod_1.z.string(),
|
|
83
|
-
site_id: zod_1.z.string(),
|
|
84
|
-
date_range: zod_1.z.string().describe("e.g. 'last_7_days', 'last_30_days'")
|
|
85
|
-
}, async ({ access_token, site_id, date_range }) => {
|
|
86
|
-
const authError = checkAuth(!!access_token);
|
|
87
|
-
if (authError)
|
|
88
|
-
return { content: [{ type: "text", text: JSON.stringify(authError) }] };
|
|
89
|
-
return {
|
|
90
|
-
content: [{
|
|
91
|
-
type: "text",
|
|
92
|
-
text: JSON.stringify({
|
|
93
|
-
status: "success",
|
|
94
|
-
summary: `Revenue loss estimate for ${site_id}`,
|
|
95
|
-
data: {
|
|
96
|
-
date_range,
|
|
97
|
-
estimated_loss: "$1,250.00",
|
|
98
|
-
top_issue: "Checkout JS Error"
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
}]
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
// Add other auth tools as stubs...
|
|
105
|
-
const authStubTools = [
|
|
106
|
-
"get_funnel_summary",
|
|
107
|
-
"get_checkout_dropoffs",
|
|
108
|
-
"get_js_errors",
|
|
109
|
-
"get_failed_api_calls",
|
|
110
|
-
"get_session_examples",
|
|
111
|
-
"create_issue_export",
|
|
112
|
-
"connect_shopify_store",
|
|
113
|
-
"connect_magento_store",
|
|
114
|
-
"manage_tracker_settings"
|
|
115
|
-
];
|
|
116
|
-
authStubTools.forEach(toolName => {
|
|
117
|
-
server.tool(toolName, `Authenticated tool: ${toolName}`, {
|
|
118
|
-
access_token: zod_1.z.string(),
|
|
119
|
-
site_id: zod_1.z.string().optional(),
|
|
120
|
-
date_range: zod_1.z.string().optional(),
|
|
121
|
-
issue_id: zod_1.z.string().optional()
|
|
122
|
-
}, async ({ access_token }) => {
|
|
123
|
-
const authError = checkAuth(!!access_token);
|
|
124
|
-
if (authError)
|
|
125
|
-
return { content: [{ type: "text", text: JSON.stringify(authError) }] };
|
|
126
|
-
return {
|
|
127
|
-
content: [{
|
|
128
|
-
type: "text",
|
|
129
|
-
text: JSON.stringify({
|
|
130
|
-
status: "success",
|
|
131
|
-
summary: `Executed ${toolName} successfully.`,
|
|
132
|
-
data: { mocked: true }
|
|
133
|
-
})
|
|
134
|
-
}]
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
}
|
package/dist/tools/job-store.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InMemoryJobStore = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Default in-memory implementation of the JobStore.
|
|
6
|
-
* To scale horizontally, swap this with a RedisJobStore or DatabaseJobStore.
|
|
7
|
-
*/
|
|
8
|
-
class InMemoryJobStore {
|
|
9
|
-
activeJobs = new Map();
|
|
10
|
-
constructor() {
|
|
11
|
-
// Run cleanup interval every 1 minute to prune jobs older than 10 minutes
|
|
12
|
-
setInterval(() => {
|
|
13
|
-
const tenMinutesAgo = Date.now() - 10 * 60 * 1000;
|
|
14
|
-
for (const [jobId, job] of this.activeJobs.entries()) {
|
|
15
|
-
if (job.startedAt < tenMinutesAgo) {
|
|
16
|
-
this.activeJobs.delete(jobId);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}, 60 * 1000);
|
|
20
|
-
}
|
|
21
|
-
async get(jobId) {
|
|
22
|
-
return this.activeJobs.get(jobId);
|
|
23
|
-
}
|
|
24
|
-
async set(jobId, state) {
|
|
25
|
-
this.activeJobs.set(jobId, state);
|
|
26
|
-
}
|
|
27
|
-
async delete(jobId) {
|
|
28
|
-
this.activeJobs.delete(jobId);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.InMemoryJobStore = InMemoryJobStore;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package OrganizationService;
|
|
4
|
-
|
|
5
|
-
service OrganizationService{
|
|
6
|
-
rpc configList (request) returns (response){}
|
|
7
|
-
rpc creteConfig (creteConfigRequest) returns (response){}
|
|
8
|
-
rpc updateConfig (updateConfigRequest) returns (response){}
|
|
9
|
-
rpc deleteConfig (request) returns (response){}
|
|
10
|
-
rpc orgDetailsByUserId (orgDetailsByUserIdRequest) returns (response){}
|
|
11
|
-
rpc orgDetails (orgDetailsByOrgIdRequest) returns (response){}
|
|
12
|
-
rpc organizationsList (organizationsListRequest) returns (response) {}
|
|
13
|
-
rpc findOrgAovAndCurrency (findOrgAovAndCurrencyRequest) returns (response){}
|
|
14
|
-
rpc areTheyInSameOrg (areTheyInSameOrgRequest) returns (areTheyInSameOrgResponse) {}
|
|
15
|
-
rpc getOrganizationUsers (getOrgUsersRequest) returns (response) {}
|
|
16
|
-
rpc getAgencyUsersAssignedToOrg (getOrgUsersRequest) returns (response) {}
|
|
17
|
-
rpc autoAddUptimeUrls (AutoAddRequest) returns (AutoAddResponse) {}
|
|
18
|
-
rpc GetReport (GetReportRequest) returns (GetReportResponse) {}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
message organizationAOVRequest {
|
|
22
|
-
string dateRange=1;
|
|
23
|
-
string domain =2;
|
|
24
|
-
int32 orgId =3;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
message organizationsListRequest {
|
|
28
|
-
int32 userId = 1;
|
|
29
|
-
optional int32 agencyId = 2;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// common response
|
|
33
|
-
message request{
|
|
34
|
-
string payload=1;
|
|
35
|
-
}
|
|
36
|
-
message response{
|
|
37
|
-
string response=1;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
message creteConfigRequest{
|
|
42
|
-
int32 userId=1;
|
|
43
|
-
string payload=2;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
message updateConfigRequest{
|
|
47
|
-
int32 userId=1;
|
|
48
|
-
string payload=2;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
message orgDetailsByUserIdRequest{
|
|
52
|
-
int32 userId=1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
message orgDetailsByOrgIdRequest{
|
|
56
|
-
int32 orgId=1;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
message findOrgAovAndCurrencyRequest{
|
|
60
|
-
int32 orgId=1;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
message UserInfo{
|
|
64
|
-
int32 UserId=1;
|
|
65
|
-
int32 agencyId=2;
|
|
66
|
-
int32 roleId=3;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
message areTheyInSameOrgRequest{
|
|
70
|
-
UserInfo userInfo=1;
|
|
71
|
-
int32 updatedUserId=2;
|
|
72
|
-
int32 orgId=3;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
message areTheyInSameOrgResponse {
|
|
76
|
-
bool isInSameOrg = 1;
|
|
77
|
-
string error = 2;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
message getOrgUsersRequest {
|
|
81
|
-
int32 orgId=1;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
message AutoAddRequest {
|
|
86
|
-
int32 orgId = 1;
|
|
87
|
-
string domain = 2;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
message AutoAddResponse {
|
|
91
|
-
string response = 1;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
message GetReportRequest {
|
|
95
|
-
string key = 1;
|
|
96
|
-
map<string, string> filters = 2;
|
|
97
|
-
map<string, string> segments = 3;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
message GetReportResponse {
|
|
101
|
-
string json = 1;
|
|
102
|
-
}
|