@houtini/lm 2.0.0 → 2.1.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/README.md +91 -225
- package/dist/index.js +79 -18
- package/dist/index.js.map +1 -1
- package/package.json +17 -3
- package/server.json +44 -0
package/README.md
CHANGED
|
@@ -1,293 +1,159 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @houtini/lm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@houtini/lm)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
MCP server that connects Claude to **any OpenAI-compatible LLM endpoint** — LM Studio, Ollama, vLLM, llama.cpp, or any remote API.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Offload routine work to a local model. Keep your Claude context window for the hard stuff.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Why
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
- 🔍 **Code analysis** - Deep insights into quality, security, and architecture
|
|
13
|
-
- 📝 **Documentation generation** - Professional docs from code analysis
|
|
14
|
-
- 🏗️ **Project scaffolding** - Complete applications, themes, and components
|
|
15
|
-
- 🎮 **Creative projects** - Games, CSS art, and interactive experiences
|
|
16
|
-
- 🛡️ **Security audits** - OWASP compliance and vulnerability detection
|
|
12
|
+
Claude is great at orchestration and reasoning. Local models are great at bulk analysis, classification, extraction, and summarisation. This server lets Claude delegate to a local model on the fly — no API keys, no cloud round-trips, no context wasted.
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
**Common use cases:**
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
- Classify or tag hundreds of items without burning Claude tokens
|
|
17
|
+
- Extract structured data from long documents
|
|
18
|
+
- Run a second opinion on generated code
|
|
19
|
+
- Summarise research before Claude synthesises it
|
|
20
|
+
- Delegate code review to a local model while Claude handles other work
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
Use houtini-lm to analyse the code quality in C:/my-project/src/UserAuth.js
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
Generate comprehensive unit tests using houtini-lm for my React component at C:/components/Dashboard.jsx
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
Use houtini-lm to create a WordPress plugin called "Event Manager" with custom post types and admin interface
|
|
32
|
-
```
|
|
22
|
+
## What's new in v2.1.0
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
- **Smarter tool descriptions** — tool descriptions now encode prompting best practices for local LLMs, so Claude automatically sends well-structured prompts (complete code, capped output tokens, explicit format instructions)
|
|
25
|
+
- **New `code_task` tool** — purpose-built for code analysis with an optimised system prompt and sensible defaults (temp 0.2, 500 token cap)
|
|
26
|
+
- **Delegation guidance** — each tool description tells Claude when to use it, what output to expect, and what to avoid (e.g. never send truncated code to a local model)
|
|
37
27
|
|
|
38
|
-
|
|
39
|
-
Create a CSS art generator project using houtini-lm with space theme and neon colours
|
|
40
|
-
```
|
|
28
|
+
## Install
|
|
41
29
|
|
|
42
|
-
|
|
43
|
-
Use houtini-lm to convert my JavaScript file to TypeScript with strict mode enabled
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
Generate responsive HTML components using houtini-lm for a pricing card with dark mode support
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Prerequisites
|
|
51
|
-
|
|
52
|
-
**Essential Requirements:**
|
|
53
|
-
|
|
54
|
-
1. **LM Studio** - Download from [lmstudio.ai](https://lmstudio.ai)
|
|
55
|
-
- Must be running at `ws://127.0.0.1:1234`
|
|
56
|
-
- Model loaded and ready (13B+ parameters recommended)
|
|
57
|
-
|
|
58
|
-
2. **Desktop Commander MCP** - Essential for file operations
|
|
59
|
-
- Repository: [DesktopCommanderMCP](https://github.com/wonderwhy-er/DesktopCommanderMCP)
|
|
60
|
-
- Required for reading files and writing generated code
|
|
61
|
-
|
|
62
|
-
3. **Node.js 24.6.0 or later** - For MCP server functionality
|
|
63
|
-
- Download from [nodejs.org](https://nodejs.org)
|
|
64
|
-
|
|
65
|
-
4. **Claude Desktop** - For the best experience
|
|
66
|
-
- Download from [claude.ai/download](https://claude.ai/download)
|
|
67
|
-
|
|
68
|
-
## Installation
|
|
69
|
-
|
|
70
|
-
### 1. Install the Package
|
|
30
|
+
### Claude Code (recommended)
|
|
71
31
|
|
|
72
32
|
```bash
|
|
73
|
-
|
|
74
|
-
npm install -g @houtini/lm
|
|
75
|
-
|
|
76
|
-
# Or use npx (no installation required)
|
|
77
|
-
npx @houtini/lm
|
|
33
|
+
claude mcp add houtini-lm -e LM_STUDIO_URL=http://localhost:1234 -- npx -y @houtini/lm
|
|
78
34
|
```
|
|
79
35
|
|
|
80
|
-
###
|
|
36
|
+
### Claude Desktop
|
|
81
37
|
|
|
82
|
-
Add to
|
|
83
|
-
|
|
84
|
-
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
85
|
-
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
38
|
+
Add to `claude_desktop_config.json`:
|
|
86
39
|
|
|
87
40
|
```json
|
|
88
41
|
{
|
|
89
42
|
"mcpServers": {
|
|
90
43
|
"houtini-lm": {
|
|
91
44
|
"command": "npx",
|
|
92
|
-
"args": ["@houtini/lm"],
|
|
45
|
+
"args": ["-y", "@houtini/lm"],
|
|
93
46
|
"env": {
|
|
94
|
-
"
|
|
47
|
+
"LM_STUDIO_URL": "http://localhost:1234"
|
|
95
48
|
}
|
|
96
49
|
}
|
|
97
50
|
}
|
|
98
51
|
}
|
|
99
52
|
```
|
|
100
53
|
|
|
101
|
-
###
|
|
102
|
-
|
|
103
|
-
1. Launch LM Studio
|
|
104
|
-
2. Load a model (13B+ parameters recommended for best results)
|
|
105
|
-
3. Start the server at `ws://127.0.0.1:1234`
|
|
106
|
-
4. Verify the model is ready and responding
|
|
107
|
-
|
|
108
|
-
### 4. Verify Installation
|
|
109
|
-
|
|
110
|
-
Restart Claude Desktop, then test with:
|
|
54
|
+
### npx (standalone)
|
|
111
55
|
|
|
112
|
-
```
|
|
113
|
-
|
|
56
|
+
```bash
|
|
57
|
+
npx @houtini/lm
|
|
114
58
|
```
|
|
115
59
|
|
|
116
|
-
##
|
|
60
|
+
## Configuration
|
|
117
61
|
|
|
118
|
-
|
|
119
|
-
- **`analyze_single_file`** - Deep code analysis and quality assessment
|
|
120
|
-
- **`count_files`** - Project structure with beautiful markdown trees
|
|
121
|
-
- **`find_unused_files`** - Dead code detection with risk assessment
|
|
122
|
-
- **`security_audit`** - OWASP compliance and vulnerability scanning
|
|
123
|
-
- **`analyze_dependencies`** - Circular dependencies and unused imports
|
|
124
|
-
- And 12 more specialized analysis tools...
|
|
62
|
+
Set via environment variables or in your MCP client config:
|
|
125
63
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- **`generate_responsive_component`** - Accessible HTML/CSS components
|
|
132
|
-
- And 5 more generation tools...
|
|
64
|
+
| Variable | Default | Description |
|
|
65
|
+
|----------|---------|-------------|
|
|
66
|
+
| `LM_STUDIO_URL` | `http://localhost:1234` | Base URL of the OpenAI-compatible API |
|
|
67
|
+
| `LM_STUDIO_MODEL` | *(auto-detect)* | Model identifier — leave blank to use whatever's loaded |
|
|
68
|
+
| `LM_STUDIO_PASSWORD` | *(none)* | Bearer token for authenticated endpoints |
|
|
133
69
|
|
|
134
|
-
|
|
135
|
-
- **`css_art_generator`** - Pure CSS art and animations
|
|
136
|
-
- **`arcade_game`** - Complete playable HTML5 games
|
|
137
|
-
- **`create_text_adventure`** - Interactive fiction with branching stories
|
|
70
|
+
## Tools
|
|
138
71
|
|
|
139
|
-
###
|
|
140
|
-
- **`health_check`** - Verify LM Studio connection
|
|
141
|
-
- **`list_functions`** - Discover all available functions
|
|
142
|
-
- **`resolve_path`** - Path analysis and suggestions
|
|
143
|
-
- And 2 more system utilities...
|
|
72
|
+
### `chat`
|
|
144
73
|
|
|
145
|
-
|
|
74
|
+
Delegate a bounded task to the local LLM. The workhorse for quick questions, code explanation, and pattern recognition.
|
|
146
75
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
// Context detection from your loaded model
|
|
155
|
-
const contextLength = await model.getContextLength(); // e.g., 16,384 tokens
|
|
156
|
-
|
|
157
|
-
// Dynamic allocation - 95% utilization
|
|
158
|
-
const responseTokens = Math.floor(contextLength * 0.95); // 15,565 tokens available
|
|
76
|
+
```
|
|
77
|
+
message (required) — the task, with explicit output format instructions
|
|
78
|
+
system — persona (be specific: "Senior TypeScript dev", not "helpful assistant")
|
|
79
|
+
temperature — 0.1 for code, 0.3 for analysis (default), 0.5 for suggestions
|
|
80
|
+
max_tokens — match to expected output: 150 for quick answers, 300 for explanations, 500 for code gen
|
|
159
81
|
```
|
|
160
82
|
|
|
161
|
-
**
|
|
162
|
-
- ✅ **Maximum efficiency** - No wasted context space
|
|
163
|
-
- ✅ **Model-agnostic** - Works with any context size (4K, 16K, 32K+)
|
|
164
|
-
- ✅ **Future-proof** - Automatically adapts to larger models
|
|
165
|
-
|
|
166
|
-
### Three-Stage Prompt System
|
|
83
|
+
**Tip:** Always send complete code — local models hallucinate details for truncated input.
|
|
167
84
|
|
|
168
|
-
|
|
85
|
+
### `custom_prompt`
|
|
169
86
|
|
|
170
|
-
|
|
171
|
-
**Stage 2: Data Payload** - Your code, files, or project content
|
|
172
|
-
**Stage 3: Output Instructions** - Structured response requirements
|
|
87
|
+
Structured 3-part prompt with separate system, context, and instruction fields. The separation prevents context bleed in local models — better results than stuffing everything into a single message.
|
|
173
88
|
|
|
174
89
|
```
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
│ Output Instructions │ ← Response format, requirements
|
|
181
|
-
└─────────────────────┘
|
|
90
|
+
instruction (required) — what to produce (under 50 words works best)
|
|
91
|
+
system — persona, specific and under 30 words
|
|
92
|
+
context — COMPLETE data to analyse (never truncated)
|
|
93
|
+
temperature — 0.1 for review, 0.3 for analysis (default)
|
|
94
|
+
max_tokens — 200 for bullets, 400 for detailed review, 600 for code gen
|
|
182
95
|
```
|
|
183
96
|
|
|
184
|
-
|
|
185
|
-
- **Small files** → Single-stage execution for speed
|
|
186
|
-
- **Large files** → Automatic chunking with coherent aggregation
|
|
187
|
-
- **Multi-file projects** → Optimized batch processing
|
|
188
|
-
|
|
189
|
-
### Automatic Chunking Capability
|
|
97
|
+
### `code_task`
|
|
190
98
|
|
|
191
|
-
|
|
99
|
+
Purpose-built for code analysis. Wraps the local LLM with an optimised code-review system prompt and low temperature (0.2).
|
|
192
100
|
|
|
193
|
-
**Smart Chunking Features:**
|
|
194
|
-
- 🔍 **Natural boundaries** - Splits at logical sections, not arbitrary points
|
|
195
|
-
- 🔄 **Context preservation** - Maintains analysis continuity across chunks
|
|
196
|
-
- 📊 **Intelligent aggregation** - Combines chunk results into coherent reports
|
|
197
|
-
- ⚡ **Performance optimization** - Parallel processing where possible
|
|
198
|
-
|
|
199
|
-
**Example Chunking Process:**
|
|
200
101
|
```
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Single comprehensive analysis report
|
|
102
|
+
code (required) — complete source code (never truncate)
|
|
103
|
+
task (required) — what to do: "Find bugs", "Explain this function", "Add error handling"
|
|
104
|
+
language — "typescript", "python", "rust", etc.
|
|
105
|
+
max_tokens — default 500 (200 for quick answers, 800 for code generation)
|
|
206
106
|
```
|
|
207
107
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
Houtini LM uses **120-second timeouts** (2 minutes) to accommodate thorough analysis on lower-powered systems:
|
|
211
|
-
|
|
212
|
-
**Why Extended Timeouts:**
|
|
213
|
-
- 🔍 **Complex analysis** - Security audits, architecture analysis, and comprehensive code reviews take time
|
|
214
|
-
- 💻 **System compatibility** - Works reliably on older hardware and resource-constrained environments
|
|
215
|
-
- 🧠 **Model processing** - Larger local models (13B-33B parameters) require more inference time
|
|
216
|
-
- 📊 **Quality over speed** - Comprehensive reports are worth the wait
|
|
217
|
-
|
|
218
|
-
**Timeout Guidelines:**
|
|
219
|
-
- **Simple analysis** (100 lines): 15-30 seconds
|
|
220
|
-
- **Medium files** (500 lines): 30-60 seconds
|
|
221
|
-
- **Large files** (1000+ lines): 60-120 seconds
|
|
222
|
-
- **Multi-file projects**: 90-180 seconds
|
|
108
|
+
**The local LLM excels at:** explaining code, finding common bugs, suggesting improvements, comparing patterns, generating boilerplate.
|
|
223
109
|
|
|
224
|
-
**
|
|
225
|
-
- Use faster models (13B vs 33B) for quicker responses
|
|
226
|
-
- Enable GPU acceleration in LM Studio for better performance
|
|
227
|
-
- Consider using `analysisDepth="basic"` for faster results when appropriate
|
|
110
|
+
**It struggles with:** subtle/adversarial bugs, multi-file reasoning, design tasks requiring integration.
|
|
228
111
|
|
|
229
|
-
###
|
|
112
|
+
### `list_models`
|
|
230
113
|
|
|
231
|
-
|
|
232
|
-
**Resource Management**: Automatic cleanup of large contexts after processing
|
|
233
|
-
**Streaming Responses**: Progressive output delivery for better user experience
|
|
114
|
+
Returns the models currently loaded on the LLM server.
|
|
234
115
|
|
|
235
|
-
|
|
116
|
+
### `health_check`
|
|
236
117
|
|
|
237
|
-
|
|
118
|
+
Checks connectivity. Returns response time, auth status, and loaded model count.
|
|
238
119
|
|
|
239
|
-
|
|
240
|
-
- [Analysis Functions Guide](docs/analysis-functions-md.md) - All 17 analysis tools
|
|
241
|
-
- [Generation Functions Guide](docs/generation-functions-md.md) - All 10 creation tools
|
|
242
|
-
- [Creative Functions Guide](docs/creative-functions-md.md) - Games and art tools
|
|
243
|
-
- [System Functions Guide](docs/system-functions-md.md) - Utilities and diagnostics
|
|
244
|
-
- [Complete User Guide](docs/user-guide-md.md) - Comprehensive usage manual
|
|
120
|
+
## Performance guide
|
|
245
121
|
|
|
246
|
-
|
|
122
|
+
At typical local LLM speeds (~3-4 tokens/second on consumer hardware):
|
|
247
123
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
124
|
+
| max_tokens | Response time | Best for |
|
|
125
|
+
|------------|--------------|----------|
|
|
126
|
+
| 150 | ~45 seconds | Quick questions, classifications |
|
|
127
|
+
| 300 | ~100 seconds | Code explanations, summaries |
|
|
128
|
+
| 500 | ~170 seconds | Code review, generation |
|
|
253
129
|
|
|
254
|
-
|
|
255
|
-
- Use 13B+ parameter models for professional-quality results
|
|
256
|
-
- Configure `LLM_MCP_ALLOWED_DIRS` to include your project directories
|
|
257
|
-
- Install Desktop Commander MCP for complete file operation support
|
|
258
|
-
- Keep LM Studio running and model loaded for instant responses
|
|
130
|
+
Set `max_tokens` to match your expected output — lower values mean faster responses.
|
|
259
131
|
|
|
260
|
-
##
|
|
261
|
-
|
|
262
|
-
### Version 1.0.0 (Current)
|
|
263
|
-
- ✅ Complete function library (35+ functions)
|
|
264
|
-
- ✅ Professional documentation system
|
|
265
|
-
- ✅ WordPress-specific tools and auditing
|
|
266
|
-
- ✅ Creative project generators
|
|
267
|
-
- ✅ Comprehensive security analysis
|
|
268
|
-
- ✅ TypeScript conversion and test generation
|
|
269
|
-
- ✅ Cross-file integration analysis
|
|
270
|
-
|
|
271
|
-
## License
|
|
132
|
+
## Compatible endpoints
|
|
272
133
|
|
|
273
|
-
|
|
134
|
+
| Provider | URL | Notes |
|
|
135
|
+
|----------|-----|-------|
|
|
136
|
+
| [LM Studio](https://lmstudio.ai) | `http://localhost:1234` | Default, zero config |
|
|
137
|
+
| [Ollama](https://ollama.com) | `http://localhost:11434` | Use OpenAI-compatible mode |
|
|
138
|
+
| [vLLM](https://docs.vllm.ai) | `http://localhost:8000` | Native OpenAI API |
|
|
139
|
+
| [llama.cpp](https://github.com/ggml-org/llama.cpp) | `http://localhost:8080` | Server mode |
|
|
140
|
+
| Remote / cloud APIs | Any URL | Set `LM_STUDIO_URL` + `LM_STUDIO_PASSWORD` |
|
|
274
141
|
|
|
275
|
-
##
|
|
142
|
+
## Development
|
|
276
143
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
## Support
|
|
144
|
+
```bash
|
|
145
|
+
git clone https://github.com/houtini-ai/lm.git
|
|
146
|
+
cd lm
|
|
147
|
+
npm install
|
|
148
|
+
npm run build
|
|
149
|
+
```
|
|
284
150
|
|
|
285
|
-
|
|
286
|
-
- **Discussions**: [GitHub Discussions](https://github.com/houtini-ai/lm/discussions)
|
|
287
|
-
- **Documentation**: Complete guides in the `docs/` directory
|
|
151
|
+
Run the test suite against a live LLM server:
|
|
288
152
|
|
|
289
|
-
|
|
153
|
+
```bash
|
|
154
|
+
node test.mjs
|
|
155
|
+
```
|
|
290
156
|
|
|
291
|
-
|
|
157
|
+
## License
|
|
292
158
|
|
|
293
|
-
|
|
159
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -8,10 +8,17 @@
|
|
|
8
8
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
9
9
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
10
10
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
11
|
-
const LM_BASE_URL = process.env.LM_STUDIO_URL || 'http://
|
|
11
|
+
const LM_BASE_URL = process.env.LM_STUDIO_URL || 'http://localhost:1234';
|
|
12
12
|
const LM_MODEL = process.env.LM_STUDIO_MODEL || '';
|
|
13
|
+
const LM_PASSWORD = process.env.LM_STUDIO_PASSWORD || '';
|
|
13
14
|
const DEFAULT_MAX_TOKENS = 4096;
|
|
14
15
|
const DEFAULT_TEMPERATURE = 0.3;
|
|
16
|
+
function apiHeaders() {
|
|
17
|
+
const h = { 'Content-Type': 'application/json' };
|
|
18
|
+
if (LM_PASSWORD)
|
|
19
|
+
h['Authorization'] = `Bearer ${LM_PASSWORD}`;
|
|
20
|
+
return h;
|
|
21
|
+
}
|
|
15
22
|
async function chatCompletion(messages, options = {}) {
|
|
16
23
|
const body = {
|
|
17
24
|
messages,
|
|
@@ -24,7 +31,7 @@ async function chatCompletion(messages, options = {}) {
|
|
|
24
31
|
}
|
|
25
32
|
const res = await fetch(`${LM_BASE_URL}/v1/chat/completions`, {
|
|
26
33
|
method: 'POST',
|
|
27
|
-
headers:
|
|
34
|
+
headers: apiHeaders(),
|
|
28
35
|
body: JSON.stringify(body),
|
|
29
36
|
});
|
|
30
37
|
if (!res.ok) {
|
|
@@ -34,7 +41,7 @@ async function chatCompletion(messages, options = {}) {
|
|
|
34
41
|
return res.json();
|
|
35
42
|
}
|
|
36
43
|
async function listModels() {
|
|
37
|
-
const res = await fetch(`${LM_BASE_URL}/v1/models
|
|
44
|
+
const res = await fetch(`${LM_BASE_URL}/v1/models`, { headers: apiHeaders() });
|
|
38
45
|
if (!res.ok)
|
|
39
46
|
throw new Error(`Failed to list models: ${res.status}`);
|
|
40
47
|
const data = (await res.json());
|
|
@@ -44,46 +51,77 @@ async function listModels() {
|
|
|
44
51
|
const TOOLS = [
|
|
45
52
|
{
|
|
46
53
|
name: 'chat',
|
|
47
|
-
description: '
|
|
54
|
+
description: 'Delegate a bounded task to the local LLM (Qwen3-Coder, ~3-4 tok/s). ' +
|
|
55
|
+
'Best for: quick code explanation, pattern recognition, boilerplate generation, knowledge questions. ' +
|
|
56
|
+
'Use when you can work in parallel — fire this off and continue your own work. ' +
|
|
57
|
+
'RULES: (1) Always send COMPLETE code, never truncated — the local LLM WILL hallucinate details for missing code. ' +
|
|
58
|
+
'(2) Set max_tokens to match expected output: 150 for quick answers (~45s), 300 for explanations (~100s), 500 for code generation (~170s). ' +
|
|
59
|
+
'(3) Be explicit about output format in your message ("respond in 3 bullets", "return only the function"). ' +
|
|
60
|
+
'DO NOT use for: multi-step reasoning, creative writing, tasks needing >500 token output, or anything requiring tool use (use lm-taskrunner for tool-augmented tasks via mcpo).',
|
|
48
61
|
inputSchema: {
|
|
49
62
|
type: 'object',
|
|
50
63
|
properties: {
|
|
51
|
-
message: { type: 'string', description: '
|
|
52
|
-
system: { type: 'string', description: '
|
|
53
|
-
temperature: { type: 'number', description: '
|
|
54
|
-
max_tokens: { type: 'number', description: '
|
|
64
|
+
message: { type: 'string', description: 'The task. Be specific about expected output format and length. Include COMPLETE code — never truncate.' },
|
|
65
|
+
system: { type: 'string', description: 'Persona for the local LLM. Be specific: "Senior TypeScript dev" not "helpful assistant". Short personas (under 30 words) get best results.' },
|
|
66
|
+
temperature: { type: 'number', description: '0.1 for factual/code tasks, 0.3 for analysis (default), 0.7 for creative suggestions. Stay under 0.5 for code.' },
|
|
67
|
+
max_tokens: { type: 'number', description: 'Cap this to match expected output. 150=quick answer, 300=explanation, 500=code generation. Lower = faster. Default 4096 is almost always too high.' },
|
|
55
68
|
},
|
|
56
69
|
required: ['message'],
|
|
57
70
|
},
|
|
58
71
|
},
|
|
59
72
|
{
|
|
60
73
|
name: 'custom_prompt',
|
|
61
|
-
description: '
|
|
74
|
+
description: 'Structured analysis on the local LLM with explicit system/context/instruction separation. ' +
|
|
75
|
+
'This 3-part format gets the best results from local models — the separation prevents context bleed. ' +
|
|
76
|
+
'System sets persona (be specific: "Senior TypeScript dev reviewing for security bugs"). ' +
|
|
77
|
+
'Context provides COMPLETE data (full source file, full error log — never truncated). ' +
|
|
78
|
+
'Instruction states exactly what to produce (under 50 words for best results). ' +
|
|
79
|
+
'Best for: code review, comparison, refactoring suggestions, structured analysis. ' +
|
|
80
|
+
'Expect 30-180s response time depending on max_tokens.',
|
|
62
81
|
inputSchema: {
|
|
63
82
|
type: 'object',
|
|
64
83
|
properties: {
|
|
65
|
-
system: { type: 'string', description: '
|
|
66
|
-
context: { type: 'string', description: '
|
|
67
|
-
instruction: { type: 'string', description: 'What to
|
|
68
|
-
temperature: { type: 'number', description: '
|
|
69
|
-
max_tokens: { type: 'number', description: '
|
|
84
|
+
system: { type: 'string', description: 'Persona. Be specific and under 30 words. Example: "Expert Node.js developer focused on error handling and edge cases."' },
|
|
85
|
+
context: { type: 'string', description: 'The COMPLETE data to analyse. Full source code, full logs, full text. NEVER truncate — the local LLM fills gaps with plausible hallucinations.' },
|
|
86
|
+
instruction: { type: 'string', description: 'What to produce. Under 50 words. Specify format: "List 3 bugs as bullet points" or "Return a JSON array of {line, issue, fix}".' },
|
|
87
|
+
temperature: { type: 'number', description: '0.1 for bugs/review, 0.3 for analysis (default), 0.5 for suggestions.' },
|
|
88
|
+
max_tokens: { type: 'number', description: 'Match to expected output. 200 for bullets, 400 for detailed review, 600 for code generation.' },
|
|
70
89
|
},
|
|
71
90
|
required: ['instruction'],
|
|
72
91
|
},
|
|
73
92
|
},
|
|
93
|
+
{
|
|
94
|
+
name: 'code_task',
|
|
95
|
+
description: 'Purpose-built for code analysis tasks. Wraps the local LLM with an optimised code-review system prompt. ' +
|
|
96
|
+
'Provide COMPLETE source code and a specific task — returns analysis in ~30-180s. ' +
|
|
97
|
+
'Ideal for parallel execution: delegate to local LLM while you handle other work. ' +
|
|
98
|
+
'The local LLM excels at: explaining code, finding common bugs, suggesting improvements, comparing patterns, generating boilerplate. ' +
|
|
99
|
+
'It struggles with: subtle/adversarial bugs, multi-file reasoning, design tasks requiring integration. ' +
|
|
100
|
+
'Output capped at 500 tokens by default (override with max_tokens).',
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
code: { type: 'string', description: 'COMPLETE source code. Never truncate. Include imports and full function bodies.' },
|
|
105
|
+
task: { type: 'string', description: 'What to do. Be specific and concise: "Find bugs", "Explain this function", "Add error handling to fetchData", "Compare these two approaches".' },
|
|
106
|
+
language: { type: 'string', description: 'Programming language for context: "typescript", "python", "rust", etc.' },
|
|
107
|
+
max_tokens: { type: 'number', description: 'Expected output size. Default 500. Use 200 for quick answers, 800 for code generation.' },
|
|
108
|
+
},
|
|
109
|
+
required: ['code', 'task'],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
74
112
|
{
|
|
75
113
|
name: 'list_models',
|
|
76
|
-
description: 'List models currently loaded in LM Studio.',
|
|
114
|
+
description: 'List models currently loaded in LM Studio. Use to verify which model will handle delegated tasks.',
|
|
77
115
|
inputSchema: { type: 'object', properties: {} },
|
|
78
116
|
},
|
|
79
117
|
{
|
|
80
118
|
name: 'health_check',
|
|
81
|
-
description: 'Check connectivity to the local LM Studio instance.',
|
|
119
|
+
description: 'Check connectivity and latency to the local LM Studio instance. Run before delegating time-sensitive tasks.',
|
|
82
120
|
inputSchema: { type: 'object', properties: {} },
|
|
83
121
|
},
|
|
84
122
|
];
|
|
85
123
|
// ── MCP Server ───────────────────────────────────────────────────────
|
|
86
|
-
const server = new Server({ name: 'houtini-lm', version: '2.
|
|
124
|
+
const server = new Server({ name: 'houtini-lm', version: '2.1.0' }, { capabilities: { tools: {} } });
|
|
87
125
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
88
126
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
89
127
|
const { name, arguments: args } = request.params;
|
|
@@ -122,6 +160,29 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
122
160
|
content: [{ type: 'text', text: resp.choices[0]?.message?.content ?? '' }],
|
|
123
161
|
};
|
|
124
162
|
}
|
|
163
|
+
case 'code_task': {
|
|
164
|
+
const { code, task, language, max_tokens: codeMaxTokens } = args;
|
|
165
|
+
const lang = language || 'unknown';
|
|
166
|
+
const codeMessages = [
|
|
167
|
+
{
|
|
168
|
+
role: 'system',
|
|
169
|
+
content: `Expert ${lang} developer. Analyse the provided code and complete the task. Be specific — reference line numbers, function names, and concrete fixes. No preamble.`,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
role: 'user',
|
|
173
|
+
content: `Task: ${task}\n\n\`\`\`${lang}\n${code}\n\`\`\``,
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
const codeResp = await chatCompletion(codeMessages, {
|
|
177
|
+
temperature: 0.2,
|
|
178
|
+
maxTokens: codeMaxTokens ?? 500,
|
|
179
|
+
});
|
|
180
|
+
const codeReply = codeResp.choices[0]?.message?.content ?? '';
|
|
181
|
+
const codeUsage = codeResp.usage
|
|
182
|
+
? `\n\n---\nModel: ${codeResp.model} | Tokens: ${codeResp.usage.prompt_tokens}→${codeResp.usage.completion_tokens} | ${lang}`
|
|
183
|
+
: '';
|
|
184
|
+
return { content: [{ type: 'text', text: codeReply + codeUsage }] };
|
|
185
|
+
}
|
|
125
186
|
case 'list_models': {
|
|
126
187
|
const models = await listModels();
|
|
127
188
|
return {
|
|
@@ -143,7 +204,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
143
204
|
content: [
|
|
144
205
|
{
|
|
145
206
|
type: 'text',
|
|
146
|
-
text: `Connected to ${LM_BASE_URL} (${ms}ms)\nModels loaded: ${models.length}${models.length ? '\n' + models.join(', ') : ''}`,
|
|
207
|
+
text: `Connected to ${LM_BASE_URL} (${ms}ms)\nAuth: ${LM_PASSWORD ? 'enabled' : 'none'}\nModels loaded: ${models.length}${models.length ? '\n' + models.join(', ') : ''}`,
|
|
147
208
|
},
|
|
148
209
|
],
|
|
149
210
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;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G,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,WAAW,KAAK,CAAC,CAAC;AACvE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@houtini/lm",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server for local LLMs — connects to LM Studio or any OpenAI-compatible endpoint",
|
|
6
|
+
"mcpName": "io.github.houtini-ai/lm",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"bin": {
|
|
8
9
|
"houtini-lm": "dist/index.js"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
12
|
"build": "tsc && node add-shebang.mjs",
|
|
12
|
-
"dev": "tsc --watch"
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
13
15
|
},
|
|
14
16
|
"keywords": [
|
|
15
17
|
"mcp",
|
|
16
18
|
"model-context-protocol",
|
|
19
|
+
"mcp-server",
|
|
17
20
|
"lm-studio",
|
|
21
|
+
"ollama",
|
|
22
|
+
"vllm",
|
|
18
23
|
"openai",
|
|
24
|
+
"openai-compatible",
|
|
19
25
|
"local-llm",
|
|
20
26
|
"claude",
|
|
21
|
-
"ai-tools"
|
|
27
|
+
"ai-tools",
|
|
28
|
+
"llama-cpp",
|
|
29
|
+
"ai",
|
|
30
|
+
"llm"
|
|
22
31
|
],
|
|
23
32
|
"author": "Richard Baxter <richard@richardbaxter.co> (https://richardbaxter.co)",
|
|
24
33
|
"license": "MIT",
|
|
@@ -30,6 +39,10 @@
|
|
|
30
39
|
"bugs": {
|
|
31
40
|
"url": "https://github.com/houtini-ai/lm/issues"
|
|
32
41
|
},
|
|
42
|
+
"funding": {
|
|
43
|
+
"type": "github",
|
|
44
|
+
"url": "https://github.com/sponsors/houtini-ai"
|
|
45
|
+
},
|
|
33
46
|
"dependencies": {
|
|
34
47
|
"@modelcontextprotocol/sdk": "^1.26.0"
|
|
35
48
|
},
|
|
@@ -42,6 +55,7 @@
|
|
|
42
55
|
},
|
|
43
56
|
"files": [
|
|
44
57
|
"dist/**/*",
|
|
58
|
+
"server.json",
|
|
45
59
|
"README.md",
|
|
46
60
|
"LICENSE"
|
|
47
61
|
],
|
package/server.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "Houtini LM",
|
|
4
|
+
"description": "MCP server that connects Claude to any OpenAI-compatible LLM endpoint. Offload routine analysis to a local model and preserve your Claude context window.",
|
|
5
|
+
"icon": "https://houtini.ai/favicon.ico",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "https://github.com/houtini-ai/lm",
|
|
8
|
+
"source": "github"
|
|
9
|
+
},
|
|
10
|
+
"version": "2.0.1",
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registryType": "npm",
|
|
14
|
+
"identifier": "@houtini/lm",
|
|
15
|
+
"version": "2.0.1",
|
|
16
|
+
"transport": [
|
|
17
|
+
{
|
|
18
|
+
"type": "stdio"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"environmentVariables": [
|
|
22
|
+
{
|
|
23
|
+
"name": "LM_STUDIO_URL",
|
|
24
|
+
"description": "Base URL of the OpenAI-compatible API endpoint",
|
|
25
|
+
"isRequired": false,
|
|
26
|
+
"format": "url"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "LM_STUDIO_MODEL",
|
|
30
|
+
"description": "Model identifier to use for requests (auto-detected if not set)",
|
|
31
|
+
"isRequired": false,
|
|
32
|
+
"format": "string"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "LM_STUDIO_PASSWORD",
|
|
36
|
+
"description": "Bearer token for API authentication (no auth if blank)",
|
|
37
|
+
"isRequired": false,
|
|
38
|
+
"isSecret": true,
|
|
39
|
+
"format": "string"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|