@ssemble/mcp-server 1.1.10 → 1.1.11
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 +12 -0
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/api/client.js +1 -1
- package/src/transports/apiKey.js +27 -0
- package/src/transports/http.js +4 -3
package/README.md
CHANGED
|
@@ -161,6 +161,18 @@ Webhook payload example:
|
|
|
161
161
|
**Get results:**
|
|
162
162
|
> "Show me the clips for request 507f1f77bcf86cd799439011, sorted by viral score"
|
|
163
163
|
|
|
164
|
+
## Remote endpoint (`https://mcp.ssemble.com/mcp`)
|
|
165
|
+
|
|
166
|
+
No install needed — point any Streamable-HTTP MCP client at `https://mcp.ssemble.com/mcp` and send your API key in **any one** of these headers:
|
|
167
|
+
|
|
168
|
+
| Header | Example |
|
|
169
|
+
|--------|---------|
|
|
170
|
+
| `X-Ssemble-API-Key` | `X-Ssemble-API-Key: sk_ssemble_...` |
|
|
171
|
+
| `X-API-Key` | `X-API-Key: sk_ssemble_...` |
|
|
172
|
+
| `Authorization` | `Authorization: Bearer sk_ssemble_...` |
|
|
173
|
+
|
|
174
|
+
Clients that only allow standard headers (for example Claude custom connectors) should use `Authorization: Bearer sk_ssemble_...` or `X-API-Key`.
|
|
175
|
+
|
|
164
176
|
## Environment Variables
|
|
165
177
|
|
|
166
178
|
| Variable | Required | Description |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssemble/mcp-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"mcpName": "com.ssemble/mcp-server",
|
|
5
5
|
"description": "MCP server for Ssemble AI Clipping — create viral short-form videos from any AI assistant. Webhook callbacks for n8n, Zapier, and Make automation.",
|
|
6
6
|
"type": "module",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "com.ssemble/mcp-server",
|
|
4
4
|
"title": "Ssemble AI Clipping",
|
|
5
5
|
"description": "Create AI-powered short-form video clips from YouTube videos. Supports webhook callbacks.",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.11",
|
|
7
7
|
"websiteUrl": "https://www.ssemble.com/mcp",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/ssembleinc/ssemble-mcp-server",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
16
16
|
"identifier": "@ssemble/mcp-server",
|
|
17
|
-
"version": "1.1.
|
|
17
|
+
"version": "1.1.11",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|
package/src/api/client.js
CHANGED
|
@@ -63,7 +63,7 @@ export class SsembleClient {
|
|
|
63
63
|
if (!this.apiKey) {
|
|
64
64
|
throw new SsembleApiError(401, {
|
|
65
65
|
code: 'missing_api_key',
|
|
66
|
-
message: 'Ssemble API key required.
|
|
66
|
+
message: 'Ssemble API key required. When using the remote endpoint pass it via the X-Ssemble-API-Key header, the X-API-Key header, or "Authorization: Bearer sk_ssemble_..."; for local usage set the SSEMBLE_API_KEY env var. Get your key at https://app.ssemble.com/api-keys',
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
if (!this.apiKey.startsWith('sk_ssemble_')) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the Ssemble API key for an incoming HTTP MCP request.
|
|
3
|
+
*
|
|
4
|
+
* Accepted, in order of precedence:
|
|
5
|
+
* 1. X-Ssemble-API-Key: sk_ssemble_... (original header)
|
|
6
|
+
* 2. X-API-Key: sk_ssemble_... (same header the REST API accepts)
|
|
7
|
+
* 3. Authorization: Bearer sk_ssemble_... (standard header — the only kind
|
|
8
|
+
* some MCP clients, e.g. Claude custom connectors, allow)
|
|
9
|
+
* 4. SSEMBLE_API_KEY env var (single-tenant deployments)
|
|
10
|
+
*
|
|
11
|
+
* Returns null when nothing is present so the server can answer with the
|
|
12
|
+
* usual missing_api_key error.
|
|
13
|
+
*/
|
|
14
|
+
export function resolveApiKey(headers = {}, env = process.env) {
|
|
15
|
+
const first = (v) => (Array.isArray(v) ? v[0] : v);
|
|
16
|
+
|
|
17
|
+
const direct = first(headers['x-ssemble-api-key']) || first(headers['x-api-key']);
|
|
18
|
+
if (typeof direct === 'string' && direct.trim()) return direct.trim();
|
|
19
|
+
|
|
20
|
+
const auth = first(headers['authorization']);
|
|
21
|
+
if (typeof auth === 'string') {
|
|
22
|
+
const m = /^\s*Bearer\s+(\S+)\s*$/i.exec(auth);
|
|
23
|
+
if (m) return m[1];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return env.SSEMBLE_API_KEY || null;
|
|
27
|
+
}
|
package/src/transports/http.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import express from 'express';
|
|
10
10
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
11
11
|
import { createSsembleMcpServer, PKG_VERSION } from '../index.js';
|
|
12
|
+
import { resolveApiKey } from './apiKey.js';
|
|
12
13
|
|
|
13
14
|
const app = express();
|
|
14
15
|
app.use(express.json());
|
|
@@ -25,8 +26,8 @@ const SERVER_CARD = {
|
|
|
25
26
|
},
|
|
26
27
|
authentication: {
|
|
27
28
|
required: true,
|
|
28
|
-
schemes: ['api_key'],
|
|
29
|
-
instructions: 'Pass your Ssemble API key via the X-Ssemble-API-Key header or set SSEMBLE_API_KEY env var on the server.',
|
|
29
|
+
schemes: ['api_key', 'bearer'],
|
|
30
|
+
instructions: 'Pass your Ssemble API key via the X-Ssemble-API-Key header, the X-API-Key header, or "Authorization: Bearer sk_ssemble_..." — or set SSEMBLE_API_KEY env var on the server.',
|
|
30
31
|
},
|
|
31
32
|
};
|
|
32
33
|
|
|
@@ -42,7 +43,7 @@ app.get('/.well-known/mcp/server-card.json', (_req, res) => {
|
|
|
42
43
|
|
|
43
44
|
// MCP endpoint — stateless mode (each request is independent)
|
|
44
45
|
app.all('/mcp', async (req, res) => {
|
|
45
|
-
const apiKey = req.headers
|
|
46
|
+
const apiKey = resolveApiKey(req.headers);
|
|
46
47
|
const baseUrl = process.env.SSEMBLE_API_BASE_URL;
|
|
47
48
|
|
|
48
49
|
// Log MCP requests (tool calls) for usage tracking
|