@agifyai/leadify-mcp 8.4.1 → 8.4.2
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 +2 -0
- package/dist/server.js +3 -2
- package/dist/tools/auth.d.ts +5 -1
- package/dist/tools/auth.js +31 -2
- package/dist/version.d.ts +3 -0
- package/dist/version.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Serveur MCP (Model Context Protocol) pour l'API Leadify. Expose les endpoints RE
|
|
|
4
4
|
|
|
5
5
|
Package npm : [`@agifyai/leadify-mcp`](https://www.npmjs.com/package/@agifyai/leadify-mcp)
|
|
6
6
|
|
|
7
|
+
`get_mcp_runtime_info` est le diagnostic de livraison en lecture seule. Il expose la version exacte du package et du serveur, puis vérifie qu'un `organization_id` explicitement choisi est accessible à la clé configurée. Il ne lit aucun prospect et n'effectue aucune écriture, aucun envoi, aucune publication ni activation.
|
|
8
|
+
|
|
7
9
|
---
|
|
8
10
|
|
|
9
11
|
## 📦 Pour les utilisateurs
|
package/dist/server.js
CHANGED
|
@@ -15,10 +15,11 @@ import { registerFineTuningTools } from "./tools/fine_tuning.js";
|
|
|
15
15
|
import { registerContextWorkspaceTools } from "./tools/context_workspace.js";
|
|
16
16
|
import { registerLeadViewTools } from "./tools/views.js";
|
|
17
17
|
import { registerRelationshipTools } from "./tools/relationships.js";
|
|
18
|
+
import { MCP_SERVER_NAME, MCP_VERSION } from "./version.js";
|
|
18
19
|
export function createServer() {
|
|
19
20
|
const server = new McpServer({
|
|
20
|
-
name:
|
|
21
|
-
version:
|
|
21
|
+
name: MCP_SERVER_NAME,
|
|
22
|
+
version: MCP_VERSION,
|
|
22
23
|
});
|
|
23
24
|
registerAuthTools(server);
|
|
24
25
|
registerOrganizationTools(server);
|
package/dist/tools/auth.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
|
|
2
|
+
import { getClient } from "../client.js";
|
|
3
|
+
type ReadClient = Pick<ReturnType<typeof getClient>, "get">;
|
|
4
|
+
export declare function projectMcpRuntimeInfo(data: unknown, organizationId: string): Record<string, unknown>;
|
|
5
|
+
export declare function registerAuthTools(server: McpServer, injectedClient?: ReadClient): void;
|
|
6
|
+
export {};
|
package/dist/tools/auth.js
CHANGED
|
@@ -1,16 +1,45 @@
|
|
|
1
1
|
import { getClient } from "../client.js";
|
|
2
2
|
import { toolResult, handleToolError } from "../types.js";
|
|
3
|
-
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { MCP_PACKAGE_NAME, MCP_SERVER_NAME, MCP_VERSION } from "../version.js";
|
|
5
|
+
export function projectMcpRuntimeInfo(data, organizationId) {
|
|
6
|
+
const source = data && typeof data === "object" ? data : {};
|
|
7
|
+
const organizations = Array.isArray(source.organizations) ? source.organizations : [];
|
|
8
|
+
const organization = organizations.find((candidate) => candidate.id === organizationId);
|
|
9
|
+
return {
|
|
10
|
+
package: MCP_PACKAGE_NAME,
|
|
11
|
+
server: MCP_SERVER_NAME,
|
|
12
|
+
version: MCP_VERSION,
|
|
13
|
+
organization: organization ? { id: organization.id, name: organization.name ?? null, slug: organization.slug ?? null } : null,
|
|
14
|
+
organizationAccessible: Boolean(organization),
|
|
15
|
+
readOnly: true,
|
|
16
|
+
writes: 0,
|
|
17
|
+
sends: 0,
|
|
18
|
+
externalActivation: 0,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function registerAuthTools(server, injectedClient) {
|
|
4
22
|
server.tool("test_api_key", "Verify that the configured Leadify API key is valid and has not been revoked. " +
|
|
5
23
|
"Returns a success message if the key is active. Use this as a health check " +
|
|
6
24
|
"before performing other operations, or to diagnose authentication errors " +
|
|
7
25
|
"(401/403) from other tools.", {}, async () => {
|
|
8
26
|
try {
|
|
9
|
-
const data = await getClient().get("/test-api-key");
|
|
27
|
+
const data = await (injectedClient ?? getClient()).get("/test-api-key");
|
|
10
28
|
return toolResult(data);
|
|
11
29
|
}
|
|
12
30
|
catch (error) {
|
|
13
31
|
return handleToolError(error);
|
|
14
32
|
}
|
|
15
33
|
});
|
|
34
|
+
server.tool("get_mcp_runtime_info", "Read the exact Leadify MCP package/server version and verify that one explicitly selected organization is accessible to the configured API key. This diagnostic is read-only: it never reads prospects and never writes, sends, schedules, publishes, or activates anything.", {
|
|
35
|
+
organization_id: z.string().min(1).describe("Exact organization ID selected by the caller. The server never chooses an organization implicitly."),
|
|
36
|
+
}, async ({ organization_id }) => {
|
|
37
|
+
try {
|
|
38
|
+
const data = await (injectedClient ?? getClient()).get("/api/organizations");
|
|
39
|
+
return toolResult(projectMcpRuntimeInfo(data, organization_id));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return handleToolError(error);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
16
45
|
}
|
package/dist/version.js
ADDED