@hsayed21/wikijs-mcp 2.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/LICENSE +21 -0
- package/README.md +87 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +22 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/index.d.ts +72 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +98 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/services/client.d.ts +39 -0
- package/dist/services/client.d.ts.map +1 -0
- package/dist/services/client.js +235 -0
- package/dist/services/client.js.map +1 -0
- package/dist/services/error-handler.d.ts +34 -0
- package/dist/services/error-handler.d.ts.map +1 -0
- package/dist/services/error-handler.js +72 -0
- package/dist/services/error-handler.js.map +1 -0
- package/dist/tools/get-page.d.ts +39 -0
- package/dist/tools/get-page.d.ts.map +1 -0
- package/dist/tools/get-page.js +75 -0
- package/dist/tools/get-page.js.map +1 -0
- package/dist/tools/get-tree.d.ts +45 -0
- package/dist/tools/get-tree.d.ts.map +1 -0
- package/dist/tools/get-tree.js +77 -0
- package/dist/tools/get-tree.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-pages.d.ts +42 -0
- package/dist/tools/list-pages.d.ts.map +1 -0
- package/dist/tools/list-pages.js +82 -0
- package/dist/tools/list-pages.js.map +1 -0
- package/dist/tools/search-pages.d.ts +39 -0
- package/dist/tools/search-pages.d.ts.map +1 -0
- package/dist/tools/search-pages.js +65 -0
- package/dist/tools/search-pages.js.map +1 -0
- package/dist/types.d.ts +60 -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 +50 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wikijs_list_pages Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all pages in Wiki.js with optional filtering and pagination
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import type { WikiJsClient } from '../services/client.js';
|
|
8
|
+
import { listPagesSchema } from '../schemas/index.js';
|
|
9
|
+
export declare const listPagesToolDefinition: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: z.ZodObject<{
|
|
13
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
14
|
+
path: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
15
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
limit: number;
|
|
19
|
+
offset: number;
|
|
20
|
+
path?: string | undefined;
|
|
21
|
+
locale?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
path?: string | undefined;
|
|
24
|
+
locale?: string | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
offset?: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
annotations: {
|
|
29
|
+
readOnlyHint: boolean;
|
|
30
|
+
destructiveHint: boolean;
|
|
31
|
+
idempotentHint: boolean;
|
|
32
|
+
openWorldHint: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare function handleListPages(client: WikiJsClient, args: z.infer<typeof listPagesSchema>): Promise<{
|
|
36
|
+
content: Array<{
|
|
37
|
+
type: 'text';
|
|
38
|
+
text: string;
|
|
39
|
+
}>;
|
|
40
|
+
isError?: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
//# sourceMappingURL=list-pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pages.d.ts","sourceRoot":"","sources":["../../src/tools/list-pages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAuB,MAAM,qBAAqB,CAAC;AAI3E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;CA+BnC,CAAC;AAEF,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACpC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAqDhF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wikijs_list_pages Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all pages in Wiki.js with optional filtering and pagination
|
|
5
|
+
*/
|
|
6
|
+
import { listPagesSchema } from '../schemas/index.js';
|
|
7
|
+
import { handleToolError } from '../services/error-handler.js';
|
|
8
|
+
import { DEFAULT_PAGE_LIMIT } from '../constants.js';
|
|
9
|
+
export const listPagesToolDefinition = {
|
|
10
|
+
name: 'wikijs_list_pages',
|
|
11
|
+
description: `List all pages in Wiki.js with optional filtering and pagination.
|
|
12
|
+
|
|
13
|
+
This tool returns a paginated list of published pages. Use the offset parameter to navigate through large result sets.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
- locale (string, optional): Filter by locale (e.g., "en", "de")
|
|
17
|
+
- path (string, optional): Only include pages under this path
|
|
18
|
+
- limit (number): Max pages to return, default 50, max 200. Use -1 to return all matching pages.
|
|
19
|
+
- offset (number): Skip N pages for pagination, default 0
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
- pages: Array of published page summaries (id, path, title, description, locale, tags, updatedAt)
|
|
23
|
+
- pagination: { limit, offset, total_count, has_more, next_offset }
|
|
24
|
+
|
|
25
|
+
Use pagination.has_more and pagination.next_offset to fetch more results.
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
- List all: (no params, returns first 50)
|
|
29
|
+
- List all matching pages: limit=-1
|
|
30
|
+
- Filter by locale: locale="de"
|
|
31
|
+
- Filter by path: path="osticket/"
|
|
32
|
+
- Paginate: offset=50, limit=50 (get pages 51-100)`,
|
|
33
|
+
inputSchema: listPagesSchema,
|
|
34
|
+
annotations: {
|
|
35
|
+
readOnlyHint: true,
|
|
36
|
+
destructiveHint: false,
|
|
37
|
+
idempotentHint: true,
|
|
38
|
+
openWorldHint: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export async function handleListPages(client, args) {
|
|
42
|
+
try {
|
|
43
|
+
// Validate input with Zod
|
|
44
|
+
const validated = listPagesSchema.parse(args);
|
|
45
|
+
const limit = validated.limit ?? DEFAULT_PAGE_LIMIT;
|
|
46
|
+
const offset = limit < 0 ? 0 : validated.offset ?? 0;
|
|
47
|
+
const { pages, total } = await client.listPages(validated.locale ?? null, limit, offset, validated.path ?? null);
|
|
48
|
+
const pageList = pages.map((p) => ({
|
|
49
|
+
id: p.id,
|
|
50
|
+
path: p.path,
|
|
51
|
+
title: p.title,
|
|
52
|
+
description: p.description,
|
|
53
|
+
locale: p.locale,
|
|
54
|
+
isPublished: p.isPublished,
|
|
55
|
+
tags: p.tags || [],
|
|
56
|
+
updatedAt: p.updatedAt,
|
|
57
|
+
}));
|
|
58
|
+
const hasMore = offset + pageList.length < total;
|
|
59
|
+
return {
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: JSON.stringify({
|
|
64
|
+
success: true,
|
|
65
|
+
pages: pageList,
|
|
66
|
+
pagination: {
|
|
67
|
+
limit,
|
|
68
|
+
offset,
|
|
69
|
+
total_count: total,
|
|
70
|
+
has_more: hasMore,
|
|
71
|
+
...(hasMore ? { next_offset: offset + pageList.length } : {}),
|
|
72
|
+
},
|
|
73
|
+
}, null, 2),
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return handleToolError(error, 'wikijs_list_pages');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=list-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pages.js","sourceRoot":"","sources":["../../src/tools/list-pages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,eAAe,EAAuB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;qDAqBsC;IACnD,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAoB,EACpB,IAAqC;IAErC,IAAI,CAAC;QACH,0BAA0B;QAC1B,MAAM,SAAS,GAAmB,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE9D,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,kBAAkB,CAAC;QACpD,MAAM,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;QAErD,MA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1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wikijs_search_pages Tool
|
|
3
|
+
*
|
|
4
|
+
* Searches pages in Wiki.js
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import type { WikiJsClient } from '../services/client.js';
|
|
8
|
+
import { searchPagesSchema } from '../schemas/index.js';
|
|
9
|
+
export declare const searchPagesToolDefinition: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: z.ZodObject<{
|
|
13
|
+
query: z.ZodString;
|
|
14
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
15
|
+
path: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
query: string;
|
|
18
|
+
path?: string | undefined;
|
|
19
|
+
locale?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
query: string;
|
|
22
|
+
path?: string | undefined;
|
|
23
|
+
locale?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
annotations: {
|
|
26
|
+
readOnlyHint: boolean;
|
|
27
|
+
destructiveHint: boolean;
|
|
28
|
+
idempotentHint: boolean;
|
|
29
|
+
openWorldHint: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare function handleSearchPages(client: WikiJsClient, args: z.infer<typeof searchPagesSchema>): Promise<{
|
|
33
|
+
content: Array<{
|
|
34
|
+
type: 'text';
|
|
35
|
+
text: string;
|
|
36
|
+
}>;
|
|
37
|
+
isError?: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
//# sourceMappingURL=search-pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-pages.d.ts","sourceRoot":"","sources":["../../src/tools/search-pages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAyB,MAAM,qBAAqB,CAAC;AAG/E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;CA2BrC,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,GACtC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAqChF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wikijs_search_pages Tool
|
|
3
|
+
*
|
|
4
|
+
* Searches pages in Wiki.js
|
|
5
|
+
*/
|
|
6
|
+
import { searchPagesSchema } from '../schemas/index.js';
|
|
7
|
+
import { handleToolError } from '../services/error-handler.js';
|
|
8
|
+
export const searchPagesToolDefinition = {
|
|
9
|
+
name: 'wikijs_search_pages',
|
|
10
|
+
description: `Search for pages in Wiki.js by query string.
|
|
11
|
+
|
|
12
|
+
This tool performs a full-text search across published page content and metadata. Results are ranked by relevance.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
- query (string, required): Search query (min 2 chars, max 200 chars)
|
|
16
|
+
- locale (string, optional): Filter results by locale
|
|
17
|
+
- path (string, optional): Only include pages under this path
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
- totalHits: Total number of matching published pages
|
|
21
|
+
- suggestions: Search suggestions for refinement
|
|
22
|
+
- results: Array of matching pages (id, title, path, description, locale)
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
- Search for topic: query="osTicket API"
|
|
26
|
+
- Search in German pages: query="Plugin", locale="de"
|
|
27
|
+
- Search inside a section: query="API", path="osticket/"`,
|
|
28
|
+
inputSchema: searchPagesSchema,
|
|
29
|
+
annotations: {
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
idempotentHint: true,
|
|
33
|
+
openWorldHint: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export async function handleSearchPages(client, args) {
|
|
37
|
+
try {
|
|
38
|
+
// Validate input with Zod
|
|
39
|
+
const validated = searchPagesSchema.parse(args);
|
|
40
|
+
const results = await client.searchPages(validated.query, validated.locale ?? null, validated.path ?? null);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: JSON.stringify({
|
|
46
|
+
success: true,
|
|
47
|
+
totalHits: results.totalHits,
|
|
48
|
+
suggestions: results.suggestions,
|
|
49
|
+
results: results.results.map((r) => ({
|
|
50
|
+
id: r.id,
|
|
51
|
+
title: r.title,
|
|
52
|
+
path: r.path,
|
|
53
|
+
description: r.description,
|
|
54
|
+
locale: r.locale,
|
|
55
|
+
})),
|
|
56
|
+
}, null, 2),
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return handleToolError(error, 'wikijs_search_pages');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=search-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-pages.js","sourceRoot":"","sources":["../../src/tools/search-pages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,iBAAiB,EAAyB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;;;;;;;;;;;;;;;;2DAiB4C;IACzD,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE;QACX,YAAY,EAAE,I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
|
5
|
+
id: number;
|
|
6
|
+
path: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
content?: string;
|
|
10
|
+
contentType?: string;
|
|
11
|
+
isPublished: boolean;
|
|
12
|
+
locale: string;
|
|
13
|
+
createdAt?: string;
|
|
14
|
+
updatedAt?: string;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface WikiPageListItem {
|
|
18
|
+
id: number;
|
|
19
|
+
path: string;
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
isPublished: boolean;
|
|
23
|
+
locale: string;
|
|
24
|
+
contentType: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
tags: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface SearchResult {
|
|
30
|
+
id: number;
|
|
31
|
+
title: string;
|
|
32
|
+
path: string;
|
|
33
|
+
description: string;
|
|
34
|
+
locale: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SearchResponse {
|
|
37
|
+
results: SearchResult[];
|
|
38
|
+
suggestions: string[];
|
|
39
|
+
totalHits: number;
|
|
40
|
+
}
|
|
41
|
+
export interface WikiPageTreeNode {
|
|
42
|
+
id: number;
|
|
43
|
+
path: string;
|
|
44
|
+
depth: number;
|
|
45
|
+
title: string;
|
|
46
|
+
isPrivate: boolean;
|
|
47
|
+
isFolder: boolean;
|
|
48
|
+
privateNS?: string;
|
|
49
|
+
parent?: number;
|
|
50
|
+
pageId?: number;
|
|
51
|
+
locale: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PaginationMeta {
|
|
54
|
+
limit: number;
|
|
55
|
+
offset: number;
|
|
56
|
+
total_count: number;
|
|
57
|
+
has_more: boolean;
|
|
58
|
+
next_offset?: number;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.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,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/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,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hsayed21/wikijs-mcp",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Read-only MCP server for searching and retrieving published Wiki.js knowledge base pages",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"wikijs-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"dev": "tsx watch src/index.ts",
|
|
14
|
+
"clean": "rm -rf dist",
|
|
15
|
+
"typecheck": "tsc --noEmit",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"mcp-server",
|
|
23
|
+
"wikijs",
|
|
24
|
+
"graphql",
|
|
25
|
+
"documentation",
|
|
26
|
+
"wiki",
|
|
27
|
+
"model-context-protocol"
|
|
28
|
+
],
|
|
29
|
+
"author": "hsayed21",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
33
|
+
"dotenv": "^16.4.5",
|
|
34
|
+
"zod": "^3.23.8"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.19.3",
|
|
38
|
+
"tsx": "^4.19.2",
|
|
39
|
+
"typescript": "^5.7.2",
|
|
40
|
+
"vitest": "^4.0.16"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
]
|
|
50
|
+
}
|