auto-skill-loader 1.0.0__tar.gz
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.
- auto_skill_loader-1.0.0/LICENSE +21 -0
- auto_skill_loader-1.0.0/PKG-INFO +275 -0
- auto_skill_loader-1.0.0/README.md +248 -0
- auto_skill_loader-1.0.0/pyproject.toml +46 -0
- auto_skill_loader-1.0.0/setup.cfg +4 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader/__init__.py +1 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader/server.py +698 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader.egg-info/PKG-INFO +275 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader.egg-info/SOURCES.txt +12 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader.egg-info/dependency_links.txt +1 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader.egg-info/entry_points.txt +2 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader.egg-info/requires.txt +6 -0
- auto_skill_loader-1.0.0/src/auto_skill_loader.egg-info/top_level.txt +1 -0
- auto_skill_loader-1.0.0/tests/test_server.py +179 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Divit Kashyap
|
|
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,275 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: auto-skill-loader
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MCP server that auto-loads approved skills into agent sessions and provides MiniMax vision + search proxy tools
|
|
5
|
+
Author: divitkashyap
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: mcp,model-context-protocol,skills,auto-load,minimax,vision,ai
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Framework :: AsyncIO
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: mcp>=0.9.0
|
|
22
|
+
Requires-Dist: pyyaml>=6.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# auto-skill-loader
|
|
29
|
+
|
|
30
|
+
**Give your AI agent a persistent skill library it auto-loads at session start.**
|
|
31
|
+
|
|
32
|
+
auto-skill-loader is an MCP server that exposes your pre-approved skills via a `skills://active` resource. Instead of manually invoking skills or relying on fuzzy pattern matching, your agent reads this resource at session startup and automatically has all your approved skills in context.
|
|
33
|
+
|
|
34
|
+
## How it works
|
|
35
|
+
|
|
36
|
+
1. **You configure** which skills to auto-load in `~/.config/auto-skill-loader/config.yaml`
|
|
37
|
+
2. **The MCP server** reads skill files from your skills directory and exposes them via `skills://active`
|
|
38
|
+
3. **At session start** your agent reads `skills://active` and gets all approved skills auto-injected
|
|
39
|
+
4. **No explicit triggers needed** — the agent already knows your skills
|
|
40
|
+
|
|
41
|
+
## Why
|
|
42
|
+
|
|
43
|
+
Most skill systems require the agent to:
|
|
44
|
+
- Explicitly call a `use_skill` tool, or
|
|
45
|
+
- Guess based on conversation patterns (unreliable)
|
|
46
|
+
|
|
47
|
+
auto-skill-loader solves this by using the MCP **resource at session init** pattern — deterministic, no guessing.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
### Option 1: uvx (recommended — no install needed)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uvx auto-skill-loader
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Option 2: pip
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install auto-skill-loader
|
|
61
|
+
auto-skill-loader
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Option 3: Build from source
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
git clone https://github.com/divitkashyap/auto-skill-loader.git
|
|
68
|
+
cd auto-skill-loader
|
|
69
|
+
pip install -e .
|
|
70
|
+
auto-skill-loader
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Configuration
|
|
74
|
+
|
|
75
|
+
### OpenCode
|
|
76
|
+
|
|
77
|
+
Add to `~/.config/opencode/opencode.json`:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"mcp": {
|
|
82
|
+
"auto-skill-loader": {
|
|
83
|
+
"type": "local",
|
|
84
|
+
"command": ["uvx", "auto-skill-loader"],
|
|
85
|
+
"enabled": true
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Claude Code
|
|
92
|
+
|
|
93
|
+
**Note:** Claude Code requires a specific JSON format via `add-json`:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
claude mcp add-json -s user auto-skill-loader '{"type":"stdio","command":"/FULL/PATH/TO/python","args":["-m","server"],"env":{"MINIMAX_TOKEN_PLAN_KEY":"sk-cp-YOUR-KEY-HERE"}}'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Replace `/FULL/PATH/TO/python` with the path to your Python (e.g. `/Users/YOU/auto-skill-loader/.venv/bin/python`).
|
|
100
|
+
|
|
101
|
+
Or for uvx (requires network on first run):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
claude mcp add -s user --transport stdio -e MINIMAX_TOKEN_PLAN_KEY=sk-cp-YOUR-KEY auto-skill-loader -- uvx auto-skill-loader
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Tested On
|
|
108
|
+
|
|
109
|
+
| Host | Status | Verified |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| Claude Code (macOS) | ✅ Working | Vision tool + skill loading + MiniMax-M2.7 model |
|
|
112
|
+
| OpenCode (macOS) | ✅ Working | Vision tool + skill loading + MiniMax Token Plan |
|
|
113
|
+
|
|
114
|
+
Other MCP-compatible hosts (Cursor, Zed, etc.) should work with the same configuration — contributions welcome.
|
|
115
|
+
|
|
116
|
+
## Platform Differences & Known Issues
|
|
117
|
+
|
|
118
|
+
### Image Input: OpenCode vs Claude Code
|
|
119
|
+
|
|
120
|
+
Both hosts work with `auto-skill-loader` vision tools, but image input behaves differently:
|
|
121
|
+
|
|
122
|
+
| Host | How images are passed | Recommended workflow |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| **Claude Code** | Images uploaded to URL automatically → tool receives URL | Paste image directly ✅ works |
|
|
125
|
+
| **OpenCode** | Inline images render visually but may not give tools a real path | Give a file path instead of pasting |
|
|
126
|
+
|
|
127
|
+
**OpenCode note:** When you paste an image in OpenCode, it may render inline but the agent sees it as a filename string (e.g. `logo.png`) rather than a real filesystem path. This is a known OpenCode rendering behavior.
|
|
128
|
+
|
|
129
|
+
**Workaround for OpenCode:** Instead of pasting, give the agent the actual file path:
|
|
130
|
+
```
|
|
131
|
+
analyze this image: /path/to/your/image.png
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The agent can access local files directly in OpenCode. If the image is only in your clipboard, the agent can extract it to `/tmp/` first.
|
|
135
|
+
|
|
136
|
+
### What We're Monitoring
|
|
137
|
+
|
|
138
|
+
We actively track the following OpenCode issues:
|
|
139
|
+
- Inline image rendering (images pasted don't expose real paths to tools)
|
|
140
|
+
- MCP stdio transport for local servers (our proxy tools work around this)
|
|
141
|
+
- Session persistence of skills across restarts
|
|
142
|
+
|
|
143
|
+
If OpenCode releases a fix for inline image paths, this documentation will be updated.
|
|
144
|
+
|
|
145
|
+
### Other Known Issues
|
|
146
|
+
|
|
147
|
+
| Issue | Severity | Workaround |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| OpenCode inline images show as filename, not path | Medium — affects paste workflow | Use file paths instead |
|
|
150
|
+
| Claude Code auth conflict (ANTHROPIC_AUTH_TOKEN vs managed key) | Low — cosmetic warning | Harmless, can be ignored |
|
|
151
|
+
| First vision call may take 3-5s (uvx download) | Low — one-time | Subsequent calls are ~200ms |
|
|
152
|
+
|
|
153
|
+
## Setup
|
|
154
|
+
|
|
155
|
+
1. Create skills directory (symlink to your existing skills):
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
mkdir -p ~/.config/auto-skill-loader
|
|
159
|
+
ln -sf ~/.config/opencode/skills ~/.config/auto-skill-loader/skills
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
2. Edit `~/.config/auto-skill-loader/config.yaml`:
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
active_skills:
|
|
166
|
+
- vision-analysis
|
|
167
|
+
- context-maintainer
|
|
168
|
+
- markdown-mcp
|
|
169
|
+
skills_dir: ~/.config/auto-skill-loader/skills
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
3. Restart your agent. It will now auto-load all listed skills at session start.
|
|
173
|
+
|
|
174
|
+
## Tools
|
|
175
|
+
|
|
176
|
+
| Tool | What it does |
|
|
177
|
+
|---|---|
|
|
178
|
+
| `list_skills` | List all available skills in skills_dir with descriptions |
|
|
179
|
+
| `activate_skill` | Add a skill to your approved list (persists to config.yaml) |
|
|
180
|
+
| `deactivate_skill` | Remove a skill from your approved list |
|
|
181
|
+
| `get_skill_info` | Get details about a specific skill |
|
|
182
|
+
| `get_active_skills` | List currently active skill names |
|
|
183
|
+
| `suggest_skills` | If no skills are active, suggests common ones to get started |
|
|
184
|
+
| `check_prerequisites` | Validate a skill's dependencies (MCP tools, API keys, env vars) |
|
|
185
|
+
|
|
186
|
+
## Bonus: MiniMax Vision & Web Search Proxy
|
|
187
|
+
|
|
188
|
+
auto-skill-loader also exposes two tools that proxy to `minimax-coding-plan-mcp` with a **working stdio transport**:
|
|
189
|
+
|
|
190
|
+
| Tool | What it does |
|
|
191
|
+
|---|---|
|
|
192
|
+
| `minimax_understand_image` | Analyze images (JPEG, PNG, GIF, WebP up to 20MB) |
|
|
193
|
+
| `minimax_web_search` | Web search using MiniMax |
|
|
194
|
+
|
|
195
|
+
### The OpenCode MCP Bug
|
|
196
|
+
|
|
197
|
+
When OpenCode's built-in `minimax-coding-plan-mcp` MCP integration (`minimax-token-plan`) is configured, the `understand_image` tool fails with:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
API Error: login fail: Please carry the API secret key in the 'Authorization' field
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
This happens even when:
|
|
204
|
+
- ✅ `MINIMAX_API_KEY` / `MINIMAX_TOKEN_PLAN_KEY` is set correctly
|
|
205
|
+
- ✅ API key is valid (same key works via direct API calls)
|
|
206
|
+
- ✅ Token Plan has available vision quota
|
|
207
|
+
|
|
208
|
+
**Root cause:** OpenCode's stdio transport for local MCP servers sends messages in a way that breaks the MCP protocol — likely batched writes without proper flush between JSON-RPC messages. Direct subprocess tests with sequential writes + flush() work fine.
|
|
209
|
+
|
|
210
|
+
**The fix:** Our proxy tools in auto-skill-loader use proper sequential stdio communication, bypassing OpenCode's broken transport layer.
|
|
211
|
+
|
|
212
|
+
### Setup
|
|
213
|
+
|
|
214
|
+
1. Set your MiniMax Token Plan key in `~/.config/opencode/.env`:
|
|
215
|
+
```bash
|
|
216
|
+
MINIMAX_TOKEN_PLAN_KEY=sk-cp-your-key-here
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
2. Add auto-skill-loader to `~/.config/opencode/opencode.json`:
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"mcp": {
|
|
223
|
+
"auto-skill-loader": {
|
|
224
|
+
"type": "local",
|
|
225
|
+
"command": ["/path/to/venv/bin/python", "-m", "server"],
|
|
226
|
+
"enabled": true
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
3. **Critical:** If you have `minimax-coding-plan-mcp` configured directly in opencode.json (the `minimax-token-plan` entry), **remove or disable it** — its broken stdio transport will cause "login fail" errors. The proxy tools in auto-skill-loader replace it entirely.
|
|
233
|
+
|
|
234
|
+
4. Restart OpenCode and verify: `/ask Do you have auto-skill-loader_minimax_understand_image available?`
|
|
235
|
+
|
|
236
|
+
### Diagnosis
|
|
237
|
+
|
|
238
|
+
If you see "login fail" errors after setup:
|
|
239
|
+
|
|
240
|
+
1. **Disable the broken minimax MCP** — ensure `"minimax-token-plan": { "enabled": false }` or remove it entirely
|
|
241
|
+
2. **Restart OpenCode completely** — MCP servers are re-spawned on each session
|
|
242
|
+
3. **Check with:** `/ask Call minimax_understand_image with image_source="/any/real/image.png" and prompt="test"`
|
|
243
|
+
|
|
244
|
+
## Resources
|
|
245
|
+
|
|
246
|
+
| Resource | What it does |
|
|
247
|
+
|---|---|
|
|
248
|
+
| `skills://active` | All approved skill contents concatenated — read by host at session init |
|
|
249
|
+
| `skills://config` | Your current config.yaml content |
|
|
250
|
+
|
|
251
|
+
## Security
|
|
252
|
+
|
|
253
|
+
- **User-controlled** — only skills in `config.yaml` are loaded
|
|
254
|
+
- **No network fetches** — everything is local
|
|
255
|
+
- **No prompt injection** — skills come from your own configured directory
|
|
256
|
+
|
|
257
|
+
## Repo Structure
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
auto-skill-loader/
|
|
261
|
+
├── src/
|
|
262
|
+
│ └── server.py # MCP server (Python stdlib + mcp package)
|
|
263
|
+
├── pyproject.toml # Package config
|
|
264
|
+
├── README.md # This file
|
|
265
|
+
├── SKILL.md # For agent onboarding
|
|
266
|
+
└── LICENSE # MIT
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Requirements
|
|
270
|
+
|
|
271
|
+
- Python 3.9+
|
|
272
|
+
- `mcp` package (`pip install mcp`)
|
|
273
|
+
- `pyyaml` package (`pip install pyyaml`)
|
|
274
|
+
|
|
275
|
+
Or just use `uvx auto-skill-loader` which fetches dependencies automatically.
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# auto-skill-loader
|
|
2
|
+
|
|
3
|
+
**Give your AI agent a persistent skill library it auto-loads at session start.**
|
|
4
|
+
|
|
5
|
+
auto-skill-loader is an MCP server that exposes your pre-approved skills via a `skills://active` resource. Instead of manually invoking skills or relying on fuzzy pattern matching, your agent reads this resource at session startup and automatically has all your approved skills in context.
|
|
6
|
+
|
|
7
|
+
## How it works
|
|
8
|
+
|
|
9
|
+
1. **You configure** which skills to auto-load in `~/.config/auto-skill-loader/config.yaml`
|
|
10
|
+
2. **The MCP server** reads skill files from your skills directory and exposes them via `skills://active`
|
|
11
|
+
3. **At session start** your agent reads `skills://active` and gets all approved skills auto-injected
|
|
12
|
+
4. **No explicit triggers needed** — the agent already knows your skills
|
|
13
|
+
|
|
14
|
+
## Why
|
|
15
|
+
|
|
16
|
+
Most skill systems require the agent to:
|
|
17
|
+
- Explicitly call a `use_skill` tool, or
|
|
18
|
+
- Guess based on conversation patterns (unreliable)
|
|
19
|
+
|
|
20
|
+
auto-skill-loader solves this by using the MCP **resource at session init** pattern — deterministic, no guessing.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
### Option 1: uvx (recommended — no install needed)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uvx auto-skill-loader
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Option 2: pip
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install auto-skill-loader
|
|
34
|
+
auto-skill-loader
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Option 3: Build from source
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/divitkashyap/auto-skill-loader.git
|
|
41
|
+
cd auto-skill-loader
|
|
42
|
+
pip install -e .
|
|
43
|
+
auto-skill-loader
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
### OpenCode
|
|
49
|
+
|
|
50
|
+
Add to `~/.config/opencode/opencode.json`:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcp": {
|
|
55
|
+
"auto-skill-loader": {
|
|
56
|
+
"type": "local",
|
|
57
|
+
"command": ["uvx", "auto-skill-loader"],
|
|
58
|
+
"enabled": true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Claude Code
|
|
65
|
+
|
|
66
|
+
**Note:** Claude Code requires a specific JSON format via `add-json`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
claude mcp add-json -s user auto-skill-loader '{"type":"stdio","command":"/FULL/PATH/TO/python","args":["-m","server"],"env":{"MINIMAX_TOKEN_PLAN_KEY":"sk-cp-YOUR-KEY-HERE"}}'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Replace `/FULL/PATH/TO/python` with the path to your Python (e.g. `/Users/YOU/auto-skill-loader/.venv/bin/python`).
|
|
73
|
+
|
|
74
|
+
Or for uvx (requires network on first run):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
claude mcp add -s user --transport stdio -e MINIMAX_TOKEN_PLAN_KEY=sk-cp-YOUR-KEY auto-skill-loader -- uvx auto-skill-loader
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Tested On
|
|
81
|
+
|
|
82
|
+
| Host | Status | Verified |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| Claude Code (macOS) | ✅ Working | Vision tool + skill loading + MiniMax-M2.7 model |
|
|
85
|
+
| OpenCode (macOS) | ✅ Working | Vision tool + skill loading + MiniMax Token Plan |
|
|
86
|
+
|
|
87
|
+
Other MCP-compatible hosts (Cursor, Zed, etc.) should work with the same configuration — contributions welcome.
|
|
88
|
+
|
|
89
|
+
## Platform Differences & Known Issues
|
|
90
|
+
|
|
91
|
+
### Image Input: OpenCode vs Claude Code
|
|
92
|
+
|
|
93
|
+
Both hosts work with `auto-skill-loader` vision tools, but image input behaves differently:
|
|
94
|
+
|
|
95
|
+
| Host | How images are passed | Recommended workflow |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| **Claude Code** | Images uploaded to URL automatically → tool receives URL | Paste image directly ✅ works |
|
|
98
|
+
| **OpenCode** | Inline images render visually but may not give tools a real path | Give a file path instead of pasting |
|
|
99
|
+
|
|
100
|
+
**OpenCode note:** When you paste an image in OpenCode, it may render inline but the agent sees it as a filename string (e.g. `logo.png`) rather than a real filesystem path. This is a known OpenCode rendering behavior.
|
|
101
|
+
|
|
102
|
+
**Workaround for OpenCode:** Instead of pasting, give the agent the actual file path:
|
|
103
|
+
```
|
|
104
|
+
analyze this image: /path/to/your/image.png
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The agent can access local files directly in OpenCode. If the image is only in your clipboard, the agent can extract it to `/tmp/` first.
|
|
108
|
+
|
|
109
|
+
### What We're Monitoring
|
|
110
|
+
|
|
111
|
+
We actively track the following OpenCode issues:
|
|
112
|
+
- Inline image rendering (images pasted don't expose real paths to tools)
|
|
113
|
+
- MCP stdio transport for local servers (our proxy tools work around this)
|
|
114
|
+
- Session persistence of skills across restarts
|
|
115
|
+
|
|
116
|
+
If OpenCode releases a fix for inline image paths, this documentation will be updated.
|
|
117
|
+
|
|
118
|
+
### Other Known Issues
|
|
119
|
+
|
|
120
|
+
| Issue | Severity | Workaround |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| OpenCode inline images show as filename, not path | Medium — affects paste workflow | Use file paths instead |
|
|
123
|
+
| Claude Code auth conflict (ANTHROPIC_AUTH_TOKEN vs managed key) | Low — cosmetic warning | Harmless, can be ignored |
|
|
124
|
+
| First vision call may take 3-5s (uvx download) | Low — one-time | Subsequent calls are ~200ms |
|
|
125
|
+
|
|
126
|
+
## Setup
|
|
127
|
+
|
|
128
|
+
1. Create skills directory (symlink to your existing skills):
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
mkdir -p ~/.config/auto-skill-loader
|
|
132
|
+
ln -sf ~/.config/opencode/skills ~/.config/auto-skill-loader/skills
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
2. Edit `~/.config/auto-skill-loader/config.yaml`:
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
active_skills:
|
|
139
|
+
- vision-analysis
|
|
140
|
+
- context-maintainer
|
|
141
|
+
- markdown-mcp
|
|
142
|
+
skills_dir: ~/.config/auto-skill-loader/skills
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
3. Restart your agent. It will now auto-load all listed skills at session start.
|
|
146
|
+
|
|
147
|
+
## Tools
|
|
148
|
+
|
|
149
|
+
| Tool | What it does |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `list_skills` | List all available skills in skills_dir with descriptions |
|
|
152
|
+
| `activate_skill` | Add a skill to your approved list (persists to config.yaml) |
|
|
153
|
+
| `deactivate_skill` | Remove a skill from your approved list |
|
|
154
|
+
| `get_skill_info` | Get details about a specific skill |
|
|
155
|
+
| `get_active_skills` | List currently active skill names |
|
|
156
|
+
| `suggest_skills` | If no skills are active, suggests common ones to get started |
|
|
157
|
+
| `check_prerequisites` | Validate a skill's dependencies (MCP tools, API keys, env vars) |
|
|
158
|
+
|
|
159
|
+
## Bonus: MiniMax Vision & Web Search Proxy
|
|
160
|
+
|
|
161
|
+
auto-skill-loader also exposes two tools that proxy to `minimax-coding-plan-mcp` with a **working stdio transport**:
|
|
162
|
+
|
|
163
|
+
| Tool | What it does |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `minimax_understand_image` | Analyze images (JPEG, PNG, GIF, WebP up to 20MB) |
|
|
166
|
+
| `minimax_web_search` | Web search using MiniMax |
|
|
167
|
+
|
|
168
|
+
### The OpenCode MCP Bug
|
|
169
|
+
|
|
170
|
+
When OpenCode's built-in `minimax-coding-plan-mcp` MCP integration (`minimax-token-plan`) is configured, the `understand_image` tool fails with:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
API Error: login fail: Please carry the API secret key in the 'Authorization' field
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
This happens even when:
|
|
177
|
+
- ✅ `MINIMAX_API_KEY` / `MINIMAX_TOKEN_PLAN_KEY` is set correctly
|
|
178
|
+
- ✅ API key is valid (same key works via direct API calls)
|
|
179
|
+
- ✅ Token Plan has available vision quota
|
|
180
|
+
|
|
181
|
+
**Root cause:** OpenCode's stdio transport for local MCP servers sends messages in a way that breaks the MCP protocol — likely batched writes without proper flush between JSON-RPC messages. Direct subprocess tests with sequential writes + flush() work fine.
|
|
182
|
+
|
|
183
|
+
**The fix:** Our proxy tools in auto-skill-loader use proper sequential stdio communication, bypassing OpenCode's broken transport layer.
|
|
184
|
+
|
|
185
|
+
### Setup
|
|
186
|
+
|
|
187
|
+
1. Set your MiniMax Token Plan key in `~/.config/opencode/.env`:
|
|
188
|
+
```bash
|
|
189
|
+
MINIMAX_TOKEN_PLAN_KEY=sk-cp-your-key-here
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
2. Add auto-skill-loader to `~/.config/opencode/opencode.json`:
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"mcp": {
|
|
196
|
+
"auto-skill-loader": {
|
|
197
|
+
"type": "local",
|
|
198
|
+
"command": ["/path/to/venv/bin/python", "-m", "server"],
|
|
199
|
+
"enabled": true
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
3. **Critical:** If you have `minimax-coding-plan-mcp` configured directly in opencode.json (the `minimax-token-plan` entry), **remove or disable it** — its broken stdio transport will cause "login fail" errors. The proxy tools in auto-skill-loader replace it entirely.
|
|
206
|
+
|
|
207
|
+
4. Restart OpenCode and verify: `/ask Do you have auto-skill-loader_minimax_understand_image available?`
|
|
208
|
+
|
|
209
|
+
### Diagnosis
|
|
210
|
+
|
|
211
|
+
If you see "login fail" errors after setup:
|
|
212
|
+
|
|
213
|
+
1. **Disable the broken minimax MCP** — ensure `"minimax-token-plan": { "enabled": false }` or remove it entirely
|
|
214
|
+
2. **Restart OpenCode completely** — MCP servers are re-spawned on each session
|
|
215
|
+
3. **Check with:** `/ask Call minimax_understand_image with image_source="/any/real/image.png" and prompt="test"`
|
|
216
|
+
|
|
217
|
+
## Resources
|
|
218
|
+
|
|
219
|
+
| Resource | What it does |
|
|
220
|
+
|---|---|
|
|
221
|
+
| `skills://active` | All approved skill contents concatenated — read by host at session init |
|
|
222
|
+
| `skills://config` | Your current config.yaml content |
|
|
223
|
+
|
|
224
|
+
## Security
|
|
225
|
+
|
|
226
|
+
- **User-controlled** — only skills in `config.yaml` are loaded
|
|
227
|
+
- **No network fetches** — everything is local
|
|
228
|
+
- **No prompt injection** — skills come from your own configured directory
|
|
229
|
+
|
|
230
|
+
## Repo Structure
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
auto-skill-loader/
|
|
234
|
+
├── src/
|
|
235
|
+
│ └── server.py # MCP server (Python stdlib + mcp package)
|
|
236
|
+
├── pyproject.toml # Package config
|
|
237
|
+
├── README.md # This file
|
|
238
|
+
├── SKILL.md # For agent onboarding
|
|
239
|
+
└── LICENSE # MIT
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Requirements
|
|
243
|
+
|
|
244
|
+
- Python 3.9+
|
|
245
|
+
- `mcp` package (`pip install mcp`)
|
|
246
|
+
- `pyyaml` package (`pip install pyyaml`)
|
|
247
|
+
|
|
248
|
+
Or just use `uvx auto-skill-loader` which fetches dependencies automatically.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "auto-skill-loader"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "MCP server that auto-loads approved skills into agent sessions and provides MiniMax vision + search proxy tools"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = {text = "MIT"}
|
|
7
|
+
authors = [
|
|
8
|
+
{name = "divitkashyap"}
|
|
9
|
+
]
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"mcp>=0.9.0",
|
|
13
|
+
"pyyaml>=6.0",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
keywords = ["mcp", "model-context-protocol", "skills", "auto-load", "minimax", "vision", "ai"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 4 - Beta",
|
|
19
|
+
"Framework :: AsyncIO",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
dev = ["pytest", "pytest-asyncio"]
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
auto-skill-loader = "auto_skill_loader.server:main"
|
|
35
|
+
|
|
36
|
+
[build-system]
|
|
37
|
+
requires = ["setuptools>=61.0"]
|
|
38
|
+
build-backend = "setuptools.build_meta"
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.packages.find]
|
|
41
|
+
where = ["src"]
|
|
42
|
+
|
|
43
|
+
[tool.mcp]
|
|
44
|
+
name = "auto-skill-loader"
|
|
45
|
+
description = "Auto-load approved skills into agent sessions"
|
|
46
|
+
version = "1.0.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""auto-skill-loader - MCP server for skill management and MiniMax vision proxy."""
|