@ssemble/mcp-server 1.0.2 → 1.0.3
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/package.json +1 -1
- package/server.json +7 -7
- package/src/api/client.js +21 -6
- package/src/index.js +3 -1
- package/src/transports/http.js +2 -11
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "com.ssemble/mcp-server",
|
|
4
4
|
"title": "Ssemble AI Clipping",
|
|
5
|
-
"description": "Create AI-powered short-form video clips from YouTube videos
|
|
6
|
-
"version": "1.0.
|
|
5
|
+
"description": "Create AI-powered short-form video clips from YouTube videos using any AI assistant.",
|
|
6
|
+
"version": "1.0.3",
|
|
7
7
|
"websiteUrl": "https://www.ssemble.com",
|
|
8
8
|
"repository": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"url": "https://gitlab.com/vlogr/ssemble-mcp-server",
|
|
10
|
+
"source": "gitlab"
|
|
11
11
|
},
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
16
16
|
"identifier": "@ssemble/mcp-server",
|
|
17
|
-
"version": "1.0.
|
|
17
|
+
"version": "1.0.3",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|
|
21
21
|
"environmentVariables": [
|
|
22
22
|
{
|
|
23
23
|
"name": "SSEMBLE_API_KEY",
|
|
24
|
-
"description": "Your Ssemble API key (starts with sk_ssemble_)
|
|
24
|
+
"description": "Your Ssemble API key (starts with sk_ssemble_)",
|
|
25
25
|
"isRequired": true,
|
|
26
26
|
"isSecret": true
|
|
27
27
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"remotes": [
|
|
32
32
|
{
|
|
33
|
-
"
|
|
33
|
+
"type": "streamable-http",
|
|
34
34
|
"url": "https://mcp.ssemble.com/mcp"
|
|
35
35
|
}
|
|
36
36
|
]
|
package/src/api/client.js
CHANGED
|
@@ -17,18 +17,33 @@ export class SsembleApiError extends Error {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export class SsembleClient {
|
|
20
|
-
constructor(apiKey, baseUrl) {
|
|
21
|
-
if (!
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
constructor(apiKey, baseUrl, options = {}) {
|
|
21
|
+
if (!options.lazy) {
|
|
22
|
+
if (!apiKey) {
|
|
23
|
+
throw new Error('SSEMBLE_API_KEY is required');
|
|
24
|
+
}
|
|
25
|
+
if (!apiKey.startsWith('sk_ssemble_')) {
|
|
26
|
+
throw new Error('Invalid API key format. Must start with sk_ssemble_');
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
this.apiKey = apiKey;
|
|
28
30
|
this.baseUrl = baseUrl || DEFAULT_BASE_URL;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
async _request(method, path, { body, query } = {}) {
|
|
34
|
+
if (!this.apiKey) {
|
|
35
|
+
throw new SsembleApiError(401, {
|
|
36
|
+
code: 'missing_api_key',
|
|
37
|
+
message: 'Ssemble API key required. Pass via X-Ssemble-API-Key header when using the remote endpoint, or set SSEMBLE_API_KEY env var for local usage. Get your key at https://app.ssemble.com → Settings → API Keys.',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (!this.apiKey.startsWith('sk_ssemble_')) {
|
|
41
|
+
throw new SsembleApiError(401, {
|
|
42
|
+
code: 'invalid_api_key',
|
|
43
|
+
message: 'Invalid API key format. Must start with sk_ssemble_',
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
32
47
|
let url = `${this.baseUrl}${path}`;
|
|
33
48
|
|
|
34
49
|
if (query) {
|
package/src/index.js
CHANGED
|
@@ -27,7 +27,9 @@ export function createSsembleMcpServer(apiKey, baseUrl) {
|
|
|
27
27
|
version: '1.0.0',
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
// Client is created lazily — allows MCP initialize/discovery without an API key.
|
|
31
|
+
// Tools will get a clear error if key is missing when they actually call the API.
|
|
32
|
+
const client = new SsembleClient(apiKey, baseUrl, { lazy: true });
|
|
31
33
|
|
|
32
34
|
// Register all 9 tools
|
|
33
35
|
registerCreateShort(server, client);
|
package/src/transports/http.js
CHANGED
|
@@ -42,19 +42,10 @@ app.get('/.well-known/mcp/server-card.json', (_req, res) => {
|
|
|
42
42
|
|
|
43
43
|
// MCP endpoint — stateless mode (each request is independent)
|
|
44
44
|
app.all('/mcp', async (req, res) => {
|
|
45
|
-
const apiKey = req.headers['x-ssemble-api-key'] || process.env.SSEMBLE_API_KEY;
|
|
46
|
-
|
|
47
|
-
if (!apiKey) {
|
|
48
|
-
return res.status(401).json({
|
|
49
|
-
error: {
|
|
50
|
-
code: 'missing_api_key',
|
|
51
|
-
message: 'Ssemble API key required. Pass via X-Ssemble-API-Key header or set SSEMBLE_API_KEY env var.',
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
}
|
|
45
|
+
const apiKey = req.headers['x-ssemble-api-key'] || process.env.SSEMBLE_API_KEY || null;
|
|
46
|
+
const baseUrl = process.env.SSEMBLE_API_BASE_URL;
|
|
55
47
|
|
|
56
48
|
try {
|
|
57
|
-
const baseUrl = process.env.SSEMBLE_API_BASE_URL;
|
|
58
49
|
const server = createSsembleMcpServer(apiKey, baseUrl);
|
|
59
50
|
const transport = new StreamableHTTPServerTransport({
|
|
60
51
|
sessionIdGenerator: undefined, // stateless
|