ai-react-animations 1.2.0 → 1.2.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/MCP-GUIDE.md +390 -0
- package/README.md +154 -50
- package/package.json +2 -1
package/MCP-GUIDE.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
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
|
+
```
|
package/README.md
CHANGED
|
@@ -1,84 +1,188 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI React Animations
|
|
2
2
|
|
|
3
|
-
Beautiful AI loading animation components for React/Next.js.
|
|
3
|
+
Beautiful AI loading and animation components for React/Next.js. Production-ready components for AI interfaces with MCP (Model Context Protocol) server support.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/ai-react-animations)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 7 production-ready animation components
|
|
11
|
+
- TypeScript support
|
|
12
|
+
- Framer Motion animations
|
|
13
|
+
- MCP Server for AI assistants (Claude, etc.)
|
|
14
|
+
- Customizable colors and sizes
|
|
15
|
+
- Dark/Light mode support
|
|
16
|
+
- Responsive design
|
|
4
17
|
|
|
5
18
|
## Installation
|
|
6
19
|
|
|
7
20
|
```bash
|
|
8
|
-
npm install ai-react-animations
|
|
21
|
+
npm install ai-react-animations framer-motion lucide-react
|
|
9
22
|
```
|
|
10
23
|
|
|
11
|
-
##
|
|
24
|
+
## Available Components
|
|
25
|
+
|
|
26
|
+
| Component | Category | Description |
|
|
27
|
+
|-----------|----------|-------------|
|
|
28
|
+
| `LoadingDots` | Loading | Simple bouncing dots animation |
|
|
29
|
+
| `PulseCircle` | Processing | Circular progress with pulse rings |
|
|
30
|
+
| `CodeTyping` | Creative | Code typing effect with syntax colors |
|
|
31
|
+
| `DataProcessing` | Processing | Data pipeline visualization |
|
|
32
|
+
| `AiCreating` | Creative | Multi-stage AI robot animation |
|
|
33
|
+
| `AiCreating2` | Creative | AI brain with rotating rings |
|
|
34
|
+
| `FloatingLogin` | Auth | Floating login form with OAuth |
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
12
37
|
|
|
13
38
|
```tsx
|
|
14
|
-
import
|
|
15
|
-
import 'ai-react-animations/styles.css';
|
|
39
|
+
import { LoadingDots } from 'ai-react-animations';
|
|
16
40
|
|
|
17
41
|
function MyComponent() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<AiCreating
|
|
22
|
-
isLoading={isLoading}
|
|
23
|
-
size="md"
|
|
24
|
-
onComplete={() => console.log('Done!')}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
42
|
+
return <LoadingDots size="md" color="#6366F1" />;
|
|
27
43
|
}
|
|
28
44
|
```
|
|
29
45
|
|
|
30
|
-
##
|
|
46
|
+
## Component Examples
|
|
47
|
+
|
|
48
|
+
### LoadingDots
|
|
31
49
|
|
|
50
|
+
```tsx
|
|
51
|
+
import { LoadingDots } from 'ai-react-animations';
|
|
52
|
+
|
|
53
|
+
<LoadingDots size="md" color="#6366F1" />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Props:**
|
|
32
57
|
| Prop | Type | Default | Description |
|
|
33
58
|
|------|------|---------|-------------|
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `onComplete` | `() => void` | - | Callback when animation completes |
|
|
59
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size of the dots |
|
|
60
|
+
| `color` | `string` | `'#6366F1'` | Color of the dots |
|
|
37
61
|
|
|
38
|
-
|
|
62
|
+
### PulseCircle
|
|
39
63
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- `md` - 240px height (default)
|
|
43
|
-
- `lg` - 340px height (for large displays)
|
|
44
|
-
- `full` - 100% height (fills container)
|
|
64
|
+
```tsx
|
|
65
|
+
import { PulseCircle } from 'ai-react-animations';
|
|
45
66
|
|
|
46
|
-
|
|
67
|
+
const [isActive, setIsActive] = useState(false);
|
|
47
68
|
|
|
48
|
-
|
|
69
|
+
<PulseCircle
|
|
70
|
+
isActive={isActive}
|
|
71
|
+
onComplete={() => setIsActive(false)}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
49
74
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
75
|
+
**Props:**
|
|
76
|
+
| Prop | Type | Default | Description |
|
|
77
|
+
|------|------|---------|-------------|
|
|
78
|
+
| `isActive` | `boolean` | required | Activates the animation |
|
|
79
|
+
| `progress` | `number` | - | External progress (0-100) |
|
|
80
|
+
| `onComplete` | `() => void` | - | Callback at 100% |
|
|
54
81
|
|
|
55
|
-
|
|
82
|
+
### AiCreating2
|
|
56
83
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
84
|
+
```tsx
|
|
85
|
+
import { AiCreating2 } from 'ai-react-animations';
|
|
86
|
+
|
|
87
|
+
<AiCreating2
|
|
88
|
+
isLoading={isLoading}
|
|
89
|
+
message="Creating your plan..."
|
|
90
|
+
primaryColor="#6366F1"
|
|
91
|
+
backgroundColor="#0f172a"
|
|
92
|
+
contained={true}
|
|
93
|
+
onComplete={() => setIsLoading(false)}
|
|
94
|
+
/>
|
|
95
|
+
```
|
|
62
96
|
|
|
63
|
-
|
|
97
|
+
**Props:**
|
|
98
|
+
| Prop | Type | Default | Description |
|
|
99
|
+
|------|------|---------|-------------|
|
|
100
|
+
| `isLoading` | `boolean` | required | Controls visibility |
|
|
101
|
+
| `message` | `string` | `'AI is creating...'` | Main message |
|
|
102
|
+
| `subMessage` | `string` | - | Secondary text |
|
|
103
|
+
| `primaryColor` | `string` | `'#6366F1'` | Accent color |
|
|
104
|
+
| `backgroundColor` | `string` | `'#0f172a'` | Background color |
|
|
105
|
+
| `textColor` | `string` | `'#ffffff'` | Text color |
|
|
106
|
+
| `contained` | `boolean` | `false` | Render in container vs overlay |
|
|
107
|
+
| `onComplete` | `() => void` | - | Completion callback |
|
|
108
|
+
|
|
109
|
+
### FloatingLogin
|
|
64
110
|
|
|
65
111
|
```tsx
|
|
66
|
-
|
|
112
|
+
import { FloatingLogin } from 'ai-react-animations';
|
|
113
|
+
|
|
114
|
+
<FloatingLogin
|
|
115
|
+
mode="dark"
|
|
116
|
+
primaryColor="#6366F1"
|
|
117
|
+
floatIntensity={5}
|
|
118
|
+
onLogin={(data) => console.log(data)}
|
|
119
|
+
onGoogleLogin={() => signInWithGoogle()}
|
|
120
|
+
onAppleLogin={() => signInWithApple()}
|
|
121
|
+
/>
|
|
122
|
+
```
|
|
67
123
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
124
|
+
**Props:**
|
|
125
|
+
| Prop | Type | Default | Description |
|
|
126
|
+
|------|------|---------|-------------|
|
|
127
|
+
| `mode` | `'light' \| 'dark'` | `'light'` | Theme mode |
|
|
128
|
+
| `primaryColor` | `string` | `'#6366F1'` | Accent color |
|
|
129
|
+
| `floatingEnabled` | `boolean` | `true` | Enable floating animation |
|
|
130
|
+
| `floatIntensity` | `number` | `5` | Float intensity (1-10) |
|
|
131
|
+
| `onLogin` | `(data) => void` | - | Login callback |
|
|
132
|
+
| `onGoogleLogin` | `() => void` | - | Google OAuth callback |
|
|
133
|
+
| `onAppleLogin` | `() => void` | - | Apple Sign-In callback |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## MCP Server (For AI Assistants)
|
|
138
|
+
|
|
139
|
+
This package includes an MCP (Model Context Protocol) server that allows AI assistants like Claude to help users add animation components to their projects.
|
|
140
|
+
|
|
141
|
+
### Quick Setup
|
|
142
|
+
|
|
143
|
+
Add to your `.mcp.json` file:
|
|
73
144
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"ai-react-animations": {
|
|
149
|
+
"command": "npx",
|
|
150
|
+
"args": ["tsx", "node_modules/ai-react-animations/mcp/server.ts"]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
80
154
|
```
|
|
81
155
|
|
|
156
|
+
### Available MCP Tools
|
|
157
|
+
|
|
158
|
+
| Tool | Description |
|
|
159
|
+
|------|-------------|
|
|
160
|
+
| `list_components` | List all available components |
|
|
161
|
+
| `get_component` | Get component details and source code |
|
|
162
|
+
| `add_component` | Get instructions to add a component |
|
|
163
|
+
| `get_install_command` | Get npm install command |
|
|
164
|
+
|
|
165
|
+
### Usage with Claude
|
|
166
|
+
|
|
167
|
+
Once configured, you can ask Claude:
|
|
168
|
+
- "List all animation components"
|
|
169
|
+
- "Add the LoadingDots component to my project"
|
|
170
|
+
- "Show me the PulseCircle component details"
|
|
171
|
+
- "What dependencies do I need for FloatingLogin?"
|
|
172
|
+
|
|
173
|
+
For detailed MCP setup instructions, see [MCP-GUIDE.md](./MCP-GUIDE.md).
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
82
177
|
## License
|
|
83
178
|
|
|
84
179
|
MIT
|
|
180
|
+
|
|
181
|
+
## Author
|
|
182
|
+
|
|
183
|
+
johnbekele
|
|
184
|
+
|
|
185
|
+
## Links
|
|
186
|
+
|
|
187
|
+
- [npm package](https://www.npmjs.com/package/ai-react-animations)
|
|
188
|
+
- [GitHub repository](https://github.com/johnbekele/ai-react-animations)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-react-animations",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Beautiful AI loading animation components for React/Next.js with MCP server support.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dist",
|
|
22
22
|
"mcp",
|
|
23
23
|
"mcp-config.json",
|
|
24
|
+
"MCP-GUIDE.md",
|
|
24
25
|
"README.md",
|
|
25
26
|
"LICENSE"
|
|
26
27
|
],
|