framlit-mcp 0.1.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/README.md +149 -0
- package/dist/api/client.d.ts +111 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +125 -0
- package/dist/api/client.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/credits.d.ts +15 -0
- package/dist/tools/credits.d.ts.map +1 -0
- package/dist/tools/credits.js +58 -0
- package/dist/tools/credits.js.map +1 -0
- package/dist/tools/generate.d.ts +22 -0
- package/dist/tools/generate.d.ts.map +1 -0
- package/dist/tools/generate.js +94 -0
- package/dist/tools/generate.js.map +1 -0
- package/dist/tools/projects.d.ts +36 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +146 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/render.d.ts +36 -0
- package/dist/tools/render.d.ts.map +1 -0
- package/dist/tools/render.js +100 -0
- package/dist/tools/render.js.map +1 -0
- package/dist/tools/templates.d.ts +15 -0
- package/dist/tools/templates.d.ts.map +1 -0
- package/dist/tools/templates.js +55 -0
- package/dist/tools/templates.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Framlit MCP
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for [Framlit](https://framlit.com) - AI-powered video generation.
|
|
4
|
+
|
|
5
|
+
Generate Remotion videos directly from your IDE using natural language.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Generate Video Code**: Create Remotion video code from text descriptions
|
|
10
|
+
- **Modify Code**: Edit existing code with natural language instructions
|
|
11
|
+
- **Project Management**: Create, list, and update Framlit projects
|
|
12
|
+
- **Video Rendering**: Render videos to MP4 via AWS Lambda
|
|
13
|
+
- **Templates**: Browse and use video templates
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- Node.js 18+
|
|
20
|
+
- A Framlit account with API key
|
|
21
|
+
|
|
22
|
+
### Get Your API Key
|
|
23
|
+
|
|
24
|
+
1. Go to [Framlit Settings](https://framlit.com/settings/api-keys)
|
|
25
|
+
2. Click "Create API Key"
|
|
26
|
+
3. Copy the key (you'll only see it once!)
|
|
27
|
+
|
|
28
|
+
### Configure in Cursor
|
|
29
|
+
|
|
30
|
+
Add to your Cursor settings (`.cursor/mcp.json`):
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"framlit": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["framlit-mcp"],
|
|
38
|
+
"env": {
|
|
39
|
+
"FRAMLIT_API_KEY": "fml_your_api_key_here"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or install globally:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install -g framlit-mcp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
Once configured, you can use Framlit tools in Cursor:
|
|
55
|
+
|
|
56
|
+
### Generate Video Code
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Create a 3D logo animation with the text "HELLO" rotating in space
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The AI will use `framlit_generate_code` to generate Remotion code.
|
|
63
|
+
|
|
64
|
+
### Modify Existing Code
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Change the background color to blue and make the text larger
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Uses `framlit_modify_code` with your existing code.
|
|
71
|
+
|
|
72
|
+
### Manage Projects
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
List my Framlit projects
|
|
76
|
+
Create a new project called "Product Demo"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Render Video
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
Render the project to MP4
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Available Tools
|
|
86
|
+
|
|
87
|
+
| Tool | Description | Credits |
|
|
88
|
+
|------|-------------|---------|
|
|
89
|
+
| `framlit_generate_code` | Generate Remotion code from text | 1 |
|
|
90
|
+
| `framlit_modify_code` | Modify existing code | 1 |
|
|
91
|
+
| `framlit_list_projects` | List your projects | 0 |
|
|
92
|
+
| `framlit_get_project` | Get project details | 0 |
|
|
93
|
+
| `framlit_create_project` | Create a new project | 0 |
|
|
94
|
+
| `framlit_update_project` | Update a project | 0 |
|
|
95
|
+
| `framlit_render_video` | Start video rendering | 0 |
|
|
96
|
+
| `framlit_get_render_status` | Check render progress | 0 |
|
|
97
|
+
| `framlit_list_templates` | Browse templates | 0 |
|
|
98
|
+
| `framlit_get_credits` | Check credit balance | 0 |
|
|
99
|
+
|
|
100
|
+
## Pricing
|
|
101
|
+
|
|
102
|
+
MCP uses the same credit system as the Framlit web app:
|
|
103
|
+
|
|
104
|
+
- **Free Plan**: 50 credits/month
|
|
105
|
+
- **Pro Plan**: 500 credits/month ($29/mo)
|
|
106
|
+
- **Credit Packs**: Available for purchase
|
|
107
|
+
|
|
108
|
+
Each code generation or modification costs 1 credit.
|
|
109
|
+
|
|
110
|
+
### Watermark
|
|
111
|
+
|
|
112
|
+
- Free/Hobby plans: Videos include a Framlit watermark
|
|
113
|
+
- Pro/Team plans: No watermark
|
|
114
|
+
|
|
115
|
+
[View Pricing](https://framlit.com/pricing)
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Install dependencies
|
|
121
|
+
npm install
|
|
122
|
+
|
|
123
|
+
# Run in development mode
|
|
124
|
+
npm run dev
|
|
125
|
+
|
|
126
|
+
# Build
|
|
127
|
+
npm run build
|
|
128
|
+
|
|
129
|
+
# Test locally
|
|
130
|
+
FRAMLIT_API_KEY=fml_xxx npm start
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Environment Variables
|
|
134
|
+
|
|
135
|
+
| Variable | Description | Required |
|
|
136
|
+
|----------|-------------|----------|
|
|
137
|
+
| `FRAMLIT_API_KEY` | Your Framlit API key | Yes |
|
|
138
|
+
| `FRAMLIT_API_URL` | Custom API URL (for development) | No |
|
|
139
|
+
|
|
140
|
+
## Resources
|
|
141
|
+
|
|
142
|
+
- [Framlit Website](https://framlit.com)
|
|
143
|
+
- [Documentation](https://framlit.com/docs)
|
|
144
|
+
- [Pricing](https://framlit.com/pricing)
|
|
145
|
+
- [API Key Settings](https://framlit.com/settings/api-keys)
|
|
146
|
+
|
|
147
|
+
## License
|
|
148
|
+
|
|
149
|
+
MIT
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framlit API Client
|
|
3
|
+
*
|
|
4
|
+
* HTTP client for communicating with Framlit SaaS API.
|
|
5
|
+
*/
|
|
6
|
+
export interface UserInfo {
|
|
7
|
+
userId: string;
|
|
8
|
+
planTier: string;
|
|
9
|
+
creditsTotal: number;
|
|
10
|
+
creditsUsed: number;
|
|
11
|
+
creditsRemaining: number;
|
|
12
|
+
limits: {
|
|
13
|
+
maxProjects: number;
|
|
14
|
+
maxRenderDuration: number;
|
|
15
|
+
hasWatermark: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface Project {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
code: string;
|
|
22
|
+
format: 'landscape' | 'portrait' | 'square';
|
|
23
|
+
duration: number;
|
|
24
|
+
fps: number;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Template {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
code: string;
|
|
33
|
+
thumbnailUrl: string;
|
|
34
|
+
category: string;
|
|
35
|
+
isOfficial: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface RenderResult {
|
|
38
|
+
renderId: string;
|
|
39
|
+
status: 'pending' | 'rendering' | 'completed' | 'failed';
|
|
40
|
+
progress?: number;
|
|
41
|
+
downloadUrl?: string;
|
|
42
|
+
error?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GenerateCodeResult {
|
|
45
|
+
code: string;
|
|
46
|
+
creditsUsed: number;
|
|
47
|
+
creditsRemaining: number;
|
|
48
|
+
}
|
|
49
|
+
export declare class FramlitClient {
|
|
50
|
+
private apiKey;
|
|
51
|
+
private baseUrl;
|
|
52
|
+
constructor(apiKey: string, baseUrl?: string);
|
|
53
|
+
private request;
|
|
54
|
+
/**
|
|
55
|
+
* Get user info including credits and plan
|
|
56
|
+
*/
|
|
57
|
+
getUserInfo(): Promise<UserInfo>;
|
|
58
|
+
/**
|
|
59
|
+
* Generate Remotion code from a prompt
|
|
60
|
+
*/
|
|
61
|
+
generateCode(params: {
|
|
62
|
+
prompt: string;
|
|
63
|
+
format?: 'landscape' | 'portrait' | 'square';
|
|
64
|
+
}): Promise<GenerateCodeResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Modify existing code based on instructions
|
|
67
|
+
*/
|
|
68
|
+
modifyCode(params: {
|
|
69
|
+
code: string;
|
|
70
|
+
instruction: string;
|
|
71
|
+
}): Promise<GenerateCodeResult>;
|
|
72
|
+
/**
|
|
73
|
+
* List user's projects
|
|
74
|
+
*/
|
|
75
|
+
listProjects(): Promise<Project[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Get a single project
|
|
78
|
+
*/
|
|
79
|
+
getProject(projectId: string): Promise<Project>;
|
|
80
|
+
/**
|
|
81
|
+
* Create a new project
|
|
82
|
+
*/
|
|
83
|
+
createProject(params: {
|
|
84
|
+
name: string;
|
|
85
|
+
code?: string;
|
|
86
|
+
format?: 'landscape' | 'portrait' | 'square';
|
|
87
|
+
}): Promise<Project>;
|
|
88
|
+
/**
|
|
89
|
+
* Update an existing project
|
|
90
|
+
*/
|
|
91
|
+
updateProject(projectId: string, params: {
|
|
92
|
+
name?: string;
|
|
93
|
+
code?: string;
|
|
94
|
+
}): Promise<Project>;
|
|
95
|
+
/**
|
|
96
|
+
* Start video rendering
|
|
97
|
+
*/
|
|
98
|
+
renderVideo(projectId: string): Promise<RenderResult>;
|
|
99
|
+
/**
|
|
100
|
+
* Get render status
|
|
101
|
+
*/
|
|
102
|
+
getRenderStatus(renderId: string): Promise<RenderResult>;
|
|
103
|
+
/**
|
|
104
|
+
* List templates
|
|
105
|
+
*/
|
|
106
|
+
listTemplates(params?: {
|
|
107
|
+
category?: string;
|
|
108
|
+
official?: boolean;
|
|
109
|
+
}): Promise<Template[]>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,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xC;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrD;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;KAC9C,GAAG,OAAO,CAAC,OAAO,CAAC;IAOpB;;OAEG;IACG,aAAa,CACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GACA,OAAO,CAAC,OAAO,CAAC;IAOnB;;OAEG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAO3D;;OAEG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI9D;;OAEG;IACG,aAAa,CAAC,MAAM,CAAC,EAAE;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAQxB"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Framlit API Client
|
|
4
|
+
*
|
|
5
|
+
* HTTP client for communicating with Framlit SaaS API.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.FramlitClient = void 0;
|
|
9
|
+
const DEFAULT_BASE_URL = 'https://framlit.com';
|
|
10
|
+
class FramlitClient {
|
|
11
|
+
apiKey;
|
|
12
|
+
baseUrl;
|
|
13
|
+
constructor(apiKey, baseUrl) {
|
|
14
|
+
this.apiKey = apiKey;
|
|
15
|
+
this.baseUrl = baseUrl || process.env.FRAMLIT_API_URL || DEFAULT_BASE_URL;
|
|
16
|
+
}
|
|
17
|
+
async request(endpoint, options = {}) {
|
|
18
|
+
const url = `${this.baseUrl}/api/mcp${endpoint}`;
|
|
19
|
+
const response = await fetch(url, {
|
|
20
|
+
...options,
|
|
21
|
+
headers: {
|
|
22
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
'User-Agent': 'framlit-mcp/0.1.0',
|
|
25
|
+
...options.headers,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const data = await response.json();
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
const error = data.error || `Request failed with status ${response.status}`;
|
|
31
|
+
// Handle specific error codes for upsell messages
|
|
32
|
+
if (data.code === 'INSUFFICIENT_CREDITS') {
|
|
33
|
+
throw new Error(`${error}\n\n💡 Get more credits at https://framlit.com/pricing`);
|
|
34
|
+
}
|
|
35
|
+
if (data.code === 'PLAN_LIMIT_EXCEEDED') {
|
|
36
|
+
throw new Error(`${error}\n\n💡 Upgrade to Pro for more capacity at https://framlit.com/pricing`);
|
|
37
|
+
}
|
|
38
|
+
throw new Error(error);
|
|
39
|
+
}
|
|
40
|
+
return data.data;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get user info including credits and plan
|
|
44
|
+
*/
|
|
45
|
+
async getUserInfo() {
|
|
46
|
+
return this.request('/user');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generate Remotion code from a prompt
|
|
50
|
+
*/
|
|
51
|
+
async generateCode(params) {
|
|
52
|
+
return this.request('/generate-code', {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
body: JSON.stringify(params),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Modify existing code based on instructions
|
|
59
|
+
*/
|
|
60
|
+
async modifyCode(params) {
|
|
61
|
+
return this.request('/modify-code', {
|
|
62
|
+
method: 'POST',
|
|
63
|
+
body: JSON.stringify(params),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* List user's projects
|
|
68
|
+
*/
|
|
69
|
+
async listProjects() {
|
|
70
|
+
return this.request('/projects');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get a single project
|
|
74
|
+
*/
|
|
75
|
+
async getProject(projectId) {
|
|
76
|
+
return this.request(`/projects/${projectId}`);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a new project
|
|
80
|
+
*/
|
|
81
|
+
async createProject(params) {
|
|
82
|
+
return this.request('/projects', {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
body: JSON.stringify(params),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Update an existing project
|
|
89
|
+
*/
|
|
90
|
+
async updateProject(projectId, params) {
|
|
91
|
+
return this.request(`/projects/${projectId}`, {
|
|
92
|
+
method: 'PUT',
|
|
93
|
+
body: JSON.stringify(params),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Start video rendering
|
|
98
|
+
*/
|
|
99
|
+
async renderVideo(projectId) {
|
|
100
|
+
return this.request('/render', {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
body: JSON.stringify({ projectId }),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get render status
|
|
107
|
+
*/
|
|
108
|
+
async getRenderStatus(renderId) {
|
|
109
|
+
return this.request(`/render/${renderId}`);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* List templates
|
|
113
|
+
*/
|
|
114
|
+
async listTemplates(params) {
|
|
115
|
+
const searchParams = new URLSearchParams();
|
|
116
|
+
if (params?.category)
|
|
117
|
+
searchParams.set('category', params.category);
|
|
118
|
+
if (params?.official !== undefined)
|
|
119
|
+
searchParams.set('official', String(params.official));
|
|
120
|
+
const query = searchParams.toString();
|
|
121
|
+
return this.request(`/templates${query ? `?${query}` : ''}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.FramlitClient = FramlitClient;
|
|
125
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAkD/C,MAAa,aAAa;IAChB,MAAM,CAAS;IACf,OAAO,CAAS;IAExB,YAAY,MAAc,EAAE,OAAgB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,gBAAgB,CAAC;IAC5E,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,QAAgB,EAChB,UAAuB,EAAE;QAEzB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,WAAW,QAAQ,EAAE,CAAC;QAEjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;gBACxC,cAAc,EAAE,kBAAkB;gBAClC,YAAY,EAAE,mBAAmB;gBACjC,GAAG,OAAO,CAAC,OAAO;aACnB;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAiD,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,8BAA8B,QAAQ,CAAC,MAAM,EAAE,CAAC;YAE5E,kDAAkD;YAClD,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAsB,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,wDAAwD,CACjE,CAAC;YACJ,CAAC;YAED,IAAI,I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
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Framlit MCP Server
|
|
5
|
+
*
|
|
6
|
+
* MCP server for AI-powered video generation via Framlit.
|
|
7
|
+
* Enables IDE integration for creating Remotion videos.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
11
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
12
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
13
|
+
const client_js_1 = require("./api/client.js");
|
|
14
|
+
const generate_js_1 = require("./tools/generate.js");
|
|
15
|
+
const projects_js_1 = require("./tools/projects.js");
|
|
16
|
+
const render_js_1 = require("./tools/render.js");
|
|
17
|
+
const templates_js_1 = require("./tools/templates.js");
|
|
18
|
+
const credits_js_1 = require("./tools/credits.js");
|
|
19
|
+
// Server configuration
|
|
20
|
+
const SERVER_NAME = 'framlit-mcp';
|
|
21
|
+
const SERVER_VERSION = '0.1.0';
|
|
22
|
+
// Initialize server
|
|
23
|
+
const server = new index_js_1.Server({
|
|
24
|
+
name: SERVER_NAME,
|
|
25
|
+
version: SERVER_VERSION,
|
|
26
|
+
}, {
|
|
27
|
+
capabilities: {
|
|
28
|
+
tools: {},
|
|
29
|
+
resources: {},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
// Initialize API client
|
|
33
|
+
const apiKey = process.env.FRAMLIT_API_KEY;
|
|
34
|
+
if (!apiKey) {
|
|
35
|
+
console.error('Error: FRAMLIT_API_KEY environment variable is required');
|
|
36
|
+
console.error('Get your API key at https://framlit.com/settings/api-keys');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
const client = new client_js_1.FramlitClient(apiKey);
|
|
40
|
+
// List available tools
|
|
41
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
42
|
+
return {
|
|
43
|
+
tools: [
|
|
44
|
+
generate_js_1.generateCodeTool,
|
|
45
|
+
generate_js_1.modifyCodeTool,
|
|
46
|
+
projects_js_1.listProjectsTool,
|
|
47
|
+
projects_js_1.getProjectTool,
|
|
48
|
+
projects_js_1.createProjectTool,
|
|
49
|
+
projects_js_1.updateProjectTool,
|
|
50
|
+
render_js_1.renderVideoTool,
|
|
51
|
+
render_js_1.getRenderStatusTool,
|
|
52
|
+
templates_js_1.listTemplatesTool,
|
|
53
|
+
credits_js_1.getCreditsTool,
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
// Handle tool calls
|
|
58
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
59
|
+
const { name, arguments: args = {} } = request.params;
|
|
60
|
+
try {
|
|
61
|
+
switch (name) {
|
|
62
|
+
// Code generation
|
|
63
|
+
case 'framlit_generate_code':
|
|
64
|
+
return await (0, generate_js_1.handleGenerateCode)(client, args);
|
|
65
|
+
case 'framlit_modify_code':
|
|
66
|
+
return await (0, generate_js_1.handleModifyCode)(client, args);
|
|
67
|
+
// Projects
|
|
68
|
+
case 'framlit_list_projects':
|
|
69
|
+
return await (0, projects_js_1.handleListProjects)(client);
|
|
70
|
+
case 'framlit_get_project':
|
|
71
|
+
return await (0, projects_js_1.handleGetProject)(client, args);
|
|
72
|
+
case 'framlit_create_project':
|
|
73
|
+
return await (0, projects_js_1.handleCreateProject)(client, args);
|
|
74
|
+
case 'framlit_update_project':
|
|
75
|
+
return await (0, projects_js_1.handleUpdateProject)(client, args);
|
|
76
|
+
// Rendering
|
|
77
|
+
case 'framlit_render_video':
|
|
78
|
+
return await (0, render_js_1.handleRenderVideo)(client, args);
|
|
79
|
+
case 'framlit_get_render_status':
|
|
80
|
+
return await (0, render_js_1.handleGetRenderStatus)(client, args);
|
|
81
|
+
// Templates
|
|
82
|
+
case 'framlit_list_templates':
|
|
83
|
+
return await (0, templates_js_1.handleListTemplates)(client, args);
|
|
84
|
+
// Credits
|
|
85
|
+
case 'framlit_get_credits':
|
|
86
|
+
return await (0, credits_js_1.handleGetCredits)(client);
|
|
87
|
+
default:
|
|
88
|
+
return {
|
|
89
|
+
content: [
|
|
90
|
+
{
|
|
91
|
+
type: 'text',
|
|
92
|
+
text: `Unknown tool: ${name}`,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
isError: true,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: 'text',
|
|
105
|
+
text: `Error: ${message}`,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
isError: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
// List available resources
|
|
113
|
+
server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => {
|
|
114
|
+
return {
|
|
115
|
+
resources: [
|
|
116
|
+
{
|
|
117
|
+
uri: 'framlit://user/credits',
|
|
118
|
+
name: 'Credits Balance',
|
|
119
|
+
description: 'Current credit balance and usage',
|
|
120
|
+
mimeType: 'application/json',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
uri: 'framlit://user/plan',
|
|
124
|
+
name: 'Current Plan',
|
|
125
|
+
description: 'Subscription plan details',
|
|
126
|
+
mimeType: 'application/json',
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
// Read resources
|
|
132
|
+
server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
|
|
133
|
+
const { uri } = request.params;
|
|
134
|
+
try {
|
|
135
|
+
if (uri === 'framlit://user/credits' || uri === 'framlit://user/plan') {
|
|
136
|
+
const userInfo = await client.getUserInfo();
|
|
137
|
+
if (uri === 'framlit://user/credits') {
|
|
138
|
+
return {
|
|
139
|
+
contents: [
|
|
140
|
+
{
|
|
141
|
+
uri,
|
|
142
|
+
mimeType: 'application/json',
|
|
143
|
+
text: JSON.stringify({
|
|
144
|
+
total: userInfo.creditsTotal,
|
|
145
|
+
used: userInfo.creditsUsed,
|
|
146
|
+
remaining: userInfo.creditsRemaining,
|
|
147
|
+
}, null, 2),
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return {
|
|
154
|
+
contents: [
|
|
155
|
+
{
|
|
156
|
+
uri,
|
|
157
|
+
mimeType: 'application/json',
|
|
158
|
+
text: JSON.stringify({
|
|
159
|
+
plan: userInfo.planTier,
|
|
160
|
+
limits: userInfo.limits,
|
|
161
|
+
}, null, 2),
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
throw new Error(`Unknown resource: ${uri}`);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
171
|
+
throw new Error(`Failed to read resource: ${message}`);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
// Start server
|
|
175
|
+
async function main() {
|
|
176
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
177
|
+
await server.connect(transport);
|
|
178
|
+
console.error(`${SERVER_NAME} v${SERVER_VERSION} started`);
|
|
179
|
+
}
|
|
180
|
+
main().catch((error) => {
|
|
181
|
+
console.error('Fatal error:', error);
|
|
182
|
+
process.exit(1);
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAK4C;AAE5C,+CAAgD;AAChD,qDAK6B;AAC7B,qDAS6B;AAC7B,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AAM,CAAC;gBACN,OAAO;oBACL,QAAQ,EAAE;wBACR;4BACE,GAAG;4BACH,QAAQ,EAAE,kBAAkB;4BAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gCACnB,IAAI,EAAE,QAAQ,CAAC,QAAQ;gCACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;6BACxB,EAAE,IAAI,EAAE,CAAC,CAAC;yBACZ;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,eAAe;AACf,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,KAAK,cAAc,UAAU,CAAC,CAAC;AAC7D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credits Tool
|
|
3
|
+
*
|
|
4
|
+
* Tool for checking credit balance.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FramlitClient } from '../api/client.js';
|
|
8
|
+
export declare const getCreditsTool: Tool;
|
|
9
|
+
export declare function handleGetCredits(client: FramlitClient): Promise<{
|
|
10
|
+
content: {
|
|
11
|
+
type: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=credits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,cAAc,EAAE,IAQ5B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,aAAa;;;;;GA6B3D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Credits Tool
|
|
4
|
+
*
|
|
5
|
+
* Tool for checking credit balance.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getCreditsTool = void 0;
|
|
9
|
+
exports.handleGetCredits = handleGetCredits;
|
|
10
|
+
exports.getCreditsTool = {
|
|
11
|
+
name: 'framlit_get_credits',
|
|
12
|
+
description: 'Check your current credit balance and plan.',
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {},
|
|
16
|
+
required: [],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
async function handleGetCredits(client) {
|
|
20
|
+
const userInfo = await client.getUserInfo();
|
|
21
|
+
const planInfo = getPlanInfo(userInfo.planTier);
|
|
22
|
+
let message = `**Credit Balance**\n\n`;
|
|
23
|
+
message += `Remaining: ${userInfo.creditsRemaining} / ${userInfo.creditsTotal} credits\n`;
|
|
24
|
+
message += `Used: ${userInfo.creditsUsed} credits\n\n`;
|
|
25
|
+
message += `**Plan: ${planInfo.name}**\n`;
|
|
26
|
+
message += `- Max projects: ${userInfo.limits.maxProjects}\n`;
|
|
27
|
+
message += `- Max render duration: ${userInfo.limits.maxRenderDuration}s\n`;
|
|
28
|
+
message += `- Watermark: ${userInfo.limits.hasWatermark ? 'Yes' : 'No'}\n`;
|
|
29
|
+
if (userInfo.creditsRemaining <= 10) {
|
|
30
|
+
message += `\n⚠️ Low credits! Get more at https://framlit.com/pricing`;
|
|
31
|
+
}
|
|
32
|
+
if (userInfo.planTier === 'free' || userInfo.planTier === 'hobby') {
|
|
33
|
+
message += `\n\n💡 Upgrade to Pro for 500 credits/month and no watermark: https://framlit.com/pricing`;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: message,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function getPlanInfo(tier) {
|
|
45
|
+
switch (tier) {
|
|
46
|
+
case 'free':
|
|
47
|
+
return { name: 'Free' };
|
|
48
|
+
case 'hobby':
|
|
49
|
+
return { name: 'Hobby' };
|
|
50
|
+
case 'pro':
|
|
51
|
+
return { name: 'Pro' };
|
|
52
|
+
case 'team':
|
|
53
|
+
return { name: 'Team' };
|
|
54
|
+
default:
|
|
55
|
+
return { name: tier };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=credits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAeH,4CA6BC;AAvCY,QAAA,cAAc,GAAS;IAClC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,6CAA6C;IAC1D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC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,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC1B;YACE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Generation Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for generating and modifying Remotion video code.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FramlitClient } from '../api/client.js';
|
|
8
|
+
export declare const generateCodeTool: Tool;
|
|
9
|
+
export declare const modifyCodeTool: Tool;
|
|
10
|
+
export declare function handleGenerateCode(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
11
|
+
content: {
|
|
12
|
+
type: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
export declare function handleModifyCode(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
17
|
+
content: {
|
|
18
|
+
type: string;
|
|
19
|
+
text: string;
|
|
20
|
+
}[];
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/tools/generate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,EAAE,IA+B9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IAwB5B,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAe9B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAe9B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Code Generation Tools
|
|
4
|
+
*
|
|
5
|
+
* Tools for generating and modifying Remotion video code.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.modifyCodeTool = exports.generateCodeTool = void 0;
|
|
9
|
+
exports.handleGenerateCode = handleGenerateCode;
|
|
10
|
+
exports.handleModifyCode = handleModifyCode;
|
|
11
|
+
exports.generateCodeTool = {
|
|
12
|
+
name: 'framlit_generate_code',
|
|
13
|
+
description: `Generate Remotion video code from a text description.
|
|
14
|
+
Uses 1 credit per generation.
|
|
15
|
+
|
|
16
|
+
The generated code is a valid Remotion composition that can be:
|
|
17
|
+
- Previewed in browser
|
|
18
|
+
- Rendered to MP4 video
|
|
19
|
+
- Saved as a project
|
|
20
|
+
|
|
21
|
+
Supports various video types:
|
|
22
|
+
- Logo animations
|
|
23
|
+
- Product demos
|
|
24
|
+
- Social media content
|
|
25
|
+
- Data visualizations
|
|
26
|
+
- 3D animations`,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
prompt: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Description of the video to generate. Be specific about animations, colors, timing, and content.',
|
|
33
|
+
},
|
|
34
|
+
format: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
enum: ['landscape', 'portrait', 'square'],
|
|
37
|
+
description: 'Video format. Defaults to landscape (1920x1080).',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ['prompt'],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
exports.modifyCodeTool = {
|
|
44
|
+
name: 'framlit_modify_code',
|
|
45
|
+
description: `Modify existing Remotion code based on instructions.
|
|
46
|
+
Uses 1 credit per modification.
|
|
47
|
+
|
|
48
|
+
Use this to:
|
|
49
|
+
- Change colors, fonts, or sizes
|
|
50
|
+
- Adjust timing and animations
|
|
51
|
+
- Add or remove elements
|
|
52
|
+
- Fix issues in generated code`,
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
code: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'The existing Remotion code to modify.',
|
|
59
|
+
},
|
|
60
|
+
instruction: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Instructions for how to modify the code.',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: ['code', 'instruction'],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
async function handleGenerateCode(client, args) {
|
|
69
|
+
const prompt = args.prompt;
|
|
70
|
+
const format = args.format;
|
|
71
|
+
const result = await client.generateCode({ prompt, format });
|
|
72
|
+
return {
|
|
73
|
+
content: [
|
|
74
|
+
{
|
|
75
|
+
type: 'text',
|
|
76
|
+
text: `Generated Remotion code (${result.creditsUsed} credit used, ${result.creditsRemaining} remaining):\n\n\`\`\`tsx\n${result.code}\n\`\`\``,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async function handleModifyCode(client, args) {
|
|
82
|
+
const code = args.code;
|
|
83
|
+
const instruction = args.instruction;
|
|
84
|
+
const result = await client.modifyCode({ code, instruction });
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: 'text',
|
|
89
|
+
text: `Modified code (${result.creditsUsed} credit used, ${result.creditsRemaining} remaining):\n\n\`\`\`tsx\n${result.code}\n\`\`\``,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|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AAE,4BAA4B,MAAM,CAAC,WAAW,iBAAiB,MAAM,CAAC,gBAAgB,8BAA8B,MAAM,CAAC,IAAI,UAAU;aAChJ;SACF;KACF,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,gBAAgB,CACpC,MAAqB,EACrB,IAA6B;IAE7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;IACjC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAqB,CAAC;IAE/C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAE9D,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,kBAAkB,MAAM,CAAC,WAAW,iBAAiB,MAAM,CAAC,gBAAgB,8BAA8B,MAAM,CAAC,IAAI,UAAU;aACtI;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Management Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for managing Framlit projects.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FramlitClient } from '../api/client.js';
|
|
8
|
+
export declare const listProjectsTool: Tool;
|
|
9
|
+
export declare const getProjectTool: Tool;
|
|
10
|
+
export declare const createProjectTool: Tool;
|
|
11
|
+
export declare const updateProjectTool: Tool;
|
|
12
|
+
export declare function handleListProjects(client: FramlitClient): Promise<{
|
|
13
|
+
content: {
|
|
14
|
+
type: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}[];
|
|
17
|
+
}>;
|
|
18
|
+
export declare function handleGetProject(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
19
|
+
content: {
|
|
20
|
+
type: string;
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
}>;
|
|
24
|
+
export declare function handleCreateProject(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
25
|
+
content: {
|
|
26
|
+
type: string;
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
}>;
|
|
30
|
+
export declare function handleUpdateProject(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
31
|
+
content: {
|
|
32
|
+
type: string;
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,EAAE,IAQ9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IAa5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAuB/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAqB/B,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,aAAa;;;;;GA0B7D;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAa9B;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAgB9B;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GAgB9B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Project Management Tools
|
|
4
|
+
*
|
|
5
|
+
* Tools for managing Framlit projects.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.updateProjectTool = exports.createProjectTool = exports.getProjectTool = exports.listProjectsTool = void 0;
|
|
9
|
+
exports.handleListProjects = handleListProjects;
|
|
10
|
+
exports.handleGetProject = handleGetProject;
|
|
11
|
+
exports.handleCreateProject = handleCreateProject;
|
|
12
|
+
exports.handleUpdateProject = handleUpdateProject;
|
|
13
|
+
exports.listProjectsTool = {
|
|
14
|
+
name: 'framlit_list_projects',
|
|
15
|
+
description: 'List all your Framlit projects.',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {},
|
|
19
|
+
required: [],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
exports.getProjectTool = {
|
|
23
|
+
name: 'framlit_get_project',
|
|
24
|
+
description: 'Get details of a specific project including its code.',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
projectId: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'The project ID.',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
required: ['projectId'],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
exports.createProjectTool = {
|
|
37
|
+
name: 'framlit_create_project',
|
|
38
|
+
description: `Create a new Framlit project.
|
|
39
|
+
Projects store your video code and can be rendered to MP4.`,
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
name: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Name for the project.',
|
|
46
|
+
},
|
|
47
|
+
code: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Optional initial Remotion code.',
|
|
50
|
+
},
|
|
51
|
+
format: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
enum: ['landscape', 'portrait', 'square'],
|
|
54
|
+
description: 'Video format. Defaults to landscape.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ['name'],
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
exports.updateProjectTool = {
|
|
61
|
+
name: 'framlit_update_project',
|
|
62
|
+
description: 'Update an existing project.',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
projectId: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
description: 'The project ID.',
|
|
69
|
+
},
|
|
70
|
+
name: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'New name for the project.',
|
|
73
|
+
},
|
|
74
|
+
code: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'Updated Remotion code.',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['projectId'],
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
async function handleListProjects(client) {
|
|
83
|
+
const projects = await client.listProjects();
|
|
84
|
+
if (projects.length === 0) {
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: 'text',
|
|
89
|
+
text: 'No projects found. Create one with framlit_create_project.',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const list = projects
|
|
95
|
+
.map((p) => `- **${p.name}** (${p.id})\n Format: ${p.format}, Duration: ${p.duration}s\n Updated: ${p.updatedAt}`)
|
|
96
|
+
.join('\n\n');
|
|
97
|
+
return {
|
|
98
|
+
content: [
|
|
99
|
+
{
|
|
100
|
+
type: 'text',
|
|
101
|
+
text: `Found ${projects.length} project(s):\n\n${list}`,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
async function handleGetProject(client, args) {
|
|
107
|
+
const projectId = args.projectId;
|
|
108
|
+
const project = await client.getProject(projectId);
|
|
109
|
+
return {
|
|
110
|
+
content: [
|
|
111
|
+
{
|
|
112
|
+
type: 'text',
|
|
113
|
+
text: `**${project.name}**\n\nFormat: ${project.format}\nDuration: ${project.duration}s\nFPS: ${project.fps}\n\nCode:\n\`\`\`tsx\n${project.code}\n\`\`\``,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async function handleCreateProject(client, args) {
|
|
119
|
+
const name = args.name;
|
|
120
|
+
const code = args.code;
|
|
121
|
+
const format = args.format;
|
|
122
|
+
const project = await client.createProject({ name, code, format });
|
|
123
|
+
return {
|
|
124
|
+
content: [
|
|
125
|
+
{
|
|
126
|
+
type: 'text',
|
|
127
|
+
text: `Project created!\n\n**${project.name}** (${project.id})\n\nView at: https://framlit.com/dashboard/${project.id}`,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async function handleUpdateProject(client, args) {
|
|
133
|
+
const projectId = args.projectId;
|
|
134
|
+
const name = args.name;
|
|
135
|
+
const code = args.code;
|
|
136
|
+
const project = await client.updateProject(projectId, { name, code });
|
|
137
|
+
return {
|
|
138
|
+
content: [
|
|
139
|
+
{
|
|
140
|
+
type: 'text',
|
|
141
|
+
text: `Project updated!\n\n**${project.name}** (${project.id})\n\nView at: https://framlit.com/dashboard/${project.id}`,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA8EH,gDA0BC;AAED,4CAeC;AAED,kDAkBC;AAED,kDAkBC;AA5JY,QAAA,gBAAgB,GAAS;IACpC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEW,QAAA,cAAc,GAAS;IAClC,I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AAC;IAE9E,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAEnE,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,yBAAyB,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,EAAE,+CAA+C,OAAO,CAAC,EAAE,EAAE;aACxH;SACF;KACF,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,mBAAmB,CACvC,MAAqB,EACrB,IAA6B;IAE7B,MAAM,SAAS,GAAG,IAAI,CAAC,SAAmB,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,IAA0B,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,IAA0B,CAAC;IAE7C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAEtE,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,yBAAyB,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,EAAE,+CAA+C,OAAO,CAAC,EAAE,EAAE;aACxH;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Rendering Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for rendering videos via AWS Lambda.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FramlitClient } from '../api/client.js';
|
|
8
|
+
export declare const renderVideoTool: Tool;
|
|
9
|
+
export declare const getRenderStatusTool: Tool;
|
|
10
|
+
export declare function handleRenderVideo(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
11
|
+
content: {
|
|
12
|
+
type: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
isError: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
content: {
|
|
18
|
+
type: string;
|
|
19
|
+
text: string;
|
|
20
|
+
}[];
|
|
21
|
+
isError?: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function handleGetRenderStatus(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
24
|
+
content: {
|
|
25
|
+
type: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}[];
|
|
28
|
+
isError?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
content: {
|
|
31
|
+
type: string;
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
isError: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/tools/render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,eAAe,EAAE,IAiB7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,IAajC,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAyB9B;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAsC9B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Video Rendering Tools
|
|
4
|
+
*
|
|
5
|
+
* Tools for rendering videos via AWS Lambda.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getRenderStatusTool = exports.renderVideoTool = void 0;
|
|
9
|
+
exports.handleRenderVideo = handleRenderVideo;
|
|
10
|
+
exports.handleGetRenderStatus = handleGetRenderStatus;
|
|
11
|
+
exports.renderVideoTool = {
|
|
12
|
+
name: 'framlit_render_video',
|
|
13
|
+
description: `Start rendering a project to MP4 video.
|
|
14
|
+
Rendering is done on Framlit's servers (AWS Lambda).
|
|
15
|
+
|
|
16
|
+
Note: Free/Hobby plans include a watermark.
|
|
17
|
+
Upgrade to Pro to remove the watermark.`,
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
projectId: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'The project ID to render.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['projectId'],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
exports.getRenderStatusTool = {
|
|
30
|
+
name: 'framlit_get_render_status',
|
|
31
|
+
description: 'Check the status of a video render.',
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
renderId: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'The render ID returned from framlit_render_video.',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ['renderId'],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
async function handleRenderVideo(client, args) {
|
|
44
|
+
const projectId = args.projectId;
|
|
45
|
+
const result = await client.renderVideo(projectId);
|
|
46
|
+
if (result.status === 'failed') {
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: `Render failed: ${result.error}`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: `Render started!\n\nRender ID: ${result.renderId}\nStatus: ${result.status}\n\nUse framlit_get_render_status to check progress.`,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
async function handleGetRenderStatus(client, args) {
|
|
67
|
+
const renderId = args.renderId;
|
|
68
|
+
const result = await client.getRenderStatus(renderId);
|
|
69
|
+
if (result.status === 'completed' && result.downloadUrl) {
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: `Render completed!\n\nDownload: ${result.downloadUrl}`,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (result.status === 'failed') {
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `Render failed: ${result.error}`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
isError: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const progress = result.progress ? ` (${Math.round(result.progress * 100)}%)` : '';
|
|
91
|
+
return {
|
|
92
|
+
content: [
|
|
93
|
+
{
|
|
94
|
+
type: 'text',
|
|
95
|
+
text: `Render status: ${result.status}${progress}`,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/tools/render.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAuCH,8CA2BC;AAED,sDAwCC;AAvGY,QAAA,eAAe,GAAS;IACnC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE;;;;wCAIyB;IACtC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2BAA2B;a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AAI,EAAE,kCAAkC,MAAM,CAAC,WAAW,EAAE;iBAC7D;aACF;SACF,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,kBAAkB,MAAM,CAAC,KAAK,EAAE;iBACvC;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnF,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,kBAAkB,MAAM,CAAC,MAAM,GAAG,QAAQ,EAAE;aACnD;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Tools
|
|
3
|
+
*
|
|
4
|
+
* Tools for browsing Framlit templates.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FramlitClient } from '../api/client.js';
|
|
8
|
+
export declare const listTemplatesTool: Tool;
|
|
9
|
+
export declare function handleListTemplates(client: FramlitClient, args: Record<string, unknown>): Promise<{
|
|
10
|
+
content: {
|
|
11
|
+
type: string;
|
|
12
|
+
text: string;
|
|
13
|
+
}[];
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/tools/templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,IAkB/B,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;GA8B9B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Template Tools
|
|
4
|
+
*
|
|
5
|
+
* Tools for browsing Framlit templates.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.listTemplatesTool = void 0;
|
|
9
|
+
exports.handleListTemplates = handleListTemplates;
|
|
10
|
+
exports.listTemplatesTool = {
|
|
11
|
+
name: 'framlit_list_templates',
|
|
12
|
+
description: `Browse available video templates.
|
|
13
|
+
Templates can be used as starting points for your videos.`,
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
category: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Filter by category (e.g., "social", "product", "logo").',
|
|
20
|
+
},
|
|
21
|
+
official: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
description: 'If true, only show official Framlit templates. If false, show community templates.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: [],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
async function handleListTemplates(client, args) {
|
|
30
|
+
const category = args.category;
|
|
31
|
+
const official = args.official;
|
|
32
|
+
const templates = await client.listTemplates({ category, official });
|
|
33
|
+
if (templates.length === 0) {
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: 'No templates found matching your criteria.',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const list = templates
|
|
44
|
+
.map((t) => `- **${t.name}** ${t.isOfficial ? '(Official)' : '(Community)'}\n ${t.description}\n Category: ${t.category}`)
|
|
45
|
+
.join('\n\n');
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'text',
|
|
50
|
+
text: `Found ${templates.length} template(s):\n\n${list}\n\n💡 View all templates at https://framlit.com/marketplace`,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/tools/templates.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAyBH,kDAgCC;AApDY,QAAA,iBAAiB,GAAS;IACrC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE;0DAC2C;IACxD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,oFAAoF;aAClG;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEK,KAAK,UAAU,mBAAmB,CACvC,MAAqB,EACrB,IAA6B;IAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAA8B,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAA+B,CAAC;IAEtD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAErE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,4CAA4C;iBACnD;aACF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,SAAS;SACnB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,OAAO,CAAC,CAAC,WAAW,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC;SAC3H,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,SAAS,SAAS,CAAC,MAAM,oBAAoB,IAAI,8DAA8D;aACtH;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "framlit-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Framlit - AI-powered video generation",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"framlit-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "tsx watch src/index.ts",
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"lint": "eslint src/",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"mcp",
|
|
19
|
+
"framlit",
|
|
20
|
+
"remotion",
|
|
21
|
+
"video",
|
|
22
|
+
"ai",
|
|
23
|
+
"cursor"
|
|
24
|
+
],
|
|
25
|
+
"author": "Framlit",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
29
|
+
"zod": "^3.23.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.14.0",
|
|
33
|
+
"eslint": "^8.57.0",
|
|
34
|
+
"tsx": "^4.21.0",
|
|
35
|
+
"typescript": "^5.5.0"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/framlit/framlit-mcp.git"
|
|
47
|
+
}
|
|
48
|
+
}
|