Zero to Hello World

Build your first Plugin.

In this guide, we will expose a simple local tool to the Cortex AI using Node.js and a secure tunnel.

1

Initialize Project

Create a minimal Node.js project. No proprietary SDKs needed.

# Create folder
mkdir my-cortex-plugin && cd my-cortex-plugin

# Init & install generic dependencies
npm init -y
npm install express body-parser
2

Write Server Code

Create index.js. We'll define a simple tool called hello_world.

index.js
const express = require('express');
const app = express();
app.use(express.json());

// The definition of our tool
const MANIFEST = {
  slug: "HELLO_V1",
  version: "1.0.0",
  tools: [{
    name: "say_hello",
    description: "Greets the user politely",
    inputSchema: {
      type: "object", 
      properties: { name: { type: "string" } },
      required: ["name"]
    }
  }]
};

// 1. Host the manifest
app.get('/manifest', (req, res) => res.json(MANIFEST));

// 2. Handle the tool
app.post('/execute', (req, res) => {
  const { tool, input } = req.body;
  if (tool === 'say_hello') {
    return res.json({ message: `Hello, ${input.name}! Welcome to Cortex.` });
  }
  res.status(404).json({ error: "Tool not found" });
});

app.listen(3000, () => console.log('Plugin running on port 3000'));
3

Expose & Connect

The Cortex Cloud needs to reach your localhost. Use a tunnel.

$npx localtunnel --port 3000
> your url is: https://stark-mountain-42.loca.lt

Register in Dashboard

1. Go to Dashboard > Developers.
2. Enter your Manifest URL: https://.../manifest
3. Click Install Sandbox.

That's it. You just extended the global AI network.
Next, learn how to secure your plugin with authentication.