@houtini/lm 1.0.13 → 2.0.0
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/dist/index.d.ts +5 -3
- package/dist/index.js +142 -213
- package/dist/index.js.map +1 -1
- package/package.json +10 -33
- package/CHANGELOG.md +0 -282
- package/dist/cache/analysis-cache.d.ts +0 -33
- package/dist/cache/analysis-cache.d.ts.map +0 -1
- package/dist/cache/analysis-cache.js +0 -56
- package/dist/cache/analysis-cache.js.map +0 -1
- package/dist/cache/cache-manager.d.ts +0 -29
- package/dist/cache/cache-manager.d.ts.map +0 -1
- package/dist/cache/cache-manager.js +0 -85
- package/dist/cache/cache-manager.js.map +0 -1
- package/dist/cache/index.d.ts +0 -16
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -17
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/prompt-cache.d.ts +0 -33
- package/dist/cache/prompt-cache.d.ts.map +0 -1
- package/dist/cache/prompt-cache.js +0 -61
- package/dist/cache/prompt-cache.js.map +0 -1
- package/dist/config.d.ts +0 -41
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -71
- package/dist/config.js.map +0 -1
- package/dist/core/ThreeStagePromptManager.d.ts +0 -23
- package/dist/core/ThreeStagePromptManager.d.ts.map +0 -1
- package/dist/core/ThreeStagePromptManager.js +0 -118
- package/dist/core/ThreeStagePromptManager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/base-plugin.d.ts +0 -55
- package/dist/plugins/base-plugin.d.ts.map +0 -1
- package/dist/plugins/base-plugin.js +0 -120
- package/dist/plugins/base-plugin.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -58
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -162
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -5
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -5
- package/dist/plugins/types.js.map +0 -1
- package/dist/prompts/analyze/code-quality.d.ts +0 -116
- package/dist/prompts/analyze/code-quality.d.ts.map +0 -1
- package/dist/prompts/analyze/code-quality.js +0 -437
- package/dist/prompts/analyze/code-quality.js.map +0 -1
- package/dist/prompts/analyze/compare-integration.d.ts +0 -130
- package/dist/prompts/analyze/compare-integration.d.ts.map +0 -1
- package/dist/prompts/analyze/compare-integration.js +0 -547
- package/dist/prompts/analyze/compare-integration.js.map +0 -1
- package/dist/prompts/analyze/count-files.d.ts +0 -109
- package/dist/prompts/analyze/count-files.d.ts.map +0 -1
- package/dist/prompts/analyze/count-files.js +0 -403
- package/dist/prompts/analyze/count-files.js.map +0 -1
- package/dist/prompts/analyze/database-queries.d.ts +0 -156
- package/dist/prompts/analyze/database-queries.d.ts.map +0 -1
- package/dist/prompts/analyze/database-queries.js +0 -763
- package/dist/prompts/analyze/database-queries.js.map +0 -1
- package/dist/prompts/analyze/dependencies.d.ts +0 -97
- package/dist/prompts/analyze/dependencies.d.ts.map +0 -1
- package/dist/prompts/analyze/dependencies.js +0 -337
- package/dist/prompts/analyze/dependencies.js.map +0 -1
- package/dist/prompts/analyze/diff-signatures.d.ts +0 -139
- package/dist/prompts/analyze/diff-signatures.d.ts.map +0 -1
- package/dist/prompts/analyze/diff-signatures.js +0 -708
- package/dist/prompts/analyze/diff-signatures.js.map +0 -1
- package/dist/prompts/analyze/find-patterns.d.ts +0 -128
- package/dist/prompts/analyze/find-patterns.d.ts.map +0 -1
- package/dist/prompts/analyze/find-patterns.js +0 -524
- package/dist/prompts/analyze/find-patterns.js.map +0 -1
- package/dist/prompts/analyze/find-unused-css.d.ts +0 -151
- package/dist/prompts/analyze/find-unused-css.d.ts.map +0 -1
- package/dist/prompts/analyze/find-unused-css.js +0 -760
- package/dist/prompts/analyze/find-unused-css.js.map +0 -1
- package/dist/prompts/analyze/n8n-workflow.d.ts +0 -137
- package/dist/prompts/analyze/n8n-workflow.d.ts.map +0 -1
- package/dist/prompts/analyze/n8n-workflow.js +0 -533
- package/dist/prompts/analyze/n8n-workflow.js.map +0 -1
- package/dist/prompts/analyze/project-structure.d.ts +0 -126
- package/dist/prompts/analyze/project-structure.d.ts.map +0 -1
- package/dist/prompts/analyze/project-structure.js +0 -573
- package/dist/prompts/analyze/project-structure.js.map +0 -1
- package/dist/prompts/analyze/security-audit.d.ts +0 -142
- package/dist/prompts/analyze/security-audit.d.ts.map +0 -1
- package/dist/prompts/analyze/security-audit.js +0 -641
- package/dist/prompts/analyze/security-audit.js.map +0 -1
- package/dist/prompts/analyze/single-file.d.ts +0 -162
- package/dist/prompts/analyze/single-file.d.ts.map +0 -1
- package/dist/prompts/analyze/single-file.js +0 -669
- package/dist/prompts/analyze/single-file.js.map +0 -1
- package/dist/prompts/analyze/trace-execution.d.ts +0 -126
- package/dist/prompts/analyze/trace-execution.d.ts.map +0 -1
- package/dist/prompts/analyze/trace-execution.js +0 -613
- package/dist/prompts/analyze/trace-execution.js.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts +0 -116
- package/dist/prompts/analyze/wordpress-plugin-audit.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-audit.js +0 -456
- package/dist/prompts/analyze/wordpress-plugin-audit.js.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts +0 -103
- package/dist/prompts/analyze/wordpress-plugin-readiness.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-plugin-readiness.js +0 -506
- package/dist/prompts/analyze/wordpress-plugin-readiness.js.map +0 -1
- package/dist/prompts/analyze/wordpress-security.d.ts +0 -146
- package/dist/prompts/analyze/wordpress-security.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-security.js +0 -702
- package/dist/prompts/analyze/wordpress-security.js.map +0 -1
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts +0 -114
- package/dist/prompts/analyze/wordpress-theme-audit.d.ts.map +0 -1
- package/dist/prompts/analyze/wordpress-theme-audit.js +0 -540
- package/dist/prompts/analyze/wordpress-theme-audit.js.map +0 -1
- package/dist/prompts/custom/custom-prompt.d.ts +0 -135
- package/dist/prompts/custom/custom-prompt.d.ts.map +0 -1
- package/dist/prompts/custom/custom-prompt.js +0 -421
- package/dist/prompts/custom/custom-prompt.js.map +0 -1
- package/dist/prompts/fun/arcade-game.d.ts +0 -152
- package/dist/prompts/fun/arcade-game.d.ts.map +0 -1
- package/dist/prompts/fun/arcade-game.js +0 -657
- package/dist/prompts/fun/arcade-game.js.map +0 -1
- package/dist/prompts/fun/create_text_adventure.d.ts +0 -100
- package/dist/prompts/fun/create_text_adventure.d.ts.map +0 -1
- package/dist/prompts/fun/create_text_adventure.js +0 -401
- package/dist/prompts/fun/create_text_adventure.js.map +0 -1
- package/dist/prompts/fun/css-art-generator.d.ts +0 -168
- package/dist/prompts/fun/css-art-generator.d.ts.map +0 -1
- package/dist/prompts/fun/css-art-generator.js +0 -831
- package/dist/prompts/fun/css-art-generator.js.map +0 -1
- package/dist/prompts/generate/project-documentation.d.ts +0 -137
- package/dist/prompts/generate/project-documentation.d.ts.map +0 -1
- package/dist/prompts/generate/project-documentation.js +0 -670
- package/dist/prompts/generate/project-documentation.js.map +0 -1
- package/dist/prompts/generate/refactoring.d.ts +0 -164
- package/dist/prompts/generate/refactoring.d.ts.map +0 -1
- package/dist/prompts/generate/refactoring.js +0 -625
- package/dist/prompts/generate/refactoring.js.map +0 -1
- package/dist/prompts/generate/responsive-component.d.ts +0 -147
- package/dist/prompts/generate/responsive-component.d.ts.map +0 -1
- package/dist/prompts/generate/responsive-component.js +0 -957
- package/dist/prompts/generate/responsive-component.js.map +0 -1
- package/dist/prompts/generate/typescript-conversion.d.ts +0 -144
- package/dist/prompts/generate/typescript-conversion.d.ts.map +0 -1
- package/dist/prompts/generate/typescript-conversion.js +0 -531
- package/dist/prompts/generate/typescript-conversion.js.map +0 -1
- package/dist/prompts/generate/unit-tests.d.ts +0 -139
- package/dist/prompts/generate/unit-tests.d.ts.map +0 -1
- package/dist/prompts/generate/unit-tests.js +0 -582
- package/dist/prompts/generate/unit-tests.js.map +0 -1
- package/dist/prompts/generate/wordpress-plugin.d.ts +0 -179
- package/dist/prompts/generate/wordpress-plugin.d.ts.map +0 -1
- package/dist/prompts/generate/wordpress-plugin.js +0 -767
- package/dist/prompts/generate/wordpress-plugin.js.map +0 -1
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts +0 -177
- package/dist/prompts/generate/wordpress-theme-from-static.d.ts.map +0 -1
- package/dist/prompts/generate/wordpress-theme-from-static.js +0 -699
- package/dist/prompts/generate/wordpress-theme-from-static.js.map +0 -1
- package/dist/prompts/shared/cache-manager.d.ts +0 -45
- package/dist/prompts/shared/cache-manager.d.ts.map +0 -1
- package/dist/prompts/shared/cache-manager.js +0 -129
- package/dist/prompts/shared/cache-manager.js.map +0 -1
- package/dist/prompts/shared/helpers.d.ts +0 -39
- package/dist/prompts/shared/helpers.d.ts.map +0 -1
- package/dist/prompts/shared/helpers.js +0 -151
- package/dist/prompts/shared/helpers.js.map +0 -1
- package/dist/prompts/shared/templates.d.ts +0 -35
- package/dist/prompts/shared/templates.d.ts.map +0 -1
- package/dist/prompts/shared/templates.js +0 -77
- package/dist/prompts/shared/templates.js.map +0 -1
- package/dist/prompts/shared/types.d.ts +0 -112
- package/dist/prompts/shared/types.d.ts.map +0 -1
- package/dist/prompts/shared/types.js +0 -5
- package/dist/prompts/shared/types.js.map +0 -1
- package/dist/prompts/system/find-unused-files.d.ts +0 -106
- package/dist/prompts/system/find-unused-files.d.ts.map +0 -1
- package/dist/prompts/system/find-unused-files.js +0 -357
- package/dist/prompts/system/find-unused-files.js.map +0 -1
- package/dist/security/index.d.ts +0 -39
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js +0 -46
- package/dist/security/index.js.map +0 -1
- package/dist/security/integration-helpers.d.ts +0 -121
- package/dist/security/integration-helpers.d.ts.map +0 -1
- package/dist/security/integration-helpers.js +0 -190
- package/dist/security/integration-helpers.js.map +0 -1
- package/dist/security/output-encoder.d.ts +0 -94
- package/dist/security/output-encoder.d.ts.map +0 -1
- package/dist/security/output-encoder.js +0 -295
- package/dist/security/output-encoder.js.map +0 -1
- package/dist/security/prompt-injection-guard.d.ts +0 -59
- package/dist/security/prompt-injection-guard.d.ts.map +0 -1
- package/dist/security/prompt-injection-guard.js +0 -249
- package/dist/security/prompt-injection-guard.js.map +0 -1
- package/dist/security/sanitisation.d.ts +0 -67
- package/dist/security/sanitisation.d.ts.map +0 -1
- package/dist/security/sanitisation.js +0 -398
- package/dist/security/sanitisation.js.map +0 -1
- package/dist/security/security-service.d.ts +0 -103
- package/dist/security/security-service.d.ts.map +0 -1
- package/dist/security/security-service.js +0 -303
- package/dist/security/security-service.js.map +0 -1
- package/dist/security-config.d.ts +0 -45
- package/dist/security-config.d.ts.map +0 -1
- package/dist/security-config.js +0 -63
- package/dist/security-config.js.map +0 -1
- package/dist/system/function-list.d.ts +0 -61
- package/dist/system/function-list.d.ts.map +0 -1
- package/dist/system/function-list.js +0 -111
- package/dist/system/function-list.js.map +0 -1
- package/dist/system/function-registry.d.ts +0 -23
- package/dist/system/function-registry.d.ts.map +0 -1
- package/dist/system/function-registry.js +0 -136
- package/dist/system/function-registry.js.map +0 -1
- package/dist/system/health-check.d.ts +0 -33
- package/dist/system/health-check.d.ts.map +0 -1
- package/dist/system/health-check.js +0 -98
- package/dist/system/health-check.js.map +0 -1
- package/dist/system/path-resolver.d.ts +0 -55
- package/dist/system/path-resolver.d.ts.map +0 -1
- package/dist/system/path-resolver.js +0 -90
- package/dist/system/path-resolver.js.map +0 -1
- package/dist/templates/plugin-template.d.ts +0 -121
- package/dist/templates/plugin-template.d.ts.map +0 -1
- package/dist/templates/plugin-template.js +0 -454
- package/dist/templates/plugin-template.js.map +0 -1
- package/dist/types/chunking-types.d.ts +0 -88
- package/dist/types/chunking-types.d.ts.map +0 -1
- package/dist/types/chunking-types.js +0 -18
- package/dist/types/chunking-types.js.map +0 -1
- package/dist/types/prompt-stages.d.ts +0 -30
- package/dist/types/prompt-stages.d.ts.map +0 -1
- package/dist/types/prompt-stages.js +0 -6
- package/dist/types/prompt-stages.js.map +0 -1
- package/dist/types.d.ts +0 -45
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
- package/dist/utils/css-parser.d.ts +0 -26
- package/dist/utils/css-parser.d.ts.map +0 -1
- package/dist/utils/css-parser.js +0 -117
- package/dist/utils/css-parser.js.map +0 -1
- package/dist/utils/path-resolver.d.ts +0 -13
- package/dist/utils/path-resolver.d.ts.map +0 -1
- package/dist/utils/path-resolver.js +0 -78
- package/dist/utils/path-resolver.js.map +0 -1
- package/dist/utils/plugin-utilities.d.ts +0 -176
- package/dist/utils/plugin-utilities.d.ts.map +0 -1
- package/dist/utils/plugin-utilities.js +0 -269
- package/dist/utils/plugin-utilities.js.map +0 -1
- package/dist/utils/streamHandler.d.ts +0 -3
- package/dist/utils/streamHandler.d.ts.map +0 -1
- package/dist/utils/streamHandler.js +0 -137
- package/dist/utils/streamHandler.js.map +0 -1
- package/dist/validation/output-validator.d.ts +0 -136
- package/dist/validation/output-validator.d.ts.map +0 -1
- package/dist/validation/output-validator.js +0 -262
- package/dist/validation/output-validator.js.map +0 -1
- package/dist/validation/response-factory.d.ts +0 -44
- package/dist/validation/response-factory.d.ts.map +0 -1
- package/dist/validation/response-factory.js +0 -202
- package/dist/validation/response-factory.js.map +0 -1
- package/dist/validation/schemas.d.ts +0 -519
- package/dist/validation/schemas.d.ts.map +0 -1
- package/dist/validation/schemas.js +0 -6
- package/dist/validation/schemas.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
/**
|
|
2
|
-
* Houtini LM MCP Server
|
|
3
|
-
*
|
|
3
|
+
* Houtini LM — MCP Server for Local LLMs via OpenAI-compatible API
|
|
4
|
+
*
|
|
5
|
+
* Connects to LM Studio (or any OpenAI-compatible endpoint) and exposes
|
|
6
|
+
* chat, custom prompts, and model info as MCP tools.
|
|
4
7
|
*/
|
|
5
8
|
export {};
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,242 +1,171 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Houtini LM MCP Server
|
|
4
|
-
*
|
|
3
|
+
* Houtini LM — MCP Server for Local LLMs via OpenAI-compatible API
|
|
4
|
+
*
|
|
5
|
+
* Connects to LM Studio (or any OpenAI-compatible endpoint) and exposes
|
|
6
|
+
* chat, custom prompts, and model info as MCP tools.
|
|
5
7
|
*/
|
|
6
8
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
7
9
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
|
-
import { CallToolRequestSchema, ListToolsRequestSchema,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.pluginsInitialized = false;
|
|
23
|
-
this.server = new Server({
|
|
24
|
-
name: 'houtini-lm',
|
|
25
|
-
version: '1.0.7',
|
|
26
|
-
description: 'Local AI development companion - unlimited analysis and generation without API costs. Preserves Claude context by offloading routine tasks to local LM Studio.',
|
|
27
|
-
}, {
|
|
28
|
-
capabilities: {
|
|
29
|
-
tools: {
|
|
30
|
-
description: 'Context preservation through local processing - use for routine tasks, save Claude for strategy'
|
|
31
|
-
},
|
|
32
|
-
resources: {
|
|
33
|
-
description: 'Local LM Studio integration with unlimited processing'
|
|
34
|
-
},
|
|
35
|
-
prompts: {
|
|
36
|
-
description: 'Three-stage prompting system with expert personas'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
// Note: Security validation will be done during server start
|
|
41
|
-
this.lmStudioClient = new LMStudioClient({
|
|
42
|
-
baseUrl: config.lmStudioUrl,
|
|
43
|
-
});
|
|
44
|
-
this.pluginLoader = PluginRegistry.getInstance();
|
|
45
|
-
this.setupHandlers();
|
|
46
|
-
// Error handling
|
|
47
|
-
this.server.onerror = (error) => {
|
|
48
|
-
// Silent error handling for MCP protocol compliance
|
|
49
|
-
};
|
|
50
|
-
process.on('SIGINT', async () => {
|
|
51
|
-
await this.server.close();
|
|
52
|
-
process.exit(0);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Validate security configuration at startup
|
|
57
|
-
* Fails fast if environment variables are not properly configured
|
|
58
|
-
*/
|
|
59
|
-
async validateSecurityConfiguration() {
|
|
60
|
-
try {
|
|
61
|
-
const { securityConfig } = await import('./security-config.js');
|
|
62
|
-
const allowedDirs = securityConfig.getAllowedDirectories();
|
|
63
|
-
// Validate each directory exists and is accessible
|
|
64
|
-
const fs = await import('fs');
|
|
65
|
-
for (const dir of allowedDirs) {
|
|
66
|
-
try {
|
|
67
|
-
const stat = fs.statSync(dir);
|
|
68
|
-
if (!stat.isDirectory()) {
|
|
69
|
-
console.warn(`[WARNING] Allowed path is not a directory: ${dir}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
console.warn(`[WARNING] Cannot access allowed directory: ${dir} (${error.message})`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error('SECURITY CONFIGURATION ERROR:', error.message);
|
|
79
|
-
console.error('Please set the LLM_MCP_ALLOWED_DIRS environment variable in your Claude Desktop configuration.');
|
|
80
|
-
console.error('Example: "LLM_MCP_ALLOWED_DIRS": "C:\\\\MCP,C:\\\\dev,C:\\\\Users\\\\YourName\\\\Documents"');
|
|
81
|
-
process.exit(1);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Initialize plugins from directories
|
|
86
|
-
*/
|
|
87
|
-
async initializePlugins() {
|
|
88
|
-
if (this.pluginsInitialized)
|
|
89
|
-
return;
|
|
90
|
-
try {
|
|
91
|
-
console.error('DEBUG: Starting plugin initialization...');
|
|
92
|
-
// Load plugins from prompts directory
|
|
93
|
-
const promptsDir = path.join(__dirname, 'prompts');
|
|
94
|
-
console.error('DEBUG: Loading from:', promptsDir);
|
|
95
|
-
await this.pluginLoader.loadPlugins(promptsDir);
|
|
96
|
-
// Load system plugins
|
|
97
|
-
await this.loadSystemPlugins();
|
|
98
|
-
this.pluginsInitialized = true;
|
|
99
|
-
console.error('DEBUG: Plugins initialized successfully');
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
// Silent error handling to avoid JSON-RPC interference
|
|
103
|
-
throw error;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Load system plugins from the system directory
|
|
108
|
-
*/
|
|
109
|
-
async loadSystemPlugins() {
|
|
110
|
-
try {
|
|
111
|
-
const systemDir = path.join(__dirname, 'system');
|
|
112
|
-
const files = fs.readdirSync(systemDir);
|
|
113
|
-
for (const file of files) {
|
|
114
|
-
if (file.endsWith('.js')) { // Only load .js files, skip .d.ts
|
|
115
|
-
const filePath = path.join(systemDir, file);
|
|
116
|
-
await this.loadSystemPlugin(filePath);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
catch (error) {
|
|
121
|
-
// Silent error handling to avoid JSON-RPC interference
|
|
122
|
-
// console.error('[Plugin Server] Error loading system plugins:', error);
|
|
123
|
-
}
|
|
10
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
11
|
+
const LM_BASE_URL = process.env.LM_STUDIO_URL || 'http://hopper:1234';
|
|
12
|
+
const LM_MODEL = process.env.LM_STUDIO_MODEL || '';
|
|
13
|
+
const DEFAULT_MAX_TOKENS = 4096;
|
|
14
|
+
const DEFAULT_TEMPERATURE = 0.3;
|
|
15
|
+
async function chatCompletion(messages, options = {}) {
|
|
16
|
+
const body = {
|
|
17
|
+
messages,
|
|
18
|
+
temperature: options.temperature ?? DEFAULT_TEMPERATURE,
|
|
19
|
+
max_tokens: options.maxTokens ?? DEFAULT_MAX_TOKENS,
|
|
20
|
+
stream: false,
|
|
21
|
+
};
|
|
22
|
+
if (options.model || LM_MODEL) {
|
|
23
|
+
body.model = options.model || LM_MODEL;
|
|
124
24
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const PluginClass = module.default || module.HealthCheckPlugin || module.PathResolverPlugin || Object.values(module)[0];
|
|
134
|
-
if (PluginClass && typeof PluginClass === 'function') {
|
|
135
|
-
const plugin = new PluginClass();
|
|
136
|
-
this.pluginLoader.registerPlugin(plugin);
|
|
137
|
-
// Removed console.log to avoid JSON-RPC interference
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
// Silent error handling to avoid JSON-RPC interference
|
|
142
|
-
// console.error(`[Plugin Server] Error loading system plugin ${filePath}:`, error);
|
|
143
|
-
}
|
|
25
|
+
const res = await fetch(`${LM_BASE_URL}/v1/chat/completions`, {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
headers: { 'Content-Type': 'application/json' },
|
|
28
|
+
body: JSON.stringify(body),
|
|
29
|
+
});
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
const text = await res.text().catch(() => '');
|
|
32
|
+
throw new Error(`LM Studio API error ${res.status}: ${text}`);
|
|
144
33
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
34
|
+
return res.json();
|
|
35
|
+
}
|
|
36
|
+
async function listModels() {
|
|
37
|
+
const res = await fetch(`${LM_BASE_URL}/v1/models`);
|
|
38
|
+
if (!res.ok)
|
|
39
|
+
throw new Error(`Failed to list models: ${res.status}`);
|
|
40
|
+
const data = (await res.json());
|
|
41
|
+
return data.data.map((m) => m.id);
|
|
42
|
+
}
|
|
43
|
+
// ── MCP Tool definitions ─────────────────────────────────────────────
|
|
44
|
+
const TOOLS = [
|
|
45
|
+
{
|
|
46
|
+
name: 'chat',
|
|
47
|
+
description: 'Send a message to the local LLM and get a response. Useful for offloading routine analysis to a local model and preserving Claude context.',
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
message: { type: 'string', description: 'User message to send' },
|
|
52
|
+
system: { type: 'string', description: 'Optional system prompt' },
|
|
53
|
+
temperature: { type: 'number', description: 'Sampling temperature (0–2, default 0.3)' },
|
|
54
|
+
max_tokens: { type: 'number', description: 'Max tokens in response (default 4096)' },
|
|
55
|
+
},
|
|
56
|
+
required: ['message'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'custom_prompt',
|
|
61
|
+
description: 'Run a structured prompt with system message, context, and instruction against the local LLM.',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
system: { type: 'string', description: 'System prompt / persona' },
|
|
66
|
+
context: { type: 'string', description: 'Background context or data to analyse' },
|
|
67
|
+
instruction: { type: 'string', description: 'What to do with the context' },
|
|
68
|
+
temperature: { type: 'number', description: 'Sampling temperature (default 0.3)' },
|
|
69
|
+
max_tokens: { type: 'number', description: 'Max tokens (default 4096)' },
|
|
70
|
+
},
|
|
71
|
+
required: ['instruction'],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'list_models',
|
|
76
|
+
description: 'List models currently loaded in LM Studio.',
|
|
77
|
+
inputSchema: { type: 'object', properties: {} },
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'health_check',
|
|
81
|
+
description: 'Check connectivity to the local LM Studio instance.',
|
|
82
|
+
inputSchema: { type: 'object', properties: {} },
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
// ── MCP Server ───────────────────────────────────────────────────────
|
|
86
|
+
const server = new Server({ name: 'houtini-lm', version: '2.0.0' }, { capabilities: { tools: {} } });
|
|
87
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
88
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
89
|
+
const { name, arguments: args } = request.params;
|
|
90
|
+
try {
|
|
91
|
+
switch (name) {
|
|
92
|
+
case 'chat': {
|
|
93
|
+
const { message, system, temperature, max_tokens } = args;
|
|
94
|
+
const messages = [];
|
|
95
|
+
if (system)
|
|
96
|
+
messages.push({ role: 'system', content: system });
|
|
97
|
+
messages.push({ role: 'user', content: message });
|
|
98
|
+
const resp = await chatCompletion(messages, {
|
|
99
|
+
temperature,
|
|
100
|
+
maxTokens: max_tokens,
|
|
101
|
+
});
|
|
102
|
+
const reply = resp.choices[0]?.message?.content ?? '';
|
|
103
|
+
const usage = resp.usage
|
|
104
|
+
? `\n\n---\nModel: ${resp.model} | Tokens: ${resp.usage.prompt_tokens}→${resp.usage.completion_tokens}`
|
|
105
|
+
: '';
|
|
106
|
+
return { content: [{ type: 'text', text: reply + usage }] };
|
|
153
107
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if (!this.pluginsInitialized) {
|
|
171
|
-
await this.initializePlugins();
|
|
108
|
+
case 'custom_prompt': {
|
|
109
|
+
const { system, context, instruction, temperature, max_tokens } = args;
|
|
110
|
+
const messages = [];
|
|
111
|
+
if (system)
|
|
112
|
+
messages.push({ role: 'system', content: system });
|
|
113
|
+
let userContent = instruction;
|
|
114
|
+
if (context)
|
|
115
|
+
userContent = `Context:\n${context}\n\nInstruction:\n${instruction}`;
|
|
116
|
+
messages.push({ role: 'user', content: userContent });
|
|
117
|
+
const resp = await chatCompletion(messages, {
|
|
118
|
+
temperature,
|
|
119
|
+
maxTokens: max_tokens,
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
content: [{ type: 'text', text: resp.choices[0]?.message?.content ?? '' }],
|
|
123
|
+
};
|
|
172
124
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const pluginName = toolName.replace(/^houtini-lm:/, '');
|
|
176
|
-
// Execute plugin
|
|
177
|
-
const result = await this.pluginLoader.executePlugin(pluginName, args, this.lmStudioClient);
|
|
178
|
-
// Silent success - no console output
|
|
179
|
-
// Return standardized MCP response
|
|
125
|
+
case 'list_models': {
|
|
126
|
+
const models = await listModels();
|
|
180
127
|
return {
|
|
181
128
|
content: [
|
|
182
129
|
{
|
|
183
130
|
type: 'text',
|
|
184
|
-
text:
|
|
185
|
-
|
|
186
|
-
|
|
131
|
+
text: models.length
|
|
132
|
+
? `Loaded models:\n${models.map((m) => ` • ${m}`).join('\n')}`
|
|
133
|
+
: 'No models currently loaded.',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
187
136
|
};
|
|
188
137
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
138
|
+
case 'health_check': {
|
|
139
|
+
const start = Date.now();
|
|
140
|
+
const models = await listModels();
|
|
141
|
+
const ms = Date.now() - start;
|
|
192
142
|
return {
|
|
193
143
|
content: [
|
|
194
144
|
{
|
|
195
145
|
type: 'text',
|
|
196
|
-
text:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
tool: toolName,
|
|
200
|
-
timestamp: new Date().toISOString()
|
|
201
|
-
}, null, 2)
|
|
202
|
-
}
|
|
203
|
-
]
|
|
146
|
+
text: `Connected to ${LM_BASE_URL} (${ms}ms)\nModels loaded: ${models.length}${models.length ? '\n' + models.join(', ') : ''}`,
|
|
147
|
+
},
|
|
148
|
+
],
|
|
204
149
|
};
|
|
205
150
|
}
|
|
206
|
-
|
|
151
|
+
default:
|
|
152
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
153
|
+
}
|
|
207
154
|
}
|
|
208
|
-
|
|
209
|
-
* Get plugin statistics
|
|
210
|
-
*/
|
|
211
|
-
getPluginStats() {
|
|
212
|
-
const plugins = this.pluginLoader.getPlugins();
|
|
213
|
-
const categories = {
|
|
214
|
-
analyze: this.pluginLoader.getPluginsByCategory('analyze').length,
|
|
215
|
-
generate: this.pluginLoader.getPluginsByCategory('generate').length,
|
|
216
|
-
system: this.pluginLoader.getPluginsByCategory('system').length
|
|
217
|
-
};
|
|
155
|
+
catch (error) {
|
|
218
156
|
return {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
pluginNames: plugins.map(p => p.name)
|
|
157
|
+
content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
158
|
+
isError: true,
|
|
222
159
|
};
|
|
223
160
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
await this.validateSecurityConfiguration();
|
|
230
|
-
// Silent startup after security validation - no console output to avoid JSON-RPC interference
|
|
231
|
-
const transport = new StdioServerTransport();
|
|
232
|
-
await this.server.connect(transport);
|
|
233
|
-
// Server started silently
|
|
234
|
-
}
|
|
161
|
+
});
|
|
162
|
+
async function main() {
|
|
163
|
+
const transport = new StdioServerTransport();
|
|
164
|
+
await server.connect(transport);
|
|
165
|
+
process.stderr.write(`Houtini LM server running (${LM_BASE_URL})\n`);
|
|
235
166
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
server.start().catch((error) => {
|
|
239
|
-
// Silent error handling - only exit on critical startup failure
|
|
167
|
+
main().catch((error) => {
|
|
168
|
+
process.stderr.write(`Fatal error: ${error}\n`);
|
|
240
169
|
process.exit(1);
|
|
241
170
|
});
|
|
242
171
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,oBAAoB,CAAC;AACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;AACnD,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAmBhC,KAAK,UAAU,cAAc,CAC3B,QAAuB,EACvB,UAAwE,EAAE;IAE1E,MAAM,IAAI,GAA4B;QACpC,QAAQ;QACR,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,mBAAmB;QACvD,UAAU,EAAE,OAAO,CAAC,SAAS,IAAI,kBAAkB;QACnD,MAAM,EAAE,KAAK;KACd,CAAC;IACF,IAAI,OAAO,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC;IACzC,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,WAAW,sBAAsB,EAAE;QAC5D,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAA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description": "MCP server for local LLMs — connects to LM Studio or any OpenAI-compatible endpoint",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"houtini-lm": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc && node add-shebang.mjs",
|
|
12
|
-
"
|
|
13
|
-
"rebuild": "npm run clean && npm run build",
|
|
14
|
-
"start": "node dist/index.js",
|
|
15
|
-
"dev": "tsc --watch",
|
|
16
|
-
"test:connection": "node test-connection.mjs",
|
|
17
|
-
"test:integration": "node tests/integration.test.mjs",
|
|
18
|
-
"test:tools": "node tests/tools.test.mjs",
|
|
19
|
-
"test:core": "jest tests/core.test.ts",
|
|
20
|
-
"test": "npm run test:connection && npm run test:tools && npm run test:core",
|
|
21
|
-
"diagnose": "node diagnostics/run-diagnostics.mjs",
|
|
22
|
-
"check:processes": "node diagnostics/check-claude-processes.mjs"
|
|
12
|
+
"dev": "tsc --watch"
|
|
23
13
|
},
|
|
24
14
|
"keywords": [
|
|
25
|
-
"houtini",
|
|
26
|
-
"local-lm",
|
|
27
15
|
"mcp",
|
|
28
16
|
"model-context-protocol",
|
|
29
|
-
"claude-mcp",
|
|
30
17
|
"lm-studio",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"local-ai"
|
|
18
|
+
"openai",
|
|
19
|
+
"local-llm",
|
|
20
|
+
"claude",
|
|
21
|
+
"ai-tools"
|
|
36
22
|
],
|
|
37
23
|
"author": "Richard Baxter <richard@richardbaxter.co> (https://richardbaxter.co)",
|
|
38
24
|
"license": "MIT",
|
|
@@ -45,19 +31,11 @@
|
|
|
45
31
|
"url": "https://github.com/houtini-ai/lm/issues"
|
|
46
32
|
},
|
|
47
33
|
"dependencies": {
|
|
48
|
-
"@
|
|
49
|
-
"@modelcontextprotocol/sdk": "^1.17.3",
|
|
50
|
-
"puppeteer": "^21.11.0",
|
|
51
|
-
"css-tree": "^2.3.1"
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.26.0"
|
|
52
35
|
},
|
|
53
36
|
"devDependencies": {
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"
|
|
56
|
-
"jest": "^29.7.0",
|
|
57
|
-
"ts-jest": "^29.1.1",
|
|
58
|
-
"rimraf": "^6.0.1",
|
|
59
|
-
"typescript": "^5.3.3",
|
|
60
|
-
"@types/css-tree": "^2.3.8"
|
|
37
|
+
"@types/node": "^22.0.0",
|
|
38
|
+
"typescript": "^5.7.0"
|
|
61
39
|
},
|
|
62
40
|
"engines": {
|
|
63
41
|
"node": ">=18.0.0"
|
|
@@ -65,7 +43,6 @@
|
|
|
65
43
|
"files": [
|
|
66
44
|
"dist/**/*",
|
|
67
45
|
"README.md",
|
|
68
|
-
"CHANGELOG.md",
|
|
69
46
|
"LICENSE"
|
|
70
47
|
],
|
|
71
48
|
"publishConfig": {
|