@knowledgine/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/LICENSE +21 -0
- package/dist/helpers.d.ts +18 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +26 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +91 -0
- package/dist/server.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 R.M
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KnowledgeRepository } from "@knowledgine/core";
|
|
2
|
+
import type { KnowledgineConfig } from "@knowledgine/core";
|
|
3
|
+
export declare function resolveConfig(): KnowledgineConfig;
|
|
4
|
+
export declare function initializeDependencies(config: KnowledgineConfig): KnowledgeRepository;
|
|
5
|
+
export declare function formatToolResult(data: unknown): {
|
|
6
|
+
content: Array<{
|
|
7
|
+
type: "text";
|
|
8
|
+
text: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
export declare function formatToolError(message: string): {
|
|
12
|
+
content: Array<{
|
|
13
|
+
type: "text";
|
|
14
|
+
text: string;
|
|
15
|
+
}>;
|
|
16
|
+
isError: true;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,wBAAgB,aAAa,IAAI,iBAAiB,CAOjD;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,CAIrF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG;IAC/C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD,CAIA;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG;IAChD,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,EAAE,IAAI,CAAC;CACf,CAKA"}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig, createDatabase, Migrator, KnowledgeRepository, ALL_MIGRATIONS, } from "@knowledgine/core";
|
|
2
|
+
export function resolveConfig() {
|
|
3
|
+
const dbPath = process.env["KNOWLEDGINE_DB_PATH"];
|
|
4
|
+
const rootPath = process.env["KNOWLEDGINE_ROOT_PATH"] ?? process.cwd();
|
|
5
|
+
return defineConfig({
|
|
6
|
+
rootPath,
|
|
7
|
+
...(dbPath ? { dbPath } : {}),
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export function initializeDependencies(config) {
|
|
11
|
+
const db = createDatabase(config.dbPath);
|
|
12
|
+
new Migrator(db, ALL_MIGRATIONS).migrate();
|
|
13
|
+
return new KnowledgeRepository(db);
|
|
14
|
+
}
|
|
15
|
+
export function formatToolResult(data) {
|
|
16
|
+
return {
|
|
17
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function formatToolError(message) {
|
|
21
|
+
return {
|
|
22
|
+
content: [{ type: "text", text: message }],
|
|
23
|
+
isError: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,mBAAmB,EACnB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,MAAM,UAAU,aAAa;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvE,OAAO,YAAY,CAAC;QAClB,QAAQ;QACR,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAAyB;IAC9D,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3C,OAAO,IAAI,mBAAmB,CAAC,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAG5C,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe;IAI7C,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export { createKnowledgineMcpServer } from "./server.js";
|
|
3
|
+
export { resolveConfig, initializeDependencies, formatToolResult, formatToolError, } from "./helpers.js";
|
|
4
|
+
export { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { resolveConfig, initializeDependencies } from "./helpers.js";
|
|
4
|
+
import { createKnowledgineMcpServer } from "./server.js";
|
|
5
|
+
export { createKnowledgineMcpServer } from "./server.js";
|
|
6
|
+
export { resolveConfig, initializeDependencies, formatToolResult, formatToolError, } from "./helpers.js";
|
|
7
|
+
export { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
|
+
async function main() {
|
|
9
|
+
const config = resolveConfig();
|
|
10
|
+
const repository = initializeDependencies(config);
|
|
11
|
+
const server = createKnowledgineMcpServer(repository, config.rootPath);
|
|
12
|
+
const transport = new StdioServerTransport();
|
|
13
|
+
await server.connect(transport);
|
|
14
|
+
}
|
|
15
|
+
// Only run main if this is the entry point (not imported)
|
|
16
|
+
const isEntryPoint = process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/"));
|
|
17
|
+
if (isEntryPoint) {
|
|
18
|
+
main().catch((error) => {
|
|
19
|
+
console.error("Failed to start MCP server:", error);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,0BAA0B,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,0DAA0D;AAC1D,MAAM,YAAY,GAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AACnF,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { KnowledgeRepository } from "@knowledgine/core";
|
|
3
|
+
export declare function createKnowledgineMcpServer(repository: KnowledgeRepository, rootPath?: string): McpServer;
|
|
4
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,mBAAmB,EAC/B,QAAQ,CAAC,EAAE,MAAM,GAChB,SAAS,CAsGX"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { KnowledgeSearcher, LocalLinkGenerator } from "@knowledgine/core";
|
|
4
|
+
import { formatToolResult, formatToolError } from "./helpers.js";
|
|
5
|
+
export function createKnowledgineMcpServer(repository, rootPath) {
|
|
6
|
+
const server = new McpServer({ name: "knowledgine", version: "0.0.1" });
|
|
7
|
+
// Tool 1: search_knowledge
|
|
8
|
+
server.registerTool("search_knowledge", {
|
|
9
|
+
description: "ナレッジベース内のノートをキーワードで全文検索",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
query: z.string().describe("検索クエリ"),
|
|
12
|
+
limit: z.number().int().positive().optional().describe("最大結果数"),
|
|
13
|
+
},
|
|
14
|
+
}, async (input) => {
|
|
15
|
+
try {
|
|
16
|
+
const searcher = new KnowledgeSearcher(repository);
|
|
17
|
+
const results = searcher.search({ query: input.query, limit: input.limit ?? 20 });
|
|
18
|
+
return formatToolResult({
|
|
19
|
+
query: input.query,
|
|
20
|
+
totalResults: results.length,
|
|
21
|
+
results: results.map((r) => ({
|
|
22
|
+
noteId: r.note.id,
|
|
23
|
+
filePath: r.note.file_path,
|
|
24
|
+
title: r.note.title,
|
|
25
|
+
score: r.score,
|
|
26
|
+
matchReason: r.matchReason,
|
|
27
|
+
createdAt: r.note.created_at,
|
|
28
|
+
})),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return formatToolError(error instanceof Error ? error.message : String(error));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
// Tool 2: find_related
|
|
36
|
+
server.registerTool("find_related", {
|
|
37
|
+
description: "指定ノートの関連ノート + 問題-解決ペアを検索",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
noteId: z.number().int().positive().optional().describe("ノートID"),
|
|
40
|
+
filePath: z.string().optional().describe("ファイルパス"),
|
|
41
|
+
limit: z.number().int().positive().optional().describe("最大結果数"),
|
|
42
|
+
},
|
|
43
|
+
}, async (input) => {
|
|
44
|
+
try {
|
|
45
|
+
let resolvedNoteId = input.noteId;
|
|
46
|
+
if (!resolvedNoteId && input.filePath) {
|
|
47
|
+
// Normalize absolute paths to relative (H-5)
|
|
48
|
+
let normalizedPath = input.filePath;
|
|
49
|
+
if (rootPath && normalizedPath.startsWith("/")) {
|
|
50
|
+
const { relative, isAbsolute } = await import("path");
|
|
51
|
+
if (isAbsolute(normalizedPath)) {
|
|
52
|
+
normalizedPath = relative(rootPath, normalizedPath);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const note = repository.getNoteByPath(normalizedPath);
|
|
56
|
+
if (!note) {
|
|
57
|
+
return formatToolError(`Note not found for path: ${input.filePath}`);
|
|
58
|
+
}
|
|
59
|
+
resolvedNoteId = note.id;
|
|
60
|
+
}
|
|
61
|
+
if (!resolvedNoteId) {
|
|
62
|
+
return formatToolError("Either noteId or filePath is required");
|
|
63
|
+
}
|
|
64
|
+
const linkGenerator = new LocalLinkGenerator(repository);
|
|
65
|
+
const relatedNotes = linkGenerator.findRelatedNotes(resolvedNoteId, input.limit ?? 5);
|
|
66
|
+
const problemSolutionPairs = repository.getProblemSolutionPairsByNoteId(resolvedNoteId);
|
|
67
|
+
return formatToolResult({
|
|
68
|
+
noteId: resolvedNoteId,
|
|
69
|
+
relatedNotes,
|
|
70
|
+
problemSolutionPairs,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return formatToolError(error instanceof Error ? error.message : String(error));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
// Tool 3: get_stats
|
|
78
|
+
server.registerTool("get_stats", {
|
|
79
|
+
description: "ナレッジベースの統計情報",
|
|
80
|
+
inputSchema: {},
|
|
81
|
+
}, async () => {
|
|
82
|
+
try {
|
|
83
|
+
return formatToolResult(repository.getStats());
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return formatToolError(error instanceof Error ? error.message : String(error));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return server;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,UAAU,0BAA0B,CACxC,UAA+B,EAC/B,QAAiB;IAEjB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAExE,2BAA2B;IAC3B,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EAAE,yBAAyB;QACtC,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;YACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;SAChE;KACF,EACD,KAAK,EAAE,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GAAG,UAAU,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;YAExF,OAAO,gBAAgB,CAAC;gBACtB,MAAM,EAAE,cAAc;gBACtB,YAAY;gBACZ,oBAAoB;aACrB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,eAAe,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACjF,CAAC;IACH,CAAC,CACF,CAAC;IAEF,oBAAoB;IACpB,MAAM,CAAC,YAAY,CACjB,WAAW,EACX;QACE,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,EAAE;KAChB,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,OAAO,gBAAgB,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,eAAe,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACjF,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@knowledgine/mcp-server",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"knowledgine-mcp": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
18
|
+
"zod": "^4.3.6",
|
|
19
|
+
"@knowledgine/core": "0.0.1"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"description": "MCP server exposing knowledge search tools for AI coding assistants",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"mcp",
|
|
27
|
+
"model-context-protocol",
|
|
28
|
+
"knowledge",
|
|
29
|
+
"ai",
|
|
30
|
+
"search"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/3062-in-zamud/knowledgine.git",
|
|
36
|
+
"directory": "packages/mcp-server"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/3062-in-zamud/knowledgine#readme",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/3062-in-zamud/knowledgine/issues"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsc --build tsconfig.build.json",
|
|
50
|
+
"test": "vitest",
|
|
51
|
+
"test:run": "vitest run"
|
|
52
|
+
}
|
|
53
|
+
}
|