@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 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
- A Model Context Protocol (MCP) server for the [Easing Wizard](https://easingwizard.com). This server enables AI assistants to generate various CSS easing curves: Bézier, Spring, Bounce, Wiggle, and Overshoot.
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
- ## Features
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
- - **Preset curves**: Access predefined easing curves filtered by type
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
- ## Setup
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
- ### Claude Desktop
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
- Add to your `claude_desktop_config.json`:
15
+ ## Connect over stdio
19
16
 
20
- ```json
21
- {
22
- "mcpServers": {
23
- "easingwizard": {
24
- "command": "npx",
25
- "args": ["-y", "@easingwizard/mcp-server"]
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
- ### VS Code
26
+ Equivalent `~/.codex/config.toml` configuration:
32
27
 
33
- Add to your MCP configuration `.vscode/mcp.json`:
28
+ ```toml
29
+ [mcp_servers.easingwizard]
30
+ command = "npx"
31
+ args = ["-y", "@easingwizard/mcp-server"]
32
+ ```
34
33
 
35
- ```json
36
- {
37
- "servers": {
38
- "easingwizard": {
39
- "command": "npx",
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
- ### Other MCP Clients
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
- For other MCP-compatible applications, use the standard configuration format:
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
- ## Available Tools
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
- **Example:**
60
+ Add to `.vscode/mcp.json`:
74
61
 
75
62
  ```json
76
63
  {
77
- "name": "getPresets",
78
- "arguments": {
79
- "type": "BEZIER"
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
- ### `getCurveById`
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
- **Parameters:**
76
+ ## Connect over HTTP
89
77
 
90
- - `id` (required): The unique ID of the easing curve
78
+ The API application mounts a stateless Streamable HTTP handler at `/mcp`. After starting the local API, connect with:
91
79
 
92
- **Example:**
93
-
94
- ```json
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
- ### `createBezierCurve`
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
- Creates a custom cubic Bézier easing curve.
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
- **Parameters:**
89
+ To embed it in another fetch-based server:
108
90
 
109
- - `x1` (0-1): First control point X coordinate
110
- - `y1` (-1 to 2): First control point Y coordinate
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
- **Example:**
115
-
116
- ```json
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
- ### `createSpringCurve`
99
+ `@easingwizard/mcp-server/server` also exports `createEasingWizardServer()` for hosts needing their own transport wiring.
129
100
 
130
- Creates a spring-based easing curve with physics parameters.
101
+ ## Tools
131
102
 
132
- **Parameters:**
103
+ All tools are read-only and have no persistent side effects. Names are case-sensitive.
133
104
 
134
- - `mass` (1-5): Mass of the spring system
135
- - `stiffness` (0-100): Spring stiffness
136
- - `damping` (0-100): Damping force
137
- - `accuracy` (`LOW`, `MEDIUM`, `HIGH`, `ULTRA`): Calculation precision
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
- **Example:**
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": "createSpringCurve",
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
- ### `createBounceCurve`
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
- ### `createOvershootCurve`
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
- Creates an overshoot easing curve.
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
- **Parameters:**
141
+ Try: “Create a subtle spring easing for a dropdown, return the Tailwind class and a suggested duration.”
178
142
 
179
- - `style` (`IN`, `OUT`, `IN_OUT`): Animation style
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
- ## Output Formats
145
+ From the repository root:
185
146
 
186
- All easing curve tools return comprehensive data including:
187
-
188
- - **CSS Functions**: Ready-to-use `cubic-bezier()` or `linear()` functions
189
- - **Tailwind CSS**: Compatible easing class names
190
- - **SVG Paths**: Vector graphics for curve visualization
191
- - **Metadata**: Unique IDs, timestamps, and reference links
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
- # Test the server
209
- pnpm watch
155
+ Test a checkout directly, using its absolute path:
210
156
 
211
- # Inspect the MCP tool
212
- pnpm inspect
157
+ ```sh
158
+ codex mcp add easingwizard-local -- node /absolute/path/to/easingwizard/apps/mcp/dist/index.js
213
159
  ```
214
160
 
215
- ## Error Handling
161
+ For interactive inspection:
216
162
 
217
- The server provides detailed error messages for:
163
+ ```sh
164
+ pnpm --filter @easingwizard/mcp-server inspect
165
+ ```
218
166
 
219
- - Invalid parameter ranges or types
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
- ## License
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
- MIT License - see [LICENSE](LICENSE) file for details.
171
+ ## Protocol references
227
172
 
228
- ## Links
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
- - **Website**: [Easing Wizard](https://easingwizard.com)
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;