Course 2: Building with MIFY — Chapter 4
Chapter 4: Creating a Plugin
Section titled “Chapter 4: Creating a Plugin”Extend MIFY with your own custom nodes and publish them to the marketplace.
What You’ll Learn
Section titled “What You’ll Learn”- How to scaffold a plugin project
- How to implement a custom node
- How to test and publish
Step 1: Initialize
Section titled “Step 1: Initialize”npx mify-plugin init my-weather-nodecd my-weather-nodeCreates:
my-weather-node/├── manifest.json # Plugin metadata├── src/│ └── nodes/│ └── WeatherNode.ts # Your custom node├── tests/└── package.jsonStep 2: Define Your Manifest
Section titled “Step 2: Define Your Manifest”{ "name": "my-weather-node", "version": "1.0.0", "description": "Fetches weather data for any city", "mifyVersion": ">=1.0.0", "extensionPoints": { "nodes": ["src/nodes/WeatherNode.ts"] }, "permissions": ["network"], "runtime": "v8"}Step 3: Implement Your Node
Section titled “Step 3: Implement Your Node”export class WeatherNode implements NodeImplementation { static definition = { type: "weather.current", name: "Current Weather", category: "io", description: "Get current weather for a city", inputs: { city: { type: "string", required: true } }, outputs: { temperature: { type: "number" }, condition: { type: "string" } }, };
async execute(input: { city: string }) { const response = await fetch( `https://api.weatherapi.com/v1/current.json?q=${input.city}` ); const data = await response.json(); return { temperature: data.current.temp_c, condition: data.current.condition.text, }; }}Step 4: Test
Section titled “Step 4: Test”npx mify-plugin dev # Hot reload dev servernpx mify-plugin test # Run unit testsnpx mify-plugin validate # Check manifestStep 5: Publish
Section titled “Step 5: Publish”npx mify-plugin publishYour plugin appears in the Plugin Marketplace at /plugins/marketplace.

Exercise
Section titled “Exercise”- Initialize a plugin project
- Implement a node that takes text input and returns a word count
- Test it with
npx mify-plugin dev - Use it in a workflow on the canvas
Previous: Chapter 3 — Content Generation | Next: Chapter 5 — Advanced Patterns