@easingwizard/mcp-server 1.0.7 → 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 +180 -0
- 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/Readme.md +0 -233
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
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Easing Wizard MCP Server
|
|
2
|
+
|
|
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
|
+
|
|
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
|
+
|
|
7
|
+
## Requirements and release status
|
|
8
|
+
|
|
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.
|
|
12
|
+
|
|
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>`.
|
|
14
|
+
|
|
15
|
+
## Connect over stdio
|
|
16
|
+
|
|
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
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Equivalent `~/.codex/config.toml` configuration:
|
|
27
|
+
|
|
28
|
+
```toml
|
|
29
|
+
[mcp_servers.easingwizard]
|
|
30
|
+
command = "npx"
|
|
31
|
+
args = ["-y", "@easingwizard/mcp-server"]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Claude Code
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
claude mcp add --transport stdio --scope user easingwizard -- npx -y @easingwizard/mcp-server
|
|
38
|
+
claude mcp list
|
|
39
|
+
```
|
|
40
|
+
|
|
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
|
|
44
|
+
|
|
45
|
+
Add to `claude_desktop_config.json`, then restart the app:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"easingwizard": {
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["-y", "@easingwizard/mcp-server"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### VS Code
|
|
59
|
+
|
|
60
|
+
Add to `.vscode/mcp.json`:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"servers": {
|
|
65
|
+
"easingwizard": {
|
|
66
|
+
"type": "stdio",
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["-y", "@easingwizard/mcp-server"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
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.
|
|
75
|
+
|
|
76
|
+
## Connect over HTTP
|
|
77
|
+
|
|
78
|
+
The API application mounts a stateless Streamable HTTP handler at `/mcp`. After starting the local API, connect with:
|
|
79
|
+
|
|
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
|
|
83
|
+
```
|
|
84
|
+
|
|
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.
|
|
86
|
+
|
|
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.
|
|
88
|
+
|
|
89
|
+
To embed it in another fetch-based server:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { createEasingWizardMcpHandler } from '@easingwizard/mcp-server/http';
|
|
93
|
+
|
|
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.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`@easingwizard/mcp-server/server` also exports `createEasingWizardServer()` for hosts needing their own transport wiring.
|
|
100
|
+
|
|
101
|
+
## Tools
|
|
102
|
+
|
|
103
|
+
All tools are read-only and have no persistent side effects. Names are case-sensitive.
|
|
104
|
+
|
|
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` |
|
|
114
|
+
|
|
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:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"name": "create_spring_curve",
|
|
122
|
+
"arguments": {
|
|
123
|
+
"mass": 2.5,
|
|
124
|
+
"stiffness": 50,
|
|
125
|
+
"damping": 50,
|
|
126
|
+
"accuracy": "HIGH"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Curve responses contain:
|
|
132
|
+
|
|
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`.
|
|
138
|
+
|
|
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.
|
|
140
|
+
|
|
141
|
+
Try: “Create a subtle spring easing for a dropdown, return the Tailwind class and a suggested duration.”
|
|
142
|
+
|
|
143
|
+
## Local development and verification
|
|
144
|
+
|
|
145
|
+
From the repository root:
|
|
146
|
+
|
|
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
|
+
```
|
|
154
|
+
|
|
155
|
+
Test a checkout directly, using its absolute path:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
codex mcp add easingwizard-local -- node /absolute/path/to/easingwizard/apps/mcp/dist/index.js
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
For interactive inspection:
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
pnpm --filter @easingwizard/mcp-server inspect
|
|
165
|
+
```
|
|
166
|
+
|
|
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.
|
|
168
|
+
|
|
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.
|
|
170
|
+
|
|
171
|
+
## Protocol references
|
|
172
|
+
|
|
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)
|
|
179
|
+
|
|
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;
|