mcp-server-autoshorts 1.0.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/index.js +85 -0
- package/package.json +26 -0
package/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import https from 'https';
|
|
7
|
+
|
|
8
|
+
const server = new Server(
|
|
9
|
+
{
|
|
10
|
+
name: 'mcp-server-autoshorts',
|
|
11
|
+
version: '1.0.0',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
capabilities: {
|
|
15
|
+
tools: {},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
function fetchAutoShortsSeries(apiKey) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const req = https.request('https://autoshort.org/api/series', {
|
|
23
|
+
method: 'GET',
|
|
24
|
+
headers: {
|
|
25
|
+
'Authorization': `Bearer ${apiKey || process.env.AUTOSHORTS_API_KEY}`,
|
|
26
|
+
'User-Agent': 'mcp-server-autoshorts/1.0.0'
|
|
27
|
+
}
|
|
28
|
+
}, (res) => {
|
|
29
|
+
let data = '';
|
|
30
|
+
res.on('data', chunk => data += chunk);
|
|
31
|
+
res.on('end', () => {
|
|
32
|
+
try {
|
|
33
|
+
resolve(JSON.parse(data));
|
|
34
|
+
} catch {
|
|
35
|
+
resolve({ error: 'Failed to parse AutoShorts API response' });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
req.on('error', (err) => resolve({ error: err.message }));
|
|
40
|
+
req.end();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
45
|
+
return {
|
|
46
|
+
tools: [
|
|
47
|
+
{
|
|
48
|
+
name: 'autoshorts_list_series',
|
|
49
|
+
description: 'List active video generation series, posting schedules, and queue statuses via AutoShorts API.',
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
apiKey: { type: 'string', description: 'AutoShorts API key (optional if AUTOSHORTS_API_KEY env is set)' }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
62
|
+
if (request.params.name === 'autoshorts_list_series') {
|
|
63
|
+
const apiKey = request.params.arguments?.apiKey || process.env.AUTOSHORTS_API_KEY;
|
|
64
|
+
const result = await fetchAutoShortsSeries(apiKey);
|
|
65
|
+
return {
|
|
66
|
+
content: [
|
|
67
|
+
{
|
|
68
|
+
type: 'text',
|
|
69
|
+
text: JSON.stringify(result, null, 2)
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
async function run() {
|
|
78
|
+
const transport = new StdioServerTransport();
|
|
79
|
+
await server.connect(transport);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
run().catch((err) => {
|
|
83
|
+
console.error('Fatal MCP Server error:', err);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-server-autoshorts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Official Model Context Protocol (MCP) server for AutoShorts — Automated faceless video generation & series management engine for AI agents",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mcp-server-autoshorts": "index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node index.js"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"model-context-protocol",
|
|
15
|
+
"autoshorts",
|
|
16
|
+
"faceless-video",
|
|
17
|
+
"youtube-shorts",
|
|
18
|
+
"tiktok-automation",
|
|
19
|
+
"ai-agent"
|
|
20
|
+
],
|
|
21
|
+
"author": "Kien Phan <kien@autoshort.org>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.5.0"
|
|
25
|
+
}
|
|
26
|
+
}
|