ai-react-animations 1.2.1 → 1.3.1
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 +30 -14
- package/dist/mcp/cli.js +274 -0
- package/dist/mcp/server.js +19386 -9
- package/mcp/cli.ts +324 -0
- package/mcp/server.ts +0 -1
- package/package.json +8 -7
- package/MCP-GUIDE.md +0 -390
- package/mcp-config.json +0 -8
package/MCP-GUIDE.md
DELETED
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
# MCP Server Setup Guide
|
|
2
|
-
|
|
3
|
-
This guide explains how to set up and use the AI React Animations MCP (Model Context Protocol) server with Claude Code or other AI assistants.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Table of Contents
|
|
8
|
-
|
|
9
|
-
1. [What is MCP?](#what-is-mcp)
|
|
10
|
-
2. [Prerequisites](#prerequisites)
|
|
11
|
-
3. [Installation](#installation)
|
|
12
|
-
4. [Configuration](#configuration)
|
|
13
|
-
5. [Available Tools](#available-tools)
|
|
14
|
-
6. [Usage Examples](#usage-examples)
|
|
15
|
-
7. [Troubleshooting](#troubleshooting)
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## What is MCP?
|
|
20
|
-
|
|
21
|
-
MCP (Model Context Protocol) is a standard that allows AI assistants like Claude to interact with external tools and services. With the AI React Animations MCP server, you can ask Claude to:
|
|
22
|
-
|
|
23
|
-
- List all available animation components
|
|
24
|
-
- Get detailed information about any component
|
|
25
|
-
- Add components to your project with proper source code
|
|
26
|
-
- Get installation commands for dependencies
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Prerequisites
|
|
31
|
-
|
|
32
|
-
Before setting up the MCP server, make sure you have:
|
|
33
|
-
|
|
34
|
-
- **Node.js** version 18 or higher
|
|
35
|
-
- **npm** (comes with Node.js)
|
|
36
|
-
- **Claude Code** or another MCP-compatible AI assistant
|
|
37
|
-
|
|
38
|
-
To check your Node.js version:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
node --version
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Installation
|
|
47
|
-
|
|
48
|
-
### Step 1: Install the package
|
|
49
|
-
|
|
50
|
-
Open your terminal and run:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npm install ai-react-animations
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
This installs the animation components AND the MCP server.
|
|
57
|
-
|
|
58
|
-
### Step 2: Install tsx (TypeScript executor)
|
|
59
|
-
|
|
60
|
-
The MCP server is written in TypeScript. Install tsx to run it:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
npm install -g tsx
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Or install it locally in your project:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npm install tsx --save-dev
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Configuration
|
|
75
|
-
|
|
76
|
-
### Step 1: Find your MCP configuration file
|
|
77
|
-
|
|
78
|
-
The MCP configuration file is named `.mcp.json` and is located in:
|
|
79
|
-
|
|
80
|
-
- **macOS/Linux**: `~/.mcp.json` (your home directory)
|
|
81
|
-
- **Windows**: `C:\Users\YourUsername\.mcp.json`
|
|
82
|
-
|
|
83
|
-
If the file doesn't exist, create it.
|
|
84
|
-
|
|
85
|
-
### Step 2: Add the MCP server configuration
|
|
86
|
-
|
|
87
|
-
Open `.mcp.json` in a text editor and add:
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"mcpServers": {
|
|
92
|
-
"ai-react-animations": {
|
|
93
|
-
"command": "npx",
|
|
94
|
-
"args": ["tsx", "node_modules/ai-react-animations/mcp/server.ts"]
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Step 3: If you already have other MCP servers
|
|
101
|
-
|
|
102
|
-
Add the `ai-react-animations` entry to your existing `mcpServers` object:
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"mcpServers": {
|
|
107
|
-
"your-existing-server": {
|
|
108
|
-
"command": "...",
|
|
109
|
-
"args": ["..."]
|
|
110
|
-
},
|
|
111
|
-
"ai-react-animations": {
|
|
112
|
-
"command": "npx",
|
|
113
|
-
"args": ["tsx", "node_modules/ai-react-animations/mcp/server.ts"]
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Step 4: Restart Claude Code
|
|
120
|
-
|
|
121
|
-
After saving the configuration:
|
|
122
|
-
|
|
123
|
-
1. Close Claude Code completely
|
|
124
|
-
2. Reopen Claude Code
|
|
125
|
-
3. The MCP server will now be available
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## Available Tools
|
|
130
|
-
|
|
131
|
-
The MCP server provides 4 tools:
|
|
132
|
-
|
|
133
|
-
### 1. `list_components`
|
|
134
|
-
|
|
135
|
-
Lists all available animation components.
|
|
136
|
-
|
|
137
|
-
**Parameters:**
|
|
138
|
-
| Parameter | Type | Required | Description |
|
|
139
|
-
|-----------|------|----------|-------------|
|
|
140
|
-
| `category` | string | No | Filter by category: `all`, `loading`, `processing`, `creative`, `auth` |
|
|
141
|
-
|
|
142
|
-
**Example response:**
|
|
143
|
-
```json
|
|
144
|
-
{
|
|
145
|
-
"total": 7,
|
|
146
|
-
"categories": ["all", "loading", "processing", "creative", "auth"],
|
|
147
|
-
"components": [
|
|
148
|
-
{
|
|
149
|
-
"name": "LoadingDots",
|
|
150
|
-
"id": "loading-dots",
|
|
151
|
-
"category": "loading",
|
|
152
|
-
"description": "Simple, elegant bouncing dots animation."
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
### 2. `get_component`
|
|
161
|
-
|
|
162
|
-
Gets detailed information about a specific component, including source code.
|
|
163
|
-
|
|
164
|
-
**Parameters:**
|
|
165
|
-
| Parameter | Type | Required | Description |
|
|
166
|
-
|-----------|------|----------|-------------|
|
|
167
|
-
| `name` | string | Yes | Component name or ID (e.g., `LoadingDots`, `loading-dots`) |
|
|
168
|
-
|
|
169
|
-
**Example response:**
|
|
170
|
-
```json
|
|
171
|
-
{
|
|
172
|
-
"name": "LoadingDots",
|
|
173
|
-
"id": "loading-dots",
|
|
174
|
-
"description": "Simple, elegant bouncing dots animation.",
|
|
175
|
-
"category": "loading",
|
|
176
|
-
"dependencies": ["framer-motion"],
|
|
177
|
-
"props": [...],
|
|
178
|
-
"usage": "...",
|
|
179
|
-
"source": "// Full component source code"
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
### 3. `add_component`
|
|
186
|
-
|
|
187
|
-
Gets instructions and source code to add a component to your project.
|
|
188
|
-
|
|
189
|
-
**Parameters:**
|
|
190
|
-
| Parameter | Type | Required | Description |
|
|
191
|
-
|-----------|------|----------|-------------|
|
|
192
|
-
| `name` | string | Yes | Component name or ID |
|
|
193
|
-
| `directory` | string | No | Target directory (default: `./components`) |
|
|
194
|
-
|
|
195
|
-
**Example response:**
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"success": true,
|
|
199
|
-
"component": "LoadingDots",
|
|
200
|
-
"filePath": "./components/LoadingDots.tsx",
|
|
201
|
-
"source": "// Component source code",
|
|
202
|
-
"dependencies": ["framer-motion"],
|
|
203
|
-
"installCommand": "npm install framer-motion",
|
|
204
|
-
"instructions": "1. Create the file..."
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
### 4. `get_install_command`
|
|
211
|
-
|
|
212
|
-
Gets the npm install command for a component's dependencies.
|
|
213
|
-
|
|
214
|
-
**Parameters:**
|
|
215
|
-
| Parameter | Type | Required | Description |
|
|
216
|
-
|-----------|------|----------|-------------|
|
|
217
|
-
| `name` | string | Yes | Component name or ID |
|
|
218
|
-
|
|
219
|
-
**Example response:**
|
|
220
|
-
```
|
|
221
|
-
npm install framer-motion
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## Usage Examples
|
|
227
|
-
|
|
228
|
-
Once the MCP server is configured, you can use natural language with Claude:
|
|
229
|
-
|
|
230
|
-
### Example 1: List all components
|
|
231
|
-
|
|
232
|
-
**You say:**
|
|
233
|
-
> "What animation components are available?"
|
|
234
|
-
|
|
235
|
-
**Claude will:**
|
|
236
|
-
1. Call the `list_components` tool
|
|
237
|
-
2. Show you a list of all 7 components with descriptions
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### Example 2: Get component details
|
|
242
|
-
|
|
243
|
-
**You say:**
|
|
244
|
-
> "Show me details about the PulseCircle component"
|
|
245
|
-
|
|
246
|
-
**Claude will:**
|
|
247
|
-
1. Call `get_component` with `name: "PulseCircle"`
|
|
248
|
-
2. Show you the props, usage example, and description
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
### Example 3: Add a component to your project
|
|
253
|
-
|
|
254
|
-
**You say:**
|
|
255
|
-
> "Add the LoadingDots component to my project in the components folder"
|
|
256
|
-
|
|
257
|
-
**Claude will:**
|
|
258
|
-
1. Call `add_component` with `name: "LoadingDots"` and `directory: "./components"`
|
|
259
|
-
2. Create the file `./components/LoadingDots.tsx` with the full source code
|
|
260
|
-
3. Tell you to run `npm install framer-motion`
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
### Example 4: Filter by category
|
|
265
|
-
|
|
266
|
-
**You say:**
|
|
267
|
-
> "Show me all loading animation components"
|
|
268
|
-
|
|
269
|
-
**Claude will:**
|
|
270
|
-
1. Call `list_components` with `category: "loading"`
|
|
271
|
-
2. Show you only the loading-related components
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
### Example 5: Add multiple components
|
|
276
|
-
|
|
277
|
-
**You say:**
|
|
278
|
-
> "Add LoadingDots and PulseCircle to my components folder"
|
|
279
|
-
|
|
280
|
-
**Claude will:**
|
|
281
|
-
1. Call `add_component` twice
|
|
282
|
-
2. Create both component files
|
|
283
|
-
3. Give you the combined install command
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
## Troubleshooting
|
|
288
|
-
|
|
289
|
-
### Problem: "MCP server not found"
|
|
290
|
-
|
|
291
|
-
**Solution:**
|
|
292
|
-
1. Make sure you installed the package: `npm install ai-react-animations`
|
|
293
|
-
2. Check that `.mcp.json` is in the correct location
|
|
294
|
-
3. Restart Claude Code
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
298
|
-
### Problem: "tsx: command not found"
|
|
299
|
-
|
|
300
|
-
**Solution:**
|
|
301
|
-
Install tsx globally:
|
|
302
|
-
```bash
|
|
303
|
-
npm install -g tsx
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
### Problem: "Cannot find module"
|
|
309
|
-
|
|
310
|
-
**Solution:**
|
|
311
|
-
Make sure you're in a directory where `node_modules/ai-react-animations` exists:
|
|
312
|
-
```bash
|
|
313
|
-
ls node_modules/ai-react-animations
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
If not, install the package:
|
|
317
|
-
```bash
|
|
318
|
-
npm install ai-react-animations
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
### Problem: "Permission denied"
|
|
324
|
-
|
|
325
|
-
**Solution (macOS/Linux):**
|
|
326
|
-
```bash
|
|
327
|
-
chmod +x node_modules/ai-react-animations/mcp/server.ts
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
### Problem: MCP server doesn't respond
|
|
333
|
-
|
|
334
|
-
**Solution:**
|
|
335
|
-
1. Test the server manually:
|
|
336
|
-
```bash
|
|
337
|
-
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npx tsx node_modules/ai-react-animations/mcp/server.ts
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
2. You should see a JSON response with the tools list
|
|
341
|
-
|
|
342
|
-
---
|
|
343
|
-
|
|
344
|
-
## Component Categories
|
|
345
|
-
|
|
346
|
-
| Category | Components | Use Case |
|
|
347
|
-
|----------|-----------|----------|
|
|
348
|
-
| **loading** | LoadingDots | Simple loading indicators |
|
|
349
|
-
| **processing** | PulseCircle, DataProcessing | Progress and data flow |
|
|
350
|
-
| **creative** | AiCreating, AiCreating2, CodeTyping | AI-themed animations |
|
|
351
|
-
| **auth** | FloatingLogin | Authentication UI |
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## Need Help?
|
|
356
|
-
|
|
357
|
-
- **GitHub Issues**: [github.com/johnbekele/ai-react-animations/issues](https://github.com/johnbekele/ai-react-animations/issues)
|
|
358
|
-
- **npm Package**: [npmjs.com/package/ai-react-animations](https://www.npmjs.com/package/ai-react-animations)
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## Quick Reference Card
|
|
363
|
-
|
|
364
|
-
```
|
|
365
|
-
┌─────────────────────────────────────────────────────────┐
|
|
366
|
-
│ AI React Animations - MCP Quick Reference │
|
|
367
|
-
├─────────────────────────────────────────────────────────┤
|
|
368
|
-
│ │
|
|
369
|
-
│ SETUP: │
|
|
370
|
-
│ 1. npm install ai-react-animations │
|
|
371
|
-
│ 2. Add to ~/.mcp.json │
|
|
372
|
-
│ 3. Restart Claude Code │
|
|
373
|
-
│ │
|
|
374
|
-
│ ASK CLAUDE: │
|
|
375
|
-
│ • "List animation components" │
|
|
376
|
-
│ • "Add LoadingDots to my project" │
|
|
377
|
-
│ • "Show me PulseCircle details" │
|
|
378
|
-
│ • "What dependencies does FloatingLogin need?" │
|
|
379
|
-
│ │
|
|
380
|
-
│ COMPONENTS: │
|
|
381
|
-
│ • LoadingDots - Bouncing dots │
|
|
382
|
-
│ • PulseCircle - Progress circle │
|
|
383
|
-
│ • CodeTyping - Code typing effect │
|
|
384
|
-
│ • DataProcessing - Pipeline visualization │
|
|
385
|
-
│ • AiCreating - Robot animation │
|
|
386
|
-
│ • AiCreating2 - Brain animation │
|
|
387
|
-
│ • FloatingLogin - Auth form │
|
|
388
|
-
│ │
|
|
389
|
-
└─────────────────────────────────────────────────────────┘
|
|
390
|
-
```
|