@imagin.studio/api-docs-mcp 0.1.12
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 +71 -0
- package/bin/imagin-studio-api-docs-mcp.js +101 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# IMAGIN.studio API Docs MCP Server
|
|
2
|
+
|
|
3
|
+
Semantic search over [IMAGIN.studio](https://www.imaginstudio.com/)
|
|
4
|
+
[documentation](https://docs.imagin.studio/) — CDN, API, integration guides, and more.
|
|
5
|
+
|
|
6
|
+
This is a thin **npx wrapper** that finds `uvx` on your system and launches
|
|
7
|
+
the Python MCP server. It solves the common problem of GUI apps (Claude
|
|
8
|
+
Desktop, Cursor, etc.) not finding `uvx` in PATH.
|
|
9
|
+
|
|
10
|
+
## Dependency note — `fastembed-imagin`
|
|
11
|
+
|
|
12
|
+
This package depends on `fastembed-imagin`, a temporary fork of
|
|
13
|
+
[`fastembed`](https://github.com/qdrant/fastembed) by Qdrant.
|
|
14
|
+
|
|
15
|
+
**Why:** upstream fastembed 0.7.4 pins `pillow<12.0`, which blocks
|
|
16
|
+
Pillow 12.x security fixes (CVE-2026-25990). The fix PR
|
|
17
|
+
([#599](https://github.com/qdrant/fastembed/pull/599)) is open but
|
|
18
|
+
unreleased.
|
|
19
|
+
|
|
20
|
+
**What changed:** only the pillow version constraint — relaxed from
|
|
21
|
+
`<12.0` to `<13.0` for Python 3.10+. No logic changes. Source:
|
|
22
|
+
[IMAGIN-studio/fastembed-imagin](https://github.com/IMAGIN-studio/fastembed-imagin).
|
|
23
|
+
|
|
24
|
+
**Revert plan:** once upstream releases fastembed 0.7.5+ with the
|
|
25
|
+
pillow fix, this package will switch back to `fastembed` and
|
|
26
|
+
`fastembed-imagin` will be retired.
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- **Node.js 18+** (for npx)
|
|
31
|
+
- **uv** — install from [astral.sh/uv](https://docs.astral.sh/uv/):
|
|
32
|
+
```sh
|
|
33
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS / Linux
|
|
34
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npx -y @imagin.studio/api-docs-mcp
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or in your agent's MCP config:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"imagin-docs": {
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["-y", "@imagin.studio/api-docs-mcp"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Full setup guide
|
|
55
|
+
|
|
56
|
+
For step-by-step instructions for 7 coding agents (Claude Code, Claude
|
|
57
|
+
Desktop, Cursor, Windsurf, VS Code + Copilot, Cline, Zed), see the full
|
|
58
|
+
setup guide on PyPI:
|
|
59
|
+
|
|
60
|
+
**https://pypi.org/project/imagin-studio-api-docs-mcp/**
|
|
61
|
+
|
|
62
|
+
## How it works
|
|
63
|
+
|
|
64
|
+
The npx wrapper probes common `uvx` install locations (`~/.local/bin`,
|
|
65
|
+
Homebrew, cargo) and spawns `uvx imagin-studio-api-docs-mcp`, which downloads and
|
|
66
|
+
runs the Python MCP server. On first run, the server clones the docs and
|
|
67
|
+
builds a local vector index (~20-30 seconds).
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
Proprietary — see [LICENSE](https://github.com/IMAGIN-studio/api-docs-mcp/blob/main/LICENSE).
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin wrapper that finds uvx and spawns the imagin-studio-api-docs-mcp Python server.
|
|
3
|
+
// Used by: npx imagin-studio-api-docs-mcp, Claude Desktop config, .mcpb bundles.
|
|
4
|
+
//
|
|
5
|
+
// Why Node.js? GUI apps (Claude Desktop, Cursor, etc.) don't inherit shell
|
|
6
|
+
// PATH, so bare "uvx" fails with ENOENT. This script probes common install
|
|
7
|
+
// locations before falling back to PATH lookup.
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
|
|
11
|
+
const { spawn, execFileSync } = require("child_process");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const fs = require("fs");
|
|
14
|
+
const os = require("os");
|
|
15
|
+
|
|
16
|
+
// -- Configuration -----------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
const PACKAGE = "imagin-studio-api-docs-mcp";
|
|
19
|
+
|
|
20
|
+
const UVX_ARGS = [PACKAGE];
|
|
21
|
+
|
|
22
|
+
// -- Find uvx ----------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
function findUvx() {
|
|
25
|
+
const home = os.homedir();
|
|
26
|
+
const isWin = process.platform === "win32";
|
|
27
|
+
const bin = isWin ? "uvx.exe" : "uvx";
|
|
28
|
+
|
|
29
|
+
// Common install locations (ordered by likelihood)
|
|
30
|
+
const candidates = [
|
|
31
|
+
path.join(home, ".local", "bin", bin), // default uv install (Linux/macOS)
|
|
32
|
+
path.join(home, ".cargo", "bin", bin), // cargo install uv
|
|
33
|
+
"/opt/homebrew/bin/uvx", // Homebrew on Apple Silicon
|
|
34
|
+
"/usr/local/bin/uvx", // Homebrew on Intel / manual symlink
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
if (isWin) {
|
|
38
|
+
const localAppData = process.env.LOCALAPPDATA || path.join(home, "AppData", "Local");
|
|
39
|
+
candidates.unshift(path.join(localAppData, "uv", "bin", "uvx.exe"));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (const candidate of candidates) {
|
|
43
|
+
if (fs.existsSync(candidate)) {
|
|
44
|
+
return candidate;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Fall back to PATH lookup — works when launched from a terminal
|
|
49
|
+
try {
|
|
50
|
+
const cmd = isWin ? "where" : "which";
|
|
51
|
+
const result = execFileSync(cmd, [bin], { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] });
|
|
52
|
+
const resolved = result.trim().split("\n")[0];
|
|
53
|
+
if (resolved && fs.existsSync(resolved)) {
|
|
54
|
+
return resolved;
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
// which/where failed — uvx not in PATH
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// -- Main --------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
const uvx = findUvx();
|
|
66
|
+
|
|
67
|
+
if (!uvx) {
|
|
68
|
+
// Write to stderr only — stdout is reserved for MCP JSON-RPC
|
|
69
|
+
process.stderr.write(
|
|
70
|
+
`Error: uvx not found.\n\n` +
|
|
71
|
+
`The imagin-studio-api-docs-mcp server requires uv (https://docs.astral.sh/uv/).\n\n` +
|
|
72
|
+
`Install uv:\n` +
|
|
73
|
+
` macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh\n` +
|
|
74
|
+
` Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"\n` +
|
|
75
|
+
` Homebrew: brew install uv\n`
|
|
76
|
+
);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const child = spawn(uvx, UVX_ARGS, {
|
|
81
|
+
stdio: "inherit",
|
|
82
|
+
env: { ...process.env },
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Forward signals to the child process
|
|
86
|
+
process.on("SIGINT", () => child.kill("SIGINT"));
|
|
87
|
+
process.on("SIGTERM", () => child.kill("SIGTERM"));
|
|
88
|
+
|
|
89
|
+
// Propagate exit code
|
|
90
|
+
child.on("exit", (code, signal) => {
|
|
91
|
+
if (signal) {
|
|
92
|
+
process.kill(process.pid, signal);
|
|
93
|
+
} else {
|
|
94
|
+
process.exit(code ?? 1);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
child.on("error", (err) => {
|
|
99
|
+
process.stderr.write(`Failed to start uvx: ${err.message}\n`);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@imagin.studio/api-docs-mcp",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "IMAGIN.studio documentation search — MCP server (npx wrapper)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"imagin-studio-api-docs-mcp": "bin/imagin-studio-api-docs-mcp.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18.0.0"
|
|
13
|
+
},
|
|
14
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "IMAGIN.studio",
|
|
17
|
+
"email": "service@imagin.studio",
|
|
18
|
+
"url": "https://imagin.studio"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/IMAGIN-studio/api-docs-mcp"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"mcp",
|
|
26
|
+
"imagin",
|
|
27
|
+
"documentation",
|
|
28
|
+
"search",
|
|
29
|
+
"rag",
|
|
30
|
+
"model-context-protocol"
|
|
31
|
+
]
|
|
32
|
+
}
|