@easingwizard/mcp-server 1.1.0 → 1.2.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/LICENSE +16 -0
- package/README.md +102 -155
- package/dist/http.d.ts +5 -0
- package/dist/http.js +7032 -0
- package/dist/index.js +7033 -28
- package/dist/server.d.ts +3 -0
- package/dist/server.js +7020 -0
- package/package.json +35 -20
package/LICENSE
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Copyright (c) 2025 Matthias Martin
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, modify, and distribute the Software, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The Software may be used in commercial or non-commercial projects, provided that the Software is not the primary selling point or core value of any commercial product or service.
|
|
6
|
+
The Software may not be sold, licensed, or distributed as a standalone product or as the main feature of a commercial offering.
|
|
7
|
+
Inclusion of the Software in a larger work is permitted, provided the larger work offers substantial additional functionality and value beyond the Software itself.
|
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
# Easing Wizard MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generate CSS easing curves from an AI coding assistant: Bézier, Spring, Bounce, Wiggle, and Overshoot. The seven tools use the same calculation library as [Easing Wizard](https://easingwizard.com), returning CSS, Tailwind classes, SVG geometry, and share links.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The stdio server calculates everything locally. It does not call the REST API, need an account, or write files. The same tools can also run behind the API's Streamable HTTP endpoint.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Bézier curves**: Create custom cubic Bézier curves with control points
|
|
9
|
-
- **Spring curves**: Physics-based spring animations with mass, stiffness, and damping
|
|
10
|
-
- **Bounce curves**: Bouncing animations with configurable bounces and damping
|
|
11
|
-
- **Wiggle curves**: Oscillating animations with configurable wiggles and damping
|
|
12
|
-
- **Overshoot curves**: Curves that overshoot the target before settling
|
|
7
|
+
## Requirements and release status
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
- Node.js **22.14 or later** for the local npm server.
|
|
10
|
+
- An MCP client supporting stdio or Streamable HTTP.
|
|
11
|
+
- This checkout targets MCP **2026-07-28**, with compatibility for clients using the 2025 `initialize` handshake.
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
The npm examples below run the latest **published** package. Publishing a new package and deploying the HTTP endpoint are separate release steps; use the local checkout instructions to test changes before release. For reproducible installations, replace `@easingwizard/mcp-server` with `@easingwizard/mcp-server@<published-version>`.
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
## Connect over stdio
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
17
|
+
The client launches and stops the process. A global npm installation or a separately running daemon is unnecessary.
|
|
18
|
+
|
|
19
|
+
### Codex
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
codex mcp add easingwizard -- npx -y @easingwizard/mcp-server
|
|
23
|
+
codex mcp list
|
|
29
24
|
```
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
Equivalent `~/.codex/config.toml` configuration:
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
```toml
|
|
29
|
+
[mcp_servers.easingwizard]
|
|
30
|
+
command = "npx"
|
|
31
|
+
args = ["-y", "@easingwizard/mcp-server"]
|
|
32
|
+
```
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"args": ["-y", "@easingwizard/mcp-server"]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
34
|
+
### Claude Code
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
claude mcp add --transport stdio --scope user easingwizard -- npx -y @easingwizard/mcp-server
|
|
38
|
+
claude mcp list
|
|
44
39
|
```
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
Run `/mcp` in Claude Code to check the connection. The [Claude plugin](../claude-plugin/README.md) adds workflows for recommending and auditing animation curves alongside the tools. Install either its bundled server or a standalone server entry to avoid duplicate tools.
|
|
42
|
+
|
|
43
|
+
### Claude Desktop
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
Add to `claude_desktop_config.json`, then restart the app:
|
|
49
46
|
|
|
50
47
|
```json
|
|
51
48
|
{
|
|
@@ -58,89 +55,70 @@ For other MCP-compatible applications, use the standard configuration format:
|
|
|
58
55
|
}
|
|
59
56
|
```
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
The MCP server provides the following tools for AI assistants:
|
|
64
|
-
|
|
65
|
-
### `getPresets`
|
|
66
|
-
|
|
67
|
-
Retrieves available preset easing curves, optionally filtered by type.
|
|
68
|
-
|
|
69
|
-
**Parameters:**
|
|
70
|
-
|
|
71
|
-
- `type` (optional): Filter by easing type (`BEZIER`, `SPRING`, `BOUNCE`, `WIGGLE`, `OVERSHOOT`)
|
|
58
|
+
### VS Code
|
|
72
59
|
|
|
73
|
-
|
|
60
|
+
Add to `.vscode/mcp.json`:
|
|
74
61
|
|
|
75
62
|
```json
|
|
76
63
|
{
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
64
|
+
"servers": {
|
|
65
|
+
"easingwizard": {
|
|
66
|
+
"type": "stdio",
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["-y", "@easingwizard/mcp-server"]
|
|
69
|
+
}
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
72
|
```
|
|
83
73
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Retrieves a specific easing curve by its unique ID.
|
|
74
|
+
Other clients use their own configuration format. The common launch command is `npx -y @easingwizard/mcp-server`; `mcpServers` is not a universal configuration key.
|
|
87
75
|
|
|
88
|
-
|
|
76
|
+
## Connect over HTTP
|
|
89
77
|
|
|
90
|
-
|
|
78
|
+
The API application mounts a stateless Streamable HTTP handler at `/mcp`. After starting the local API, connect with:
|
|
91
79
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
"name": "getCurveById",
|
|
97
|
-
"arguments": {
|
|
98
|
-
"id": "0a0d.25e.1f.75g.914"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
80
|
+
```sh
|
|
81
|
+
codex mcp add easingwizard-http --url http://127.0.0.1:3000/mcp
|
|
82
|
+
claude mcp add --transport http --scope user easingwizard-http http://127.0.0.1:3000/mcp
|
|
101
83
|
```
|
|
102
84
|
|
|
103
|
-
|
|
85
|
+
Use your deployed HTTPS `/mcp` URL for remote access. The planned public address is `https://api.easingwizard.com/mcp`; it becomes available after the API deployment and is not enabled merely by publishing the npm package. HTTP clients need no local Node.js installation. The REST endpoints themselves are not MCP endpoints.
|
|
104
86
|
|
|
105
|
-
|
|
87
|
+
The handler supports both protocol generations. It uses bounded requests (64 KiB), returns JSON for current-protocol tool requests, and does not hold sessions or subscriptions. The API host supplies Origin validation, CORS, and request rate limits. There is no authentication because these tools only calculate public curves and access no private account data.
|
|
106
88
|
|
|
107
|
-
|
|
89
|
+
To embed it in another fetch-based server:
|
|
108
90
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- `x2` (0-1): Second control point X coordinate
|
|
112
|
-
- `y2` (-1 to 2): Second control point Y coordinate
|
|
91
|
+
```ts
|
|
92
|
+
import { createEasingWizardMcpHandler } from '@easingwizard/mcp-server/http';
|
|
113
93
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{
|
|
118
|
-
"name": "createBezierCurve",
|
|
119
|
-
"arguments": {
|
|
120
|
-
"x1": 0.25,
|
|
121
|
-
"y1": 0.1,
|
|
122
|
-
"x2": 0.75,
|
|
123
|
-
"y2": 0.9
|
|
124
|
-
}
|
|
125
|
-
}
|
|
94
|
+
const mcp = createEasingWizardMcpHandler();
|
|
95
|
+
// Mount mcp.fetch(request) at /mcp behind Origin/Host checks and rate limits.
|
|
96
|
+
// Call await mcp.close() during shutdown.
|
|
126
97
|
```
|
|
127
98
|
|
|
128
|
-
|
|
99
|
+
`@easingwizard/mcp-server/server` also exports `createEasingWizardServer()` for hosts needing their own transport wiring.
|
|
129
100
|
|
|
130
|
-
|
|
101
|
+
## Tools
|
|
131
102
|
|
|
132
|
-
|
|
103
|
+
All tools are read-only and have no persistent side effects. Names are case-sensitive.
|
|
133
104
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
105
|
+
| Tool | Inputs |
|
|
106
|
+
| ------------------------ | ------------------------------------------------------------------------------ |
|
|
107
|
+
| `get_presets` | Optional `type`: `BEZIER`, `SPRING`, `BOUNCE`, `WIGGLE`, or `OVERSHOOT` |
|
|
108
|
+
| `get_curve_by_id` | `id`: curve ID returned by a tool or the visual editor |
|
|
109
|
+
| `create_bezier_curve` | `x1`, `x2`: 0–1; `y1`, `y2`: −1–2 |
|
|
110
|
+
| `create_spring_curve` | `mass`: 1–5; `stiffness`, `damping`: 0–100; `accuracy` |
|
|
111
|
+
| `create_bounce_curve` | `bounces`: 1–10; optional `mass`: 1–5, default 1; `damping`: 0–100; `accuracy` |
|
|
112
|
+
| `create_wiggle_curve` | `wiggles`: 1–10; optional `mass`: 1–5, default 1; `damping`: 0–100; `accuracy` |
|
|
113
|
+
| `create_overshoot_curve` | `style`: `IN`, `OUT`, or `IN_OUT`; `mass`: 1–5; `damping`: 0–100; `accuracy` |
|
|
138
114
|
|
|
139
|
-
|
|
115
|
+
`accuracy` is `LOW`, `MEDIUM`, `HIGH`, or `ULTRA`; use `HIGH` for normal UI animations. Tools advertise their complete input and output schemas. Invalid arguments or curve IDs produce `isError: true` results so the assistant can correct the request.
|
|
116
|
+
|
|
117
|
+
Example `tools/call` parameters:
|
|
140
118
|
|
|
141
119
|
```json
|
|
142
120
|
{
|
|
143
|
-
"name": "
|
|
121
|
+
"name": "create_spring_curve",
|
|
144
122
|
"arguments": {
|
|
145
123
|
"mass": 2.5,
|
|
146
124
|
"stiffness": 50,
|
|
@@ -150,84 +128,53 @@ Creates a spring-based easing curve with physics parameters.
|
|
|
150
128
|
}
|
|
151
129
|
```
|
|
152
130
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
Creates a bouncing easing curve.
|
|
156
|
-
|
|
157
|
-
**Parameters:**
|
|
158
|
-
|
|
159
|
-
- `bounces` (1-10): Number of bounces
|
|
160
|
-
- `damping` (0-100): Bounce damping
|
|
161
|
-
- `accuracy` (`LOW`, `MEDIUM`, `HIGH`, `ULTRA`): Calculation precision
|
|
162
|
-
|
|
163
|
-
### `createWiggleCurve`
|
|
164
|
-
|
|
165
|
-
Creates an oscillating wiggle curve.
|
|
166
|
-
|
|
167
|
-
**Parameters:**
|
|
168
|
-
|
|
169
|
-
- `wiggles` (1-10): Number of oscillations
|
|
170
|
-
- `damping` (0-100): Oscillation damping
|
|
171
|
-
- `accuracy` (`LOW`, `MEDIUM`, `HIGH`, `ULTRA`): Calculation precision
|
|
131
|
+
Curve responses contain:
|
|
172
132
|
|
|
173
|
-
|
|
133
|
+
- `output.css`: ready-to-use `cubic-bezier()` or `linear()`.
|
|
134
|
+
- `output.tailwind_css`: Tailwind arbitrary easing class.
|
|
135
|
+
- `output.svg_path` or `output.svg_polyline`: curve geometry.
|
|
136
|
+
- `output.suggested_duration_ms`: suggested duration range for non-Bézier curves.
|
|
137
|
+
- `id`, normalized `input`, `type`, `generated_at`, and `links.share_url`.
|
|
174
138
|
|
|
175
|
-
|
|
139
|
+
Results include `structuredContent` and a JSON text fallback. Filter `get_presets` by type when possible to keep its response small. A curve ID encodes parameters; it does not reference a database record.
|
|
176
140
|
|
|
177
|
-
|
|
141
|
+
Try: “Create a subtle spring easing for a dropdown, return the Tailwind class and a suggested duration.”
|
|
178
142
|
|
|
179
|
-
|
|
180
|
-
- `mass` (1-5): Mass parameter
|
|
181
|
-
- `damping` (0-100): Damping force
|
|
182
|
-
- `accuracy` (`LOW`, `MEDIUM`, `HIGH`, `ULTRA`): Calculation precision
|
|
143
|
+
## Local development and verification
|
|
183
144
|
|
|
184
|
-
|
|
145
|
+
From the repository root:
|
|
185
146
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
## Development
|
|
194
|
-
|
|
195
|
-
If you want to contribute or modify the server:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# Clone the repository
|
|
199
|
-
git clone https://github.com/roydigerhund/easingwizard.git
|
|
200
|
-
cd easingwizard/apps/mcp
|
|
201
|
-
|
|
202
|
-
# Install dependencies
|
|
203
|
-
pnpm install
|
|
204
|
-
|
|
205
|
-
# Build the server
|
|
206
|
-
pnpm build
|
|
147
|
+
```sh
|
|
148
|
+
pnpm install --frozen-lockfile
|
|
149
|
+
pnpm --filter easingwizard-core build
|
|
150
|
+
pnpm --filter @easingwizard/mcp-server build
|
|
151
|
+
pnpm --filter @easingwizard/mcp-server typecheck
|
|
152
|
+
pnpm --filter @easingwizard/mcp-server test
|
|
153
|
+
```
|
|
207
154
|
|
|
208
|
-
|
|
209
|
-
pnpm watch
|
|
155
|
+
Test a checkout directly, using its absolute path:
|
|
210
156
|
|
|
211
|
-
|
|
212
|
-
|
|
157
|
+
```sh
|
|
158
|
+
codex mcp add easingwizard-local -- node /absolute/path/to/easingwizard/apps/mcp/dist/index.js
|
|
213
159
|
```
|
|
214
160
|
|
|
215
|
-
|
|
161
|
+
For interactive inspection:
|
|
216
162
|
|
|
217
|
-
|
|
163
|
+
```sh
|
|
164
|
+
pnpm --filter @easingwizard/mcp-server inspect
|
|
165
|
+
```
|
|
218
166
|
|
|
219
|
-
-
|
|
220
|
-
- Malformed curve configurations
|
|
221
|
-
- MCP protocol errors
|
|
222
|
-
- Internal processing failures
|
|
167
|
+
The contract tests run real stdio clients and in-process HTTP clients for both protocol generations. They exercise all seven tools, validate outputs against the advertised JSON Schemas, reconstruct curves from IDs, check invalid arguments and recovery, and enforce HTTP body limits. Test clients close their child processes when finished.
|
|
223
168
|
|
|
224
|
-
|
|
169
|
+
The build bundles the shared curve library while keeping the SDK and Zod as runtime dependencies. The server identity derives its version from `package.json`. Keep `dist` built before testing or publishing; changes to the shared core require rebuilding it first. `prepack` rebuilds both packages for publication.
|
|
225
170
|
|
|
226
|
-
|
|
171
|
+
## Protocol references
|
|
227
172
|
|
|
228
|
-
|
|
173
|
+
- [MCP versioning](https://modelcontextprotocol.io/docs/2026-07-28/learn/versioning)
|
|
174
|
+
- [TypeScript SDK: stdio](https://ts.sdk.modelcontextprotocol.io/v2/serving/stdio.html)
|
|
175
|
+
- [TypeScript SDK: HTTP](https://ts.sdk.modelcontextprotocol.io/v2/serving/http.html)
|
|
176
|
+
- [Protocol migration and compatibility](https://ts.sdk.modelcontextprotocol.io/v2/migration/support-2026-07-28.html)
|
|
177
|
+
- [Codex MCP configuration](https://learn.chatgpt.com/docs/extend/mcp)
|
|
178
|
+
- [Claude Code MCP configuration](https://code.claude.com/docs/en/mcp)
|
|
229
179
|
|
|
230
|
-
|
|
231
|
-
- **Repository**: [GitHub](https://github.com/roydigerhund/easingwizard)
|
|
232
|
-
- **Issues**: [Report bugs](https://github.com/roydigerhund/easingwizard/issues)
|
|
233
|
-
- **MCP Protocol**: [Model Context Protocol](https://modelcontextprotocol.io)
|
|
180
|
+
See [LICENSE](LICENSE) for the project's license and commercial-use conditions.
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stateless Streamable HTTP handler for current and legacy MCP clients.
|
|
3
|
+
* The hosting application must apply Origin/Host validation and rate limits.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createEasingWizardMcpHandler(): import("@modelcontextprotocol/server").McpHttpHandler;
|