mcp-hydrocoder-vision 0.1.6 → 0.3.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/INSTALL_.md +71 -0
- package/{INSTALL.md → INSTALL_CN.md} +10 -6
- package/README.md +16 -6
- package/README_CN.md +16 -6
- package/package.json +3 -2
- package/src/index.ts +5 -4
package/INSTALL_.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Installation Guide
|
|
2
|
+
|
|
3
|
+
[中文版](./INSTALL_CN.md) | [English README](./README.md) | [中文 README](./README_CN.md)
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js 18+ installed
|
|
8
|
+
- LM Studio installed and running
|
|
9
|
+
|
|
10
|
+
## Installation Steps
|
|
11
|
+
|
|
12
|
+
### 1. Globally Install MCP Package
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g mcp-hydrocoder-vision
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### 2. Configure Claude
|
|
19
|
+
|
|
20
|
+
Edit the `~/.claude.json` file in your user directory and add the following configuration:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"hydrocoder-vision": {
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": ["-y", "mcp-hydrocoder-vision"],
|
|
28
|
+
"env": {
|
|
29
|
+
"LM_STUDIO_URL": "http://localhost:1234/v1/chat/completions",
|
|
30
|
+
"VISION_MODEL": "Qwen3-VL-4B-Instruct"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Authorize Tool Permissions
|
|
38
|
+
|
|
39
|
+
Add the following configuration to `~/.claude/settings.json` to avoid manual confirmation for each tool use:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"permissions": {
|
|
44
|
+
"allow": [
|
|
45
|
+
"mcp__mcp-hydrocoder-vision__analyzeImage",
|
|
46
|
+
"mcp__mcp-hydrocoder-vision__extractText",
|
|
47
|
+
"mcp__mcp-hydrocoder-vision__describeForCode"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 4. Start LM Studio
|
|
54
|
+
|
|
55
|
+
1. Open LM Studio
|
|
56
|
+
2. Download and load the `Qwen3-VL-4B-Instruct` model
|
|
57
|
+
3. Start the local server (default port: 1234)
|
|
58
|
+
|
|
59
|
+
### 5. Verify Installation
|
|
60
|
+
|
|
61
|
+
Paste a screenshot into the Claude Code window, type text like "recognize image", and the MCP will be automatically invoked to recognize the content.
|
|
62
|
+
|
|
63
|
+
## Troubleshooting
|
|
64
|
+
|
|
65
|
+
### Connection Failed
|
|
66
|
+
|
|
67
|
+
Ensure LM Studio is running and the local server is started. Check if the `LM_STUDIO_URL` environment variable is correct.
|
|
68
|
+
|
|
69
|
+
### No Model Response
|
|
70
|
+
|
|
71
|
+
Ensure the Qwen3-VL-4B-Instruct model is loaded in LM Studio.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 安装说明
|
|
2
2
|
|
|
3
|
+
[English Version](./INSTALL_.md) | [英文 README](./README.md) | [中文 README](./README_CN.md)
|
|
4
|
+
|
|
3
5
|
## 前置要求
|
|
4
6
|
|
|
5
7
|
- Node.js 18+ 已安装
|
|
@@ -32,16 +34,18 @@ npm install -g mcp-hydrocoder-vision
|
|
|
32
34
|
}
|
|
33
35
|
```
|
|
34
36
|
|
|
35
|
-
### 3.
|
|
37
|
+
### 3. 授权工具权限
|
|
36
38
|
|
|
37
39
|
在 `~/.claude/settings.json` 中添加以下配置,可避免每次使用工具时手动确认:
|
|
38
40
|
|
|
39
41
|
```json
|
|
40
42
|
{
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
43
|
+
"permissions": {
|
|
44
|
+
"allow": [
|
|
45
|
+
"mcp__mcp-hydrocoder-vision__analyzeImage",
|
|
46
|
+
"mcp__mcp-hydrocoder-vision__extractText",
|
|
47
|
+
"mcp__mcp-hydrocoder-vision__describeForCode"
|
|
48
|
+
]
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
```
|
|
@@ -54,7 +58,7 @@ npm install -g mcp-hydrocoder-vision
|
|
|
54
58
|
|
|
55
59
|
### 5. 验证安装
|
|
56
60
|
|
|
57
|
-
在 Claude
|
|
61
|
+
在 Claude Code 窗口中贴入一张截图,输入"识别图像"等一类的文字,会自动调用 MCP 识别内容。
|
|
58
62
|
|
|
59
63
|
## 常见问题
|
|
60
64
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# MCP HydroCoder Vision
|
|
2
2
|
|
|
3
|
+
[English Installation](./INSTALL_.md) | [中文安装](./INSTALL_CN.md) | [中文 README](./README_CN.md)
|
|
4
|
+
|
|
3
5
|
A vision-language MCP server that enables Claude Code to analyze images using **Qwen3 VL 4B** model running locally via LM Studio.
|
|
4
6
|
|
|
5
7
|
## Features
|
|
@@ -18,14 +20,22 @@ A vision-language MCP server that enables Claude Code to analyze images using **
|
|
|
18
20
|
|
|
19
21
|
## Installation
|
|
20
22
|
|
|
23
|
+
### 1. Clone the repository
|
|
24
|
+
|
|
21
25
|
```bash
|
|
22
|
-
|
|
23
|
-
cd
|
|
26
|
+
git clone https://github.com/hydroCoderClaud/mcp-hydrocoder-vision.git
|
|
27
|
+
cd mcp-hydrocoder-vision
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Install dependencies
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
```bash
|
|
26
33
|
npm install
|
|
34
|
+
```
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
### 3. Build the project
|
|
37
|
+
|
|
38
|
+
```bash
|
|
29
39
|
npm run build
|
|
30
40
|
```
|
|
31
41
|
|
|
@@ -45,8 +55,8 @@ Add to your `~/.claude/settings.json`:
|
|
|
45
55
|
{
|
|
46
56
|
"mcpServers": {
|
|
47
57
|
"hydrocoder-vision": {
|
|
48
|
-
"command": "
|
|
49
|
-
"args": ["
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "mcp-hydrocoder-vision"],
|
|
50
60
|
"env": {
|
|
51
61
|
"LM_STUDIO_URL": "http://localhost:1234/v1/chat/completions",
|
|
52
62
|
"VISION_MODEL": "Qwen3-VL-4B-Instruct"
|
package/README_CN.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# MCP HydroCoder Vision
|
|
2
2
|
|
|
3
|
+
[English Installation](./INSTALL_.md) | [中文安装](./INSTALL_CN.md) | [English README](./README.md)
|
|
4
|
+
|
|
3
5
|
基于 **Qwen3 VL 4B** 模型的本地视觉语言 MCP 服务器,让 Claude Code 能够识别和分析图像。
|
|
4
6
|
|
|
5
7
|
## 功能特性
|
|
@@ -18,14 +20,22 @@
|
|
|
18
20
|
|
|
19
21
|
## 安装步骤
|
|
20
22
|
|
|
23
|
+
### 1. 克隆仓库
|
|
24
|
+
|
|
21
25
|
```bash
|
|
22
|
-
|
|
23
|
-
cd
|
|
26
|
+
git clone https://github.com/hydroCoderClaud/mcp-hydrocoder-vision.git
|
|
27
|
+
cd mcp-hydrocoder-vision
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. 安装依赖
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
```bash
|
|
26
33
|
npm install
|
|
34
|
+
```
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
### 3. 构建项目
|
|
37
|
+
|
|
38
|
+
```bash
|
|
29
39
|
npm run build
|
|
30
40
|
```
|
|
31
41
|
|
|
@@ -45,8 +55,8 @@ npm run build
|
|
|
45
55
|
{
|
|
46
56
|
"mcpServers": {
|
|
47
57
|
"hydrocoder-vision": {
|
|
48
|
-
"command": "
|
|
49
|
-
"args": ["
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "mcp-hydrocoder-vision"],
|
|
50
60
|
"env": {
|
|
51
61
|
"LM_STUDIO_URL": "http://localhost:1234/v1/chat/completions",
|
|
52
62
|
"VISION_MODEL": "Qwen3-VL-4B-Instruct"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-hydrocoder-vision",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Vision MCP Server for Claude Code - Qwen3 VL 4B integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"src/",
|
|
12
12
|
"README.md",
|
|
13
13
|
"README_CN.md",
|
|
14
|
-
"
|
|
14
|
+
"INSTALL_.md",
|
|
15
|
+
"INSTALL_CN.md",
|
|
15
16
|
"LICENSE"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
package/src/index.ts
CHANGED
|
@@ -160,7 +160,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
160
160
|
const validated = AnalyzeImageInputSchema.parse(args);
|
|
161
161
|
const mimeType = getMimeType(validated.imagePath);
|
|
162
162
|
const imageData = await fileToBase64(validated.imagePath);
|
|
163
|
-
const prompt = validated.prompt ||
|
|
163
|
+
const prompt = validated.prompt ||
|
|
164
|
+
'Describe all visible elements concisely. Use factual, structured language. Include colors, sizes, positions, and relationships between elements. No fluff. Assume the image is a static screenshot or photograph.';
|
|
164
165
|
|
|
165
166
|
const result = await analyzeImageWithLMStudio(imageData, mimeType, prompt);
|
|
166
167
|
return {
|
|
@@ -173,8 +174,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
173
174
|
const mimeType = getMimeType(validated.imagePath);
|
|
174
175
|
const imageData = await fileToBase64(validated.imagePath);
|
|
175
176
|
const prompt = validated.language
|
|
176
|
-
? `Extract
|
|
177
|
-
:
|
|
177
|
+
? `Extract ALL visible text in ${validated.language}. Output only the text, no commentary. Return text in the order it appears.`
|
|
178
|
+
: `Extract ALL visible text. Output only the text, no commentary. Return text in the order it appears.`;
|
|
178
179
|
|
|
179
180
|
const result = await analyzeImageWithLMStudio(imageData, mimeType, prompt);
|
|
180
181
|
return {
|
|
@@ -187,7 +188,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
187
188
|
const mimeType = getMimeType(validated.imagePath);
|
|
188
189
|
const imageData = await fileToBase64(validated.imagePath);
|
|
189
190
|
const framework = validated.framework || 'HTML/CSS/JavaScript';
|
|
190
|
-
const prompt = `
|
|
191
|
+
const prompt = `Generate ${framework} code matching this design. Include all clickable elements, form submissions, state changes, and dynamic interactions. Use standard practices. Keep code readable and maintainable. Omit unnecessary comments. Do not output code for unsupported frameworks. Output only the code.`;
|
|
191
192
|
|
|
192
193
|
const result = await analyzeImageWithLMStudio(imageData, mimeType, prompt);
|
|
193
194
|
return {
|