@tobiasoberpaul/mdk 0.1.0 → 0.1.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 +14 -81
- package/package.json +4 -12
- package/THIRD_PARTY_NOTICES.md +0 -7
- package/ai/INSTRUCTIONS.md +0 -14
- package/ai/mcp-server.mjs +0 -112
- package/docs/AI_INTEGRATION.md +0 -69
- package/docs/PUBLISHING.md +0 -33
package/README.md
CHANGED
|
@@ -1,95 +1,28 @@
|
|
|
1
1
|
# MDK · UI Motion Library
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Animations API (WAAPI), CSS tokens and reversible transitions. React is used only
|
|
5
|
-
by the DB React and shadcn/ui playground integrations.
|
|
3
|
+
MDK is a framework-independent TypeScript library for reversible UI transitions. It uses the Web Animations API and CSS custom properties.
|
|
6
4
|
|
|
7
|
-
##
|
|
5
|
+
## Install
|
|
8
6
|
|
|
9
7
|
```sh
|
|
10
|
-
npm install
|
|
11
|
-
npm run dev
|
|
8
|
+
npm install @tobiasoberpaul/mdk
|
|
12
9
|
```
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
## Use
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
```js
|
|
14
|
+
import { createGrowTransition } from '@tobiasoberpaul/mdk';
|
|
15
|
+
import '@tobiasoberpaul/mdk/motion.css';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Upload the contents of `site/` to a static host, or configure its build command
|
|
24
|
-
as `npm run build:site` and publish directory as `site`. The site includes
|
|
25
|
-
Examples, Code playground and Documentation. Subdirectory hosting works without
|
|
26
|
-
route rewrites. Preview the generated site locally at
|
|
27
|
-
[the static build](http://127.0.0.1:4173/site/) while the dev server is running.
|
|
28
|
-
|
|
29
|
-
GitHub Pages is deployed by `.github/workflows/pages.yml` on every push to
|
|
30
|
-
`main`. Set **Settings → Pages → Source → GitHub Actions** in the repository.
|
|
31
|
-
Website: https://toberpaul.github.io/animations/
|
|
32
|
-
|
|
33
|
-
- **Examples:** switch between DB React and shadcn/ui, light/dark mode, reduced
|
|
34
|
-
motion, duration, progression gap and overshoot; scrub real animation frames.
|
|
35
|
-
- **Code playground:** edit HTML with live preview. Define
|
|
36
|
-
motion in code through attributes/classes or direct factories. Drafts are
|
|
37
|
-
stored locally. Exported HTML references the running library server.
|
|
17
|
+
const panel = document.querySelector('#panel');
|
|
18
|
+
const toggle = document.querySelector('#toggle');
|
|
19
|
+
const motion = createGrowTransition({ content: panel });
|
|
38
20
|
|
|
39
|
-
|
|
40
|
-
npm run build # TypeScript library and CSS → dist/
|
|
41
|
-
npm run build:examples # Both component integrations and playground shell
|
|
21
|
+
toggle.addEventListener('click', () => motion.toggle());
|
|
42
22
|
```
|
|
43
23
|
|
|
44
|
-
|
|
45
|
-
checkout through a workspace/local package or import the built files. No runtime
|
|
46
|
-
framework dependencies are required by the library.
|
|
47
|
-
|
|
48
|
-
## Documentation
|
|
49
|
-
|
|
50
|
-
See **[Library guide](docs/LIBRARY.md)** for the public API, declarative markup,
|
|
51
|
-
tokens, content sequencing, viewport entry and component integration examples.
|
|
52
|
-
|
|
53
|
-
| Playground animation | Example artifacts |
|
|
54
|
-
| --- | --- |
|
|
55
|
-
| Grow | Action menu, dialog, side panel, notification, three-column panels, split-button menu |
|
|
56
|
-
| Extract | Action menu with a retained source button |
|
|
57
|
-
| Morph | Replacing action menu, rename input |
|
|
58
|
-
| Slide | Two-level submenu |
|
|
59
|
-
| Content | Text block, image/caption and independently revealed page blocks |
|
|
60
|
-
|
|
61
|
-
All component examples use the same core library. Components own positioning,
|
|
62
|
-
content, accessibility, focus and lifecycle. The library owns visual transitions.
|
|
63
|
-
Grow/Morph/Extract contents use fade and blur without an independent content
|
|
64
|
-
slide. Content uses a fixed slide + blur + fade combination.
|
|
65
|
-
|
|
66
|
-
## Defaults
|
|
67
|
-
|
|
68
|
-
- Duration: **300ms**; Content uses this duration per item.
|
|
69
|
-
- Easing: symmetric ease-in-out.
|
|
70
|
-
- Overshoot: **15% of the shorter side, capped at .75rem**.
|
|
71
|
-
- Playground progression: enabled, **24ms** start spacing.
|
|
72
|
-
- Library progression: enabled by default; set `--motion-content-progressive: 0` to disable.
|
|
73
|
-
- Reduced motion: respects the OS preference and the playground switch.
|
|
74
|
-
|
|
75
|
-
The DB integration uses installed DB component/theme packages. Optional licensed
|
|
76
|
-
DB Neo/icon assets require locally configured `ASSET_PASSWORD` and
|
|
77
|
-
`ASSET_INIT_VECTOR`; they are not included in this repository. The examples use
|
|
78
|
-
fallback icons where applicable. Keep credentials in ignored local environment
|
|
79
|
-
files.
|
|
80
|
-
|
|
81
|
-
Generated builds, dependencies and local visual-check output are ignored by Git.
|
|
82
|
-
|
|
83
|
-
## AI coding clients
|
|
84
|
-
|
|
85
|
-
A local read-only MCP server shares the guide, built API declarations, tokens and integration examples with compatible AI clients. See [AI integration setup](docs/AI_INTEGRATION.md). Start with `npm run build`, then configure `node /absolute/path/to/animations/ai/mcp-server.mjs` as a stdio MCP server. Portable integration rules are in `ai/INSTRUCTIONS.md`.
|
|
86
|
-
|
|
87
|
-
## Local Codex analytics
|
|
88
|
-
|
|
89
|
-
Run `npm run analytics` and open the printed address. It reads token counts and available five-hour account snapshots from local Codex history for recorded work-package turns. The optional project hook adds local request telemetry and can be trusted under **Settings → Hooks** or with `/hooks`. The [Context Starter](context-starter/README.md) describes the data format.
|
|
90
|
-
|
|
91
|
-
## License and package releases
|
|
24
|
+
Your component manages layout, visibility, focus and accessibility. MDK handles the visual transition, including reversal and the system's reduced-motion preference.
|
|
92
25
|
|
|
93
|
-
|
|
26
|
+
The library includes Grow, Extract, Morph, Slide and Content transitions. See the [library guide](https://github.com/TOberpaul/animations/blob/main/docs/LIBRARY.md) for the API, CSS tokens and integration patterns.
|
|
94
27
|
|
|
95
|
-
|
|
28
|
+
Licensed under [MIT](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tobiasoberpaul/mdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
-
"
|
|
8
|
-
"docs/LIBRARY.md",
|
|
9
|
-
"docs/AI_INTEGRATION.md",
|
|
10
|
-
"docs/PUBLISHING.md",
|
|
11
|
-
"THIRD_PARTY_NOTICES.md"
|
|
7
|
+
"docs/LIBRARY.md"
|
|
12
8
|
],
|
|
13
9
|
"exports": {
|
|
14
10
|
".": {
|
|
@@ -62,7 +58,6 @@
|
|
|
62
58
|
"type": "git",
|
|
63
59
|
"url": "git+https://github.com/TOberpaul/animations.git"
|
|
64
60
|
},
|
|
65
|
-
"homepage": "https://toberpaul.github.io/animations/",
|
|
66
61
|
"bugs": {
|
|
67
62
|
"url": "https://github.com/TOberpaul/animations/issues"
|
|
68
63
|
},
|
|
@@ -71,8 +66,7 @@
|
|
|
71
66
|
"motion",
|
|
72
67
|
"waapi",
|
|
73
68
|
"typescript",
|
|
74
|
-
"design-system"
|
|
75
|
-
"mcp"
|
|
69
|
+
"design-system"
|
|
76
70
|
],
|
|
77
71
|
"engines": {
|
|
78
72
|
"node": ">=18"
|
|
@@ -80,9 +74,7 @@
|
|
|
80
74
|
"sideEffects": [
|
|
81
75
|
"**/*.css"
|
|
82
76
|
],
|
|
83
|
-
|
|
84
|
-
"motion-library-mcp": "ai/mcp-server.mjs"
|
|
85
|
-
},
|
|
77
|
+
|
|
86
78
|
"publishConfig": {
|
|
87
79
|
"access": "public"
|
|
88
80
|
},
|
package/THIRD_PARTY_NOTICES.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Third-party notices
|
|
2
|
-
|
|
3
|
-
The distributed library and local MCP server have no runtime dependencies. They use browser APIs and Node.js built-ins.
|
|
4
|
-
|
|
5
|
-
The repository's website examples use third-party design systems, React, Radix primitives, Lucide icons and development tools. Those dependencies retain their own licenses; their example source and bundled website assets are not included in the npm package. See each dependency's installed LICENSE/NOTICE files and examples/shadcn/SHADCN-LICENSE when distributing the website.
|
|
6
|
-
|
|
7
|
-
The package's LICENSE covers this project's original code, not third-party trademarks, fonts or proprietary design-system assets.
|
package/ai/INSTRUCTIONS.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Motion Library integration rules
|
|
2
|
-
|
|
3
|
-
Use the installed Motion Library instead of copying animation implementations into applications.
|
|
4
|
-
|
|
5
|
-
1. Read `motion://guide` and `get_motion_reference` with topic `api` before choosing options. The built declarations and CSS tokens are authoritative.
|
|
6
|
-
2. Choose Grow for anchored surfaces, Extract to retain the trigger, Morph to replace it, Slide for translation, and Fade for slide/blur/fade content reveals.
|
|
7
|
-
3. Keep layout, positioning, semantics, visibility, focus, keyboard handling and lifecycle owned by the consuming component. Optional positioning is explicit; do not replace an existing positioning system.
|
|
8
|
-
4. Include all visible elements in reveal groups: headings, controls, labels, icons, dividers and rows. Keep related elements together. Grow/Extract/Morph content does not slide.
|
|
9
|
-
5. Use CSS custom properties for timing, easing and overshoot. Preserve progressive reveal and reduced-motion handling. Do not hardcode another animation recipe.
|
|
10
|
-
6. Keep targets mounted through exit. Synchronize hidden/inert and aria-expanded. For modals, preserve the component's focus trap and focus restoration; generic examples are disclosures, not complete dialogs or menus.
|
|
11
|
-
7. Destroy controllers and disconnect bindings/observers on unmount. Preserve interruption and reversal. Use seek or bindScrollMotion for scroll scrubbing rather than recreating controllers on each frame.
|
|
12
|
-
8. Verify opening, closing, rapid reversal, keyboard operation, reduced motion and mobile geometry in the consuming application.
|
|
13
|
-
|
|
14
|
-
The MCP tools provide reference text and source examples only. They do not execute generated code, edit the application, or call an AI model. Any implementation changes remain actions performed by the user's AI client under its normal permissions.
|
package/ai/mcp-server.mjs
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Local, read-only MCP adapter. stdout is reserved for protocol messages.
|
|
3
|
-
import {createInterface} from 'node:readline';
|
|
4
|
-
import {readFile,readdir} from 'node:fs/promises';
|
|
5
|
-
import {motionBehaviors} from '../dist/behaviors.js';
|
|
6
|
-
const base=new URL('../',import.meta.url);
|
|
7
|
-
const read=path=>readFile(new URL(path,base),'utf8');
|
|
8
|
-
const versions=['2026-07-28','2025-11-25','2025-06-18','2025-03-26'];
|
|
9
|
-
const capabilities={tools:{},resources:{},prompts:{}};
|
|
10
|
-
const packageInfo=JSON.parse(await read('package.json'));
|
|
11
|
-
const info={name:'motion-library',version:packageInfo.version};
|
|
12
|
-
const instructions='Read motion_guide before integrating. Use the installed library API, not copied animation recipes. Component integrations own visibility, accessibility and focus. Tools read bundled reference files only; generated examples are not executed.';
|
|
13
|
-
const resources=[
|
|
14
|
-
{uri:'motion://guide',name:'motion_guide',mimeType:'text/markdown',path:'docs/LIBRARY.md'},
|
|
15
|
-
{uri:'motion://tokens',name:'motion_tokens',mimeType:'text/css',path:'dist/styles/motion.css'},
|
|
16
|
-
{uri:'motion://instructions',name:'motion_integration_rules',mimeType:'text/markdown',path:'ai/INSTRUCTIONS.md'},
|
|
17
|
-
];
|
|
18
|
-
const tools=[
|
|
19
|
-
{name:'get_motion_reference',description:'Read the current library guide, design tokens, API declarations or canonical behavior definitions.',inputSchema:{type:'object',properties:{topic:{type:'string',enum:['guide','tokens','api','behaviors','instructions']}},required:['topic'],additionalProperties:false}},
|
|
20
|
-
{name:'create_motion_example',description:'Generate a minimal integration using the real Motion Library API. Returns source text; never executes or writes it.',inputSchema:{type:'object',properties:{behavior:{type:'string',enum:Object.keys(motionBehaviors)},activation:{type:'string',enum:['click','hover','focus','observer','scroll','manual']},placement:{type:'string',enum:['center','top','bottom','left','right','bottom-end','top-end']},relativeTo:{type:'string',enum:['trigger','viewport']},space:{type:'number',minimum:0,maximum:128}},required:['behavior'],additionalProperties:false}},
|
|
21
|
-
].map(tool=>({...tool,annotations:{readOnlyHint:true,destructiveHint:false,idempotentHint:true,openWorldHint:false}}));
|
|
22
|
-
function invalid(message){throw Object.assign(new Error(message),{code:-32602});}
|
|
23
|
-
async function reference(topic){
|
|
24
|
-
if(topic==='behaviors')return JSON.stringify(motionBehaviors,null,2);
|
|
25
|
-
if(topic==='api'){
|
|
26
|
-
const files=[];
|
|
27
|
-
async function walk(path){for(const entry of await readdir(new URL(path,base),{withFileTypes:true})){const file=path+'/'+entry.name;if(entry.isDirectory())await walk(file);else if(entry.name.endsWith('.d.ts'))files.push(file);}}
|
|
28
|
-
await walk('dist');files.sort();return (await Promise.all(files.map(async file=>'// '+file+'\n'+await read(file)))).join('\n\n');
|
|
29
|
-
}
|
|
30
|
-
const resource=resources.find(value=>value.uri==='motion://'+topic);
|
|
31
|
-
if(!resource)invalid('Unknown reference topic.');return read(resource.path);
|
|
32
|
-
}
|
|
33
|
-
function example(args){
|
|
34
|
-
const behavior=args.behavior,activation=args.activation??'click';
|
|
35
|
-
if(!Object.hasOwn(motionBehaviors,behavior))invalid('Unknown behavior.');
|
|
36
|
-
if(!tools[1].inputSchema.properties.activation.enum.includes(activation))invalid('Invalid activation.');
|
|
37
|
-
const placement=args.placement;
|
|
38
|
-
if(placement&&!tools[1].inputSchema.properties.placement.enum.includes(placement))invalid('Invalid placement.');
|
|
39
|
-
const relativeTo=args.relativeTo??'trigger';
|
|
40
|
-
if(!['trigger','viewport'].includes(relativeTo))invalid('Invalid relativeTo.');
|
|
41
|
-
const space=args.space??12;if(typeof space!=='number'||!Number.isFinite(space)||space<0||space>128)invalid('space must be between 0 and 128 pixels.');
|
|
42
|
-
const position=placement?`\n position: { relativeTo: '${relativeTo}', placement: '${placement}', space: ${space} },`:'';
|
|
43
|
-
const scroll=activation==='scroll'?`\n scroll: { mode: 'scrub', start: 200, end: 600 },`:'';
|
|
44
|
-
const observer=activation==='observer'?`\n observeElement: document.querySelector('#motion-slot'),`:'';
|
|
45
|
-
return `<!-- Reserve this slot so entry/exit cannot shift the surrounding page. -->
|
|
46
|
-
<div id="motion-slot">
|
|
47
|
-
<button id="trigger" aria-controls="target" aria-expanded="false">Open</button>
|
|
48
|
-
<section id="target" data-motion="${behavior}" data-motion-anchor="center" hidden inert>
|
|
49
|
-
<h2>Your next idea</h2>
|
|
50
|
-
<p>Content keeps its layout and follows the library reveal recipe.</p>
|
|
51
|
-
<button id="close">Close</button>
|
|
52
|
-
</section>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
// Load the library's motion.css in your application.
|
|
56
|
-
import {createInteractiveMotion} from '@tobiasoberpaul/mdk';
|
|
57
|
-
const target = document.querySelector('#target');
|
|
58
|
-
const trigger = document.querySelector('#trigger');
|
|
59
|
-
const motion = createInteractiveMotion({
|
|
60
|
-
content: target, trigger, on: '${activation}',${position}${scroll}${observer}
|
|
61
|
-
close: target.querySelector('#close'),
|
|
62
|
-
reveal: [...target.children],
|
|
63
|
-
onStateChange(state) {
|
|
64
|
-
if (state === 'destroyed') return;
|
|
65
|
-
target.hidden = state === 'closed';
|
|
66
|
-
target.inert = state === 'closed' || state === 'closing';
|
|
67
|
-
trigger.setAttribute('aria-expanded', String(state === 'open' || state === 'opening'));
|
|
68
|
-
${behavior==='morph'?" trigger.style.visibility = state === 'closed' ? '' : 'hidden';\n trigger.inert = state !== 'closed';\n":''} },
|
|
69
|
-
});
|
|
70
|
-
// Existing component positioning is used unless position is explicitly supplied.
|
|
71
|
-
// This is a generic disclosure, not a complete modal dialog or ARIA menu integration.
|
|
72
|
-
// Add component-owned focus restoration and semantics where appropriate.
|
|
73
|
-
// On unmount: motion.destroy();`;
|
|
74
|
-
}
|
|
75
|
-
async function dispatch(method,params={}){
|
|
76
|
-
if(method==='initialize')return {protocolVersion:versions.slice(1).includes(params.protocolVersion)?params.protocolVersion:'2025-06-18',capabilities,serverInfo:info,instructions};
|
|
77
|
-
if(method==='server/discover')return {supportedVersions:[versions[0]],capabilities,instructions,cacheScope:'public',ttlMs:0,resultType:'complete'};
|
|
78
|
-
if(method==='ping')return {};
|
|
79
|
-
if(method==='resources/list')return {resources:resources.map(({path,...resource})=>resource)};
|
|
80
|
-
if(method==='resources/templates/list')return {resourceTemplates:[]};
|
|
81
|
-
if(method==='resources/read'){
|
|
82
|
-
const resource=resources.find(value=>value.uri===params.uri);if(!resource)invalid('Unknown resource URI.');
|
|
83
|
-
return {contents:[{uri:resource.uri,mimeType:resource.mimeType,text:await read(resource.path)}]};
|
|
84
|
-
}
|
|
85
|
-
if(method==='tools/list')return {tools};
|
|
86
|
-
if(method==='tools/call'){
|
|
87
|
-
const args=params.arguments??{};if(!args||typeof args!=='object'||Array.isArray(args))invalid('Arguments must be an object.');
|
|
88
|
-
const tool=tools.find(value=>value.name===params.name);if(!tool)invalid('Unknown tool.');
|
|
89
|
-
if(Object.keys(args).some(key=>!Object.hasOwn(tool.inputSchema.properties,key)))invalid('Unknown argument.');
|
|
90
|
-
try{return {content:[{type:'text',text:params.name==='get_motion_reference'?await reference(args.topic):example(args)}]};}
|
|
91
|
-
catch(error){return {isError:true,content:[{type:'text',text:error.message}]};}
|
|
92
|
-
}
|
|
93
|
-
if(method==='prompts/list')return {prompts:[{name:'integrate_motion',description:'Plan an integration using the library reference and existing component lifecycle.'}]};
|
|
94
|
-
if(method==='prompts/get'){
|
|
95
|
-
if(params.name!=='integrate_motion')invalid('Unknown prompt.');
|
|
96
|
-
return {messages:[{role:'user',content:{type:'text',text:(await read('ai/INSTRUCTIONS.md'))+'\nRead the guide and API through get_motion_reference. Inspect the existing component and implement its motion with the library. Include cleanup and reduced-motion behavior.'}}]};
|
|
97
|
-
}
|
|
98
|
-
throw Object.assign(new Error('Method not found'),{code:-32601});
|
|
99
|
-
}
|
|
100
|
-
const send=value=>process.stdout.write(JSON.stringify(value)+'\n');
|
|
101
|
-
const lines=createInterface({input:process.stdin,crlfDelay:Infinity});
|
|
102
|
-
let queue=Promise.resolve();
|
|
103
|
-
lines.on('line',line=>{queue=queue.then(async()=>{
|
|
104
|
-
let request;try{request=JSON.parse(line);}catch{send({jsonrpc:'2.0',id:null,error:{code:-32700,message:'Parse error'}});return;}
|
|
105
|
-
if(!request||Array.isArray(request)||request.jsonrpc!=='2.0'||typeof request.method!=='string'){
|
|
106
|
-
send({jsonrpc:'2.0',id:request?.id??null,error:{code:-32600,message:'Invalid request'}});return;
|
|
107
|
-
}
|
|
108
|
-
if(request.params!==undefined&&(!request.params||typeof request.params!=='object'||Array.isArray(request.params))){send({jsonrpc:'2.0',id:request.id??null,error:{code:-32602,message:'Params must be an object'}});return;}
|
|
109
|
-
if(!Object.hasOwn(request,'id'))return; // Notifications never receive responses.
|
|
110
|
-
try{const modern=request.params?._meta?.['io.modelcontextprotocol/protocolVersion'];if(modern&&modern!==versions[0])invalid('Unsupported modern protocol version.');const result=await dispatch(request.method,request.params);send({jsonrpc:'2.0',id:request.id,result:modern?{...result,resultType:'complete'}:result});}
|
|
111
|
-
catch(error){send({jsonrpc:'2.0',id:request.id,error:{code:error.code??-32603,message:error.code?error.message:'Unable to read the bundled library reference. Run npm run build first.'}});}
|
|
112
|
-
}).catch(error=>process.stderr.write(error.message+'\n'));});
|
package/docs/AI_INTEGRATION.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# AI integration
|
|
2
|
-
|
|
3
|
-
The library includes a local, read-only MCP server. Use it with an AI client that supports local stdio MCP servers. No model provider, API key, remote service, or runtime framework dependency is required. Each client controls its own approval and tool-use behavior.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
From the repository, run `npm ci` and `npm run build` once. Configure your client to launch:
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
node /absolute/path/to/animations/ai/mcp-server.mjs
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Use Node 18 or newer (Node 22 recommended). Paths are resolved relative to the server file, so the client's working directory does not matter. Restart the server after rebuilding the library.
|
|
14
|
-
|
|
15
|
-
A common MCP configuration shape is:
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"mcpServers": {
|
|
20
|
-
"motion-library": {
|
|
21
|
-
"command": "node",
|
|
22
|
-
"args": ["/absolute/path/to/animations/ai/mcp-server.mjs"]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
On Windows use `C:/path/to/animations/ai/mcp-server.mjs`. For Kiro or other clients using `mcpServers`, place the entry in that client's MCP settings. Copilot in VS Code uses its own MCP configuration: put the server entry under `servers`, and add `"type": "stdio"`. Client locations and schemas vary; use the client's MCP settings UI or current documentation. This project does not silently modify any client configuration.
|
|
29
|
-
|
|
30
|
-
VS Code-style entry:
|
|
31
|
-
|
|
32
|
-
```json
|
|
33
|
-
{
|
|
34
|
-
"servers": {
|
|
35
|
-
"motion-library": {
|
|
36
|
-
"type": "stdio",
|
|
37
|
-
"command": "node",
|
|
38
|
-
"args": ["/absolute/path/to/animations/ai/mcp-server.mjs"]
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## What the AI receives
|
|
45
|
-
|
|
46
|
-
| Capability | Purpose |
|
|
47
|
-
| --- | --- |
|
|
48
|
-
| `get_motion_reference` | Read guide, tokens, built TypeScript declarations, integration rules or canonical behavior definitions. |
|
|
49
|
-
| `create_motion_example` | Generate a minimal disclosure integration for a selected behavior/activation, with optional placement. Returns code text without executing it. |
|
|
50
|
-
| `motion://guide` | Public library guide. |
|
|
51
|
-
| `motion://tokens` | Actual built motion.css. |
|
|
52
|
-
| `motion://instructions` | Portable integration rules. |
|
|
53
|
-
| `integrate_motion` prompt | A starting instruction for an AI-assisted component integration. |
|
|
54
|
-
|
|
55
|
-
Guide, API, token and behavior responses are loaded from this checkout's documentation/build output. There is no separately maintained copy of the token values or API signatures. Rebuild after library API changes.
|
|
56
|
-
|
|
57
|
-
Example request to your AI: “Use the Motion Library MCP to add an interruptible Grow transition to this existing popover. Preserve its accessibility and positioning.”
|
|
58
|
-
|
|
59
|
-
## Compatibility and scope
|
|
60
|
-
|
|
61
|
-
The adapter uses newline-delimited JSON-RPC over stdio. It supports initialization-based MCP versions 2025-03-26 / 2025-06-18 / 2025-11-25 and discovery-based version 2026-07-28. It offers read-only tools/resources/prompts, not remote HTTP hosting or resource subscriptions. Compatibility is conditional on the client's MCP implementation; it has not been certified in every AI product.
|
|
62
|
-
|
|
63
|
-
For clients without MCP, provide `ai/INSTRUCTIONS.md` and `docs/LIBRARY.md` as repository context, or reference them from the client's own instruction file. A model-specific skill or power is not required.
|
|
64
|
-
|
|
65
|
-
The GitHub Pages website cannot run a Node stdio process. The server runs locally alongside the AI client. The package has not been published to npm; use the local command above rather than an assumed npx package.
|
|
66
|
-
|
|
67
|
-
## Installed package
|
|
68
|
-
|
|
69
|
-
The package exposes the `motion-library-mcp` executable. After installing the package, clients can launch that command directly. Until the first registry release, use the local checkout or install its packed `.tgz` file. No registry name is assumed available.
|
package/docs/PUBLISHING.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Publishing the package
|
|
2
|
-
|
|
3
|
-
The package is prepared for npm and can also be installed with pnpm. Both use the same npm registry artifact.
|
|
4
|
-
|
|
5
|
-
## Release prerequisites
|
|
6
|
-
|
|
7
|
-
- License: MIT. Copyright is attributed to TOberpaul; verify attribution when accepting external contributions.
|
|
8
|
-
- Sign in to npm with publish access to the `@tobiasoberpaul` scope. Check the account with `npm whoami`.
|
|
9
|
-
- Confirm the version in package.json and package-lock.json, and record release changes.
|
|
10
|
-
|
|
11
|
-
## Validate the artifact
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
npm ci
|
|
15
|
-
npm run build
|
|
16
|
-
npm run check:mcp
|
|
17
|
-
npm pack --dry-run
|
|
18
|
-
npm pack
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The `prepack` hook builds the library. The package contains built ESM, TypeScript declarations, CSS, the MCP executable and public guides. React integrations, website assets, credentials and development dependencies are excluded. The core and MCP have no runtime dependencies.
|
|
22
|
-
|
|
23
|
-
Install the resulting `.tgz` into a temporary consumer project and verify ESM imports and `motion-library-mcp`. CSS is available through `@tobiasoberpaul/mdk/motion.css`. Browser APIs are needed only when creating an animation; importing the module is safe without a browser.
|
|
24
|
-
|
|
25
|
-
## Publish when ready
|
|
26
|
-
|
|
27
|
-
After validation, publish `@tobiasoberpaul/mdk` to the public npm registry:
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npm publish --access public
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Use npm's required authentication/2FA flow. No token is stored in this repository. A GitHub Pages deployment publishes only the website; it does not publish an npm version. Registry releases are separate, intentional versioned actions.
|