@iflow-mcp/lupuletic-onyx-mcp-server 1.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +21 -0
  3. package/README.md +314 -0
  4. package/build/__tests__/config/config.test.d.ts +1 -0
  5. package/build/__tests__/config/config.test.js +56 -0
  6. package/build/__tests__/config/config.test.js.map +1 -0
  7. package/build/__tests__/index.test.d.ts +1 -0
  8. package/build/__tests__/index.test.js +25 -0
  9. package/build/__tests__/index.test.js.map +1 -0
  10. package/build/__tests__/integration/server.test.d.ts +1 -0
  11. package/build/__tests__/integration/server.test.js +73 -0
  12. package/build/__tests__/integration/server.test.js.map +1 -0
  13. package/build/__tests__/services/onyxApi.test.d.ts +1 -0
  14. package/build/__tests__/services/onyxApi.test.js +317 -0
  15. package/build/__tests__/services/onyxApi.test.js.map +1 -0
  16. package/build/__tests__/tools/tools.test.d.ts +1 -0
  17. package/build/__tests__/tools/tools.test.js +177 -0
  18. package/build/__tests__/tools/tools.test.js.map +1 -0
  19. package/build/config/index.d.ts +20 -0
  20. package/build/config/index.js +26 -0
  21. package/build/config/index.js.map +1 -0
  22. package/build/index.d.ts +2 -0
  23. package/build/index.js +24 -0
  24. package/build/index.js.map +1 -0
  25. package/build/server.d.ts +21 -0
  26. package/build/server.js +82 -0
  27. package/build/server.js.map +1 -0
  28. package/build/services/onyxApi.d.ts +68 -0
  29. package/build/services/onyxApi.js +272 -0
  30. package/build/services/onyxApi.js.map +1 -0
  31. package/build/tools/chatTool.d.ts +23 -0
  32. package/build/tools/chatTool.js +60 -0
  33. package/build/tools/chatTool.js.map +1 -0
  34. package/build/tools/index.d.ts +6 -0
  35. package/build/tools/index.js +7 -0
  36. package/build/tools/index.js.map +1 -0
  37. package/build/tools/searchTool.d.ts +20 -0
  38. package/build/tools/searchTool.js +55 -0
  39. package/build/tools/searchTool.js.map +1 -0
  40. package/build/types/index.d.ts +157 -0
  41. package/build/types/index.js +86 -0
  42. package/build/types/index.js.map +1 -0
  43. package/package.json +1 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Type definitions for the Onyx MCP Server
3
+ */
4
+ /**
5
+ * Onyx search result interface
6
+ */
7
+ export interface OnyxSearchResult {
8
+ document_id: string;
9
+ chunk_ind: number;
10
+ semantic_identifier: string;
11
+ link?: string;
12
+ blurb: string;
13
+ source_type: string;
14
+ score: number;
15
+ match_highlights?: string[];
16
+ }
17
+ /**
18
+ * Onyx document interface
19
+ */
20
+ export interface OnyxDocument {
21
+ document_id: string;
22
+ semantic_identifier: string;
23
+ }
24
+ /**
25
+ * Document information interface
26
+ */
27
+ export interface DocumentInfo {
28
+ num_chunks: number;
29
+ num_tokens: number;
30
+ }
31
+ /**
32
+ * Chunk information interface
33
+ */
34
+ export interface ChunkInfo {
35
+ content: string;
36
+ num_tokens: number;
37
+ }
38
+ /**
39
+ * Configuration for the Onyx server
40
+ */
41
+ export interface OnyxConfig {
42
+ apiUrl: string;
43
+ apiToken: string;
44
+ }
45
+ /**
46
+ * Search parameters interface
47
+ */
48
+ export interface SearchParams {
49
+ query: string;
50
+ documentSets?: string[];
51
+ maxResults?: number;
52
+ chunksAbove?: number;
53
+ chunksBelow?: number;
54
+ retrieveFullDocuments?: boolean;
55
+ }
56
+ /**
57
+ * Chat parameters interface
58
+ */
59
+ export interface ChatParams {
60
+ query: string;
61
+ personaId?: number;
62
+ documentSets?: string[];
63
+ enableAutoDetectFilters?: boolean;
64
+ chatSessionId?: string | null;
65
+ }
66
+ /**
67
+ * Chat content response interface
68
+ */
69
+ export interface ChatContentResponse {
70
+ type: string;
71
+ text: string;
72
+ metadata?: {
73
+ chat_session_id: string;
74
+ };
75
+ }
76
+ /**
77
+ * Tool schemas for MCP
78
+ */
79
+ export declare const toolSchemas: {
80
+ search_onyx: {
81
+ name: string;
82
+ description: string;
83
+ inputSchema: {
84
+ type: string;
85
+ properties: {
86
+ query: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ chunksAbove: {
91
+ type: string;
92
+ description: string;
93
+ default: number;
94
+ };
95
+ chunksBelow: {
96
+ type: string;
97
+ description: string;
98
+ default: number;
99
+ };
100
+ retrieveFullDocuments: {
101
+ type: string;
102
+ description: string;
103
+ default: boolean;
104
+ };
105
+ documentSets: {
106
+ type: string;
107
+ items: {
108
+ type: string;
109
+ };
110
+ description: string;
111
+ };
112
+ maxResults: {
113
+ type: string;
114
+ description: string;
115
+ minimum: number;
116
+ maximum: number;
117
+ };
118
+ };
119
+ required: string[];
120
+ };
121
+ };
122
+ chat_with_onyx: {
123
+ name: string;
124
+ description: string;
125
+ inputSchema: {
126
+ type: string;
127
+ properties: {
128
+ query: {
129
+ type: string;
130
+ description: string;
131
+ };
132
+ personaId: {
133
+ type: string;
134
+ description: string;
135
+ default: number;
136
+ };
137
+ chatSessionId: {
138
+ type: string;
139
+ description: string;
140
+ };
141
+ documentSets: {
142
+ type: string;
143
+ items: {
144
+ type: string;
145
+ };
146
+ description: string;
147
+ };
148
+ enableAutoDetectFilters: {
149
+ type: string;
150
+ description: string;
151
+ default: boolean;
152
+ };
153
+ };
154
+ required: string[];
155
+ };
156
+ };
157
+ };
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Type definitions for the Onyx MCP Server
3
+ */
4
+ /**
5
+ * Tool schemas for MCP
6
+ */
7
+ export const toolSchemas = {
8
+ search_onyx: {
9
+ name: 'search_onyx',
10
+ description: 'Search the Onyx backend for relevant documents',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ query: {
15
+ type: 'string',
16
+ description: 'The topic to search for',
17
+ },
18
+ chunksAbove: {
19
+ type: 'integer',
20
+ description: 'Number of chunks to include above the matching chunk (default: 1)',
21
+ default: 1
22
+ },
23
+ chunksBelow: {
24
+ type: 'integer',
25
+ description: 'Number of chunks to include below the matching chunk (default: 1)',
26
+ default: 1
27
+ },
28
+ retrieveFullDocuments: {
29
+ type: 'boolean',
30
+ description: 'Whether to retrieve full documents instead of just matching chunks (default: false)',
31
+ default: false
32
+ },
33
+ documentSets: {
34
+ type: 'array',
35
+ items: {
36
+ type: 'string',
37
+ },
38
+ description: 'List of document set names to search within (empty for all)',
39
+ },
40
+ maxResults: {
41
+ type: 'integer',
42
+ description: 'Maximum number of results to return (default: 5)',
43
+ minimum: 1,
44
+ maximum: 10,
45
+ },
46
+ },
47
+ required: ['query'],
48
+ },
49
+ },
50
+ chat_with_onyx: {
51
+ name: 'chat_with_onyx',
52
+ description: 'Chat with Onyx to get comprehensive answers',
53
+ inputSchema: {
54
+ type: 'object',
55
+ properties: {
56
+ query: {
57
+ type: 'string',
58
+ description: 'The question to ask Onyx'
59
+ },
60
+ personaId: {
61
+ type: 'integer',
62
+ description: 'The ID of the persona to use (default: 15)',
63
+ default: 15
64
+ },
65
+ chatSessionId: {
66
+ type: 'string',
67
+ description: 'Existing chat session ID to continue a conversation (optional)'
68
+ },
69
+ documentSets: {
70
+ type: 'array',
71
+ items: {
72
+ type: 'string',
73
+ },
74
+ description: 'List of document set names to search within (empty for all)'
75
+ },
76
+ enableAutoDetectFilters: {
77
+ type: 'boolean',
78
+ description: 'Whether to enable auto-detection of filters (default: true)',
79
+ default: true
80
+ }
81
+ },
82
+ required: ['query']
83
+ }
84
+ }
85
+ };
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkFH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,WAAW,EAAE;QACX,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,gDAAgD;QAC7D,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACvC;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,SAAS;oBACf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ACF,CAAC"}
package/package.json ADDED
@@ -0,0 +1 @@
1
+ {"name": "@iflow-mcp/lupuletic-onyx-mcp-server", "version": "1.2.2", "description": "Model Context Protocol (MCP) server for seamless integration with Onyx AI knowledge bases", "main": "build/index.js", "type": "module", "bin": {"iflow-mcp-lupuletic-onyx-mcp-server": "build/index.js"}, "scripts": {"build": "tsc && chmod +x build/index.js", "start": "node build/index.js", "dev": "ts-node src/index.ts", "commit": "cz", "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.config.cjs", "test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.config.cjs --watch", "test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.config.cjs --coverage", "lint": "eslint . --ext .ts --config .eslintrc.cjs --max-warnings=${ESLINT_MAX_WARNINGS:-0}", "lint:fix": "eslint . --ext .ts --config .eslintrc.cjs --fix", "prepare": "husky install", "prepublishOnly": "npm run lint && npm run test && npm run build"}, "keywords": ["mcp", "onyx", "search", "ai", "knowledge-base", "rag", "llm", "chat", "semantic-search"], "author": "Onyx MCP Server Contributors", "license": "MIT", "repository": {"type": "git", "url": "https://github.com/lupuletic/onyx-mcp-server.git"}, "homepage": "https://github.com/lupuletic/onyx-mcp-server#readme", "bugs": {"url": "https://github.com/lupuletic/onyx-mcp-server/issues"}, "files": ["build/**/*", "LICENSE", "README.md", "CHANGELOG.md"], "dependencies": {"@modelcontextprotocol/sdk": "latest", "axios": "^1.6.7"}, "devDependencies": {"@types/jest": "^29.5.12", "@types/node": "^20.11.19", "@commitlint/cli": "^18.6.0", "@commitlint/config-conventional": "^18.6.0", "@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/parser": "^7.0.1", "commitizen": "^4.3.0", "cz-conventional-changelog": "^3.3.0", "eslint": "^8.56.0", "husky": "^9.1.7", "jest": "^29.7.0", "lint-staged": "^15.5.0", "nock": "^13.5.1", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "typescript": "^5.3.3"}, "lint-staged": {"*.ts": "eslint --config .eslintrc.cjs --fix"}, "config": {"commitizen": {"path": "cz-conventional-changelog"}}, "commitlint": {"extends": ["@commitlint/config-conventional"]}}