bn-facebook-mcp-server 0.0.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 +245 -0
- package/dist/debug-middleware.d.ts +12 -0
- package/dist/debug-middleware.d.ts.map +1 -0
- package/dist/debug-middleware.js +36 -0
- package/dist/debug-middleware.js.map +1 -0
- package/dist/facebook-api-client.d.ts +68 -0
- package/dist/facebook-api-client.d.ts.map +1 -0
- package/dist/facebook-api-client.js +206 -0
- package/dist/facebook-api-client.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +132 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +81 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +170 -0
- package/dist/schemas.js.map +1 -0
- package/dist/tool-loader.d.ts +35 -0
- package/dist/tool-loader.d.ts.map +1 -0
- package/dist/tool-loader.js +125 -0
- package/dist/tool-loader.js.map +1 -0
- package/dist/tool-registry.d.ts +44 -0
- package/dist/tool-registry.d.ts.map +1 -0
- package/dist/tool-registry.js +54 -0
- package/dist/tool-registry.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/instagram.d.ts +9 -0
- package/dist/tools/instagram.d.ts.map +1 -0
- package/dist/tools/instagram.js +9 -0
- package/dist/tools/instagram.js.map +1 -0
- package/dist/tools/pages.d.ts +8 -0
- package/dist/tools/pages.d.ts.map +1 -0
- package/dist/tools/pages.js +8 -0
- package/dist/tools/pages.js.map +1 -0
- package/dist/tools/system.d.ts +7 -0
- package/dist/tools/system.d.ts.map +1 -0
- package/dist/tools/system.js +7 -0
- package/dist/tools/system.js.map +1 -0
- package/dist/tools/user.d.ts +105 -0
- package/dist/tools/user.d.ts.map +1 -0
- package/dist/tools/user.js +139 -0
- package/dist/tools/user.js.map +1 -0
- package/dist/types.d.ts +111 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +46 -0
- package/tools.json +108 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { wrapWithDebug } from "./debug-middleware.js";
|
|
2
|
+
/**
|
|
3
|
+
* Registry for managing and executing MCP tools with automatic debug wrapping
|
|
4
|
+
*/
|
|
5
|
+
export class ToolRegistry {
|
|
6
|
+
tools = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* Register a new tool in the registry
|
|
9
|
+
*
|
|
10
|
+
* @param name - Unique name of the tool
|
|
11
|
+
* @param schema - Zod schema for validating tool input
|
|
12
|
+
* @param handler - Async function that executes the tool logic
|
|
13
|
+
*/
|
|
14
|
+
register(name, schema, handler) {
|
|
15
|
+
this.tools.set(name, { name, schema, handler });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Execute a tool by name with automatic validation and debug wrapping
|
|
19
|
+
*
|
|
20
|
+
* @param toolName - Name of the tool to execute
|
|
21
|
+
* @param rawInput - Raw input arguments (will be validated against schema)
|
|
22
|
+
* @param req - Express request object for accessing headers/context
|
|
23
|
+
* @returns ToolResponse with data and optional debug metadata
|
|
24
|
+
* @throws Error if tool is not found or validation fails
|
|
25
|
+
*/
|
|
26
|
+
async execute(toolName, rawInput, req) {
|
|
27
|
+
const tool = this.tools.get(toolName);
|
|
28
|
+
if (!tool) {
|
|
29
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
30
|
+
}
|
|
31
|
+
// Validate input against schema
|
|
32
|
+
const args = tool.schema.parse(rawInput);
|
|
33
|
+
// Execute with debug wrapping
|
|
34
|
+
return wrapWithDebug(toolName, args, () => tool.handler(req, args));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if a tool exists in the registry
|
|
38
|
+
*
|
|
39
|
+
* @param toolName - Name of the tool to check
|
|
40
|
+
* @returns True if the tool is registered
|
|
41
|
+
*/
|
|
42
|
+
has(toolName) {
|
|
43
|
+
return this.tools.has(toolName);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get all registered tool names
|
|
47
|
+
*
|
|
48
|
+
* @returns Array of registered tool names
|
|
49
|
+
*/
|
|
50
|
+
getToolNames() {
|
|
51
|
+
return Array.from(this.tools.keys());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=tool-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["../src/tool-registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAerD;;GAEG;AACH,MAAM,OAAO,YAAY;IACf,KAAK,GAAG,IAAI,GAAG,EAA0B,CAAA;IAEjD;;;;;;OAMG;IACH,QAAQ,CAAC,IAAY,EAAE,MAAkB,EAAE,OAAoB;QAC7D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACjD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CACX,QAAgB,EAChB,QAAiB,EACjB,GAAY;QAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAErC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAA;QAC9C,CAAC;QAED,gCAAgC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAExC,8BAA8B;QAC9B,OAAO,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;IACrE,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,QAAgB;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,KAAK,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,cAAc,GACf,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,aAAa;AACb,OAAO,EACL,KAAK,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,cAAc,GACf,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instagram tool handlers - REMOVED
|
|
3
|
+
*
|
|
4
|
+
* These tools were removed because the required Facebook OAuth scopes
|
|
5
|
+
* (instagram_basic, instagram_manage_insights, instagram_content_publish)
|
|
6
|
+
* are not available.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=instagram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/tools/instagram.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instagram tool handlers - REMOVED
|
|
3
|
+
*
|
|
4
|
+
* These tools were removed because the required Facebook OAuth scopes
|
|
5
|
+
* (instagram_basic, instagram_manage_insights, instagram_content_publish)
|
|
6
|
+
* are not available.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=instagram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instagram.js","sourceRoot":"","sources":["../../src/tools/instagram.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/tools/pages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/tools/pages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User tool handlers for Facebook MCP Server
|
|
3
|
+
*/
|
|
4
|
+
import type { Request } from "express";
|
|
5
|
+
/**
|
|
6
|
+
* Get current user profile
|
|
7
|
+
*/
|
|
8
|
+
export declare function getMe(req: Request, args: unknown): Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
user: import("../types.js").FacebookUser;
|
|
11
|
+
note: string;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Get user's friends (requires user_friends permission)
|
|
15
|
+
*/
|
|
16
|
+
export declare function getFriends(req: Request, args: unknown): Promise<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
friends: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
picture?: unknown;
|
|
22
|
+
}[];
|
|
23
|
+
pagination: import("../types.js").PaginationInfo;
|
|
24
|
+
summary: {
|
|
25
|
+
current_page_count: number;
|
|
26
|
+
total_count: number;
|
|
27
|
+
has_more: boolean;
|
|
28
|
+
};
|
|
29
|
+
note: string;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Get user's photos (requires user_photos permission)
|
|
33
|
+
*/
|
|
34
|
+
export declare function getPhotos(req: Request, args: unknown): Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
photos: unknown[];
|
|
37
|
+
pagination: import("../types.js").PaginationInfo;
|
|
38
|
+
summary: {
|
|
39
|
+
current_page_count: number;
|
|
40
|
+
total_count: number;
|
|
41
|
+
has_more: boolean;
|
|
42
|
+
};
|
|
43
|
+
note: string;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Get user's posts (requires user_posts permission)
|
|
47
|
+
*/
|
|
48
|
+
export declare function getUserPosts(req: Request, args: unknown): Promise<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
posts: import("../types.js").FacebookPost[];
|
|
51
|
+
pagination: import("../types.js").PaginationInfo;
|
|
52
|
+
summary: {
|
|
53
|
+
current_page_count: number;
|
|
54
|
+
total_count: number;
|
|
55
|
+
has_more: boolean;
|
|
56
|
+
};
|
|
57
|
+
note: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Get user's videos (requires user_videos permission)
|
|
61
|
+
*/
|
|
62
|
+
export declare function getVideos(req: Request, args: unknown): Promise<{
|
|
63
|
+
success: boolean;
|
|
64
|
+
videos: unknown[];
|
|
65
|
+
pagination: import("../types.js").PaginationInfo;
|
|
66
|
+
summary: {
|
|
67
|
+
current_page_count: number;
|
|
68
|
+
total_count: number;
|
|
69
|
+
has_more: boolean;
|
|
70
|
+
};
|
|
71
|
+
note: string;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Get user's likes (requires user_likes permission)
|
|
75
|
+
*/
|
|
76
|
+
export declare function getLikes(req: Request, args: unknown): Promise<{
|
|
77
|
+
success: boolean;
|
|
78
|
+
likes: unknown[];
|
|
79
|
+
pagination: import("../types.js").PaginationInfo;
|
|
80
|
+
summary: {
|
|
81
|
+
current_page_count: number;
|
|
82
|
+
total_count: number;
|
|
83
|
+
has_more: boolean;
|
|
84
|
+
};
|
|
85
|
+
note: string;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Get user permissions for the current access token
|
|
89
|
+
*/
|
|
90
|
+
export declare function getPermissions(req: Request, _args: unknown): Promise<{
|
|
91
|
+
success: boolean;
|
|
92
|
+
permissions: {
|
|
93
|
+
permission: string;
|
|
94
|
+
status: string;
|
|
95
|
+
}[];
|
|
96
|
+
summary: {
|
|
97
|
+
total: number;
|
|
98
|
+
granted: number;
|
|
99
|
+
declined: number;
|
|
100
|
+
granted_permissions: string[];
|
|
101
|
+
declined_permissions: string[];
|
|
102
|
+
};
|
|
103
|
+
note: string;
|
|
104
|
+
}>;
|
|
105
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/tools/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC;;GAEG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;;;;GAWtD;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;;;;;;;;;;;;;;GAqB3D;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;;;;;;;;;;GAqB1D;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;;;;;;;;;;GAqB7D;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;;;;;;;;;;GAqB1D;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;;;;;;;;;;GAqBzD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;;;;;;;;;;;;;;GAyBhE"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User tool handlers for Facebook MCP Server
|
|
3
|
+
*/
|
|
4
|
+
import { getFacebookClient } from "../facebook-api-client.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get current user profile
|
|
7
|
+
*/
|
|
8
|
+
export async function getMe(req, args) {
|
|
9
|
+
const client = getFacebookClient(req);
|
|
10
|
+
const { fields } = args;
|
|
11
|
+
const user = await client.getMe(fields);
|
|
12
|
+
return {
|
|
13
|
+
success: true,
|
|
14
|
+
user,
|
|
15
|
+
note: "User profile retrieved successfully",
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get user's friends (requires user_friends permission)
|
|
20
|
+
*/
|
|
21
|
+
export async function getFriends(req, args) {
|
|
22
|
+
const client = getFacebookClient(req);
|
|
23
|
+
const { page, limit, fields } = args;
|
|
24
|
+
const result = await client.getFriends(page, limit, fields);
|
|
25
|
+
return {
|
|
26
|
+
success: true,
|
|
27
|
+
friends: result.data,
|
|
28
|
+
pagination: result.pagination,
|
|
29
|
+
summary: {
|
|
30
|
+
current_page_count: result.data.length,
|
|
31
|
+
total_count: result.pagination.total,
|
|
32
|
+
has_more: result.pagination.hasNext,
|
|
33
|
+
},
|
|
34
|
+
note: "Only returns friends who also use the app. Use page parameter to navigate pages.",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get user's photos (requires user_photos permission)
|
|
39
|
+
*/
|
|
40
|
+
export async function getPhotos(req, args) {
|
|
41
|
+
const client = getFacebookClient(req);
|
|
42
|
+
const { page, limit, fields } = args;
|
|
43
|
+
const result = await client.getPhotos(page, limit, fields);
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
photos: result.data,
|
|
47
|
+
pagination: result.pagination,
|
|
48
|
+
summary: {
|
|
49
|
+
current_page_count: result.data.length,
|
|
50
|
+
total_count: result.pagination.total,
|
|
51
|
+
has_more: result.pagination.hasNext,
|
|
52
|
+
},
|
|
53
|
+
note: "Photos retrieved successfully. Use page parameter to navigate pages.",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get user's posts (requires user_posts permission)
|
|
58
|
+
*/
|
|
59
|
+
export async function getUserPosts(req, args) {
|
|
60
|
+
const client = getFacebookClient(req);
|
|
61
|
+
const { page, limit, fields } = args;
|
|
62
|
+
const result = await client.getPosts(page, limit, fields);
|
|
63
|
+
return {
|
|
64
|
+
success: true,
|
|
65
|
+
posts: result.data,
|
|
66
|
+
pagination: result.pagination,
|
|
67
|
+
summary: {
|
|
68
|
+
current_page_count: result.data.length,
|
|
69
|
+
total_count: result.pagination.total,
|
|
70
|
+
has_more: result.pagination.hasNext,
|
|
71
|
+
},
|
|
72
|
+
note: "User posts retrieved successfully. Use page parameter to navigate pages.",
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get user's videos (requires user_videos permission)
|
|
77
|
+
*/
|
|
78
|
+
export async function getVideos(req, args) {
|
|
79
|
+
const client = getFacebookClient(req);
|
|
80
|
+
const { page, limit, fields } = args;
|
|
81
|
+
const result = await client.getVideos(page, limit, fields);
|
|
82
|
+
return {
|
|
83
|
+
success: true,
|
|
84
|
+
videos: result.data,
|
|
85
|
+
pagination: result.pagination,
|
|
86
|
+
summary: {
|
|
87
|
+
current_page_count: result.data.length,
|
|
88
|
+
total_count: result.pagination.total,
|
|
89
|
+
has_more: result.pagination.hasNext,
|
|
90
|
+
},
|
|
91
|
+
note: "Videos retrieved successfully. Use page parameter to navigate pages.",
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get user's likes (requires user_likes permission)
|
|
96
|
+
*/
|
|
97
|
+
export async function getLikes(req, args) {
|
|
98
|
+
const client = getFacebookClient(req);
|
|
99
|
+
const { page, limit, fields } = args;
|
|
100
|
+
const result = await client.getLikes(page, limit, fields);
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
likes: result.data,
|
|
104
|
+
pagination: result.pagination,
|
|
105
|
+
summary: {
|
|
106
|
+
current_page_count: result.data.length,
|
|
107
|
+
total_count: result.pagination.total,
|
|
108
|
+
has_more: result.pagination.hasNext,
|
|
109
|
+
},
|
|
110
|
+
note: "Liked pages retrieved successfully. Use page parameter to navigate pages.",
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get user permissions for the current access token
|
|
115
|
+
*/
|
|
116
|
+
export async function getPermissions(req, _args) {
|
|
117
|
+
const client = getFacebookClient(req);
|
|
118
|
+
const permissions = await client.getPermissions();
|
|
119
|
+
// Organize permissions by status
|
|
120
|
+
const granted = permissions
|
|
121
|
+
.filter((p) => p.status === "granted")
|
|
122
|
+
.map((p) => p.permission);
|
|
123
|
+
const declined = permissions
|
|
124
|
+
.filter((p) => p.status === "declined")
|
|
125
|
+
.map((p) => p.permission);
|
|
126
|
+
return {
|
|
127
|
+
success: true,
|
|
128
|
+
permissions,
|
|
129
|
+
summary: {
|
|
130
|
+
total: permissions.length,
|
|
131
|
+
granted: granted.length,
|
|
132
|
+
declined: declined.length,
|
|
133
|
+
granted_permissions: granted,
|
|
134
|
+
declined_permissions: declined,
|
|
135
|
+
},
|
|
136
|
+
note: "Permission list retrieved successfully",
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+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AAU,cAAc,CAAC,GAAY,EAAE,KAAc;IAC/D,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAA;IAErC,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAA;IAEjD,iCAAiC;IACjC,MAAM,OAAO,GAAG,WAAW;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC;SACrC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAC3B,MAAM,QAAQ,GAAG,WAAW;SACzB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,UAAU,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAE3B,OAAO;QACL,OAAO,EAAE,IAAI;QACb,WAAW;QACX,OAAO,EAAE;YACP,KAAK,EAAE,WAAW,CAAC,MAAM;YACzB,OAAO,EAAE,OAAO,CAAC,MAAM;YACvB,QAAQ,EAAE,QAAQ,CAAC,MAAM;YACzB,mBAAmB,EAAE,OAAO;YAC5B,oBAAoB,EAAE,QAAQ;SAC/B;QACD,IAAI,EAAE,wCAAwC;KAC/C,CAAA;AACH,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Facebook/Instagram MCP Server
|
|
3
|
+
*/
|
|
4
|
+
export interface GraphApiResponse<T = unknown> {
|
|
5
|
+
data?: T;
|
|
6
|
+
error?: GraphApiError;
|
|
7
|
+
paging?: Paging;
|
|
8
|
+
}
|
|
9
|
+
export interface GraphApiError {
|
|
10
|
+
message: string;
|
|
11
|
+
type: string;
|
|
12
|
+
code: number;
|
|
13
|
+
error_subcode?: number;
|
|
14
|
+
fbtrace_id?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface Paging {
|
|
17
|
+
cursors?: {
|
|
18
|
+
before?: string;
|
|
19
|
+
after?: string;
|
|
20
|
+
};
|
|
21
|
+
next?: string;
|
|
22
|
+
previous?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FacebookUser {
|
|
25
|
+
id: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
first_name?: string;
|
|
29
|
+
last_name?: string;
|
|
30
|
+
picture?: {
|
|
31
|
+
data: {
|
|
32
|
+
url: string;
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
is_silhouette?: boolean;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
link?: string;
|
|
39
|
+
birthday?: string;
|
|
40
|
+
gender?: string;
|
|
41
|
+
hometown?: {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
};
|
|
45
|
+
location?: {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface FacebookPost {
|
|
51
|
+
id: string;
|
|
52
|
+
message?: string;
|
|
53
|
+
story?: string;
|
|
54
|
+
created_time?: string;
|
|
55
|
+
updated_time?: string;
|
|
56
|
+
full_picture?: string;
|
|
57
|
+
picture?: string;
|
|
58
|
+
link?: string;
|
|
59
|
+
permalink_url?: string;
|
|
60
|
+
shares?: {
|
|
61
|
+
count: number;
|
|
62
|
+
};
|
|
63
|
+
likes?: {
|
|
64
|
+
summary: {
|
|
65
|
+
total_count: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
comments?: {
|
|
69
|
+
summary: {
|
|
70
|
+
total_count: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
from?: {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
};
|
|
77
|
+
type?: string;
|
|
78
|
+
status_type?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface PaginationInfo {
|
|
81
|
+
page: number;
|
|
82
|
+
limit: number;
|
|
83
|
+
total: number;
|
|
84
|
+
pages: number;
|
|
85
|
+
hasNext: boolean;
|
|
86
|
+
hasPrev: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface PaginatedResponse<T> {
|
|
89
|
+
data: T[];
|
|
90
|
+
pagination: PaginationInfo;
|
|
91
|
+
}
|
|
92
|
+
export interface ToolResult {
|
|
93
|
+
success: boolean;
|
|
94
|
+
data?: unknown;
|
|
95
|
+
error?: string;
|
|
96
|
+
summary?: Record<string, unknown>;
|
|
97
|
+
source?: string;
|
|
98
|
+
note?: string;
|
|
99
|
+
pagination?: PaginationInfo;
|
|
100
|
+
}
|
|
101
|
+
export interface DebugMetadata {
|
|
102
|
+
toolName: string;
|
|
103
|
+
toolInput: unknown;
|
|
104
|
+
toolCallTime: number;
|
|
105
|
+
timestamp: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ToolResponse<T = unknown> {
|
|
108
|
+
data: T;
|
|
109
|
+
debug?: DebugMetadata;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IAC3C,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,MAAM;IACrB,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,KAAK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/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bn-facebook-mcp-server",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Stateless MCP Server for Facebook Graph API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"bn-facebook-mcp-server": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "node --watch dist/index.js",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"package": "docker build -t bn-facebook-mcp-server .",
|
|
17
|
+
"clean": "rm -rf dist"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"mcp",
|
|
21
|
+
"facebook",
|
|
22
|
+
"graph-api",
|
|
23
|
+
"user-data",
|
|
24
|
+
"stateless"
|
|
25
|
+
],
|
|
26
|
+
"author": "BlueNexus AI",
|
|
27
|
+
"license": "PROPRIETARY",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
30
|
+
"express": "^4.21.2",
|
|
31
|
+
"zod": "^3.24.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/express": "^5.0.0",
|
|
35
|
+
"@types/node": "^22.10.2",
|
|
36
|
+
"typescript": "^5.8.3",
|
|
37
|
+
"vitest": "^3.0.0"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/**/*",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"tools.json"
|
|
44
|
+
],
|
|
45
|
+
"packageManager": "pnpm@10.22.0"
|
|
46
|
+
}
|