nex-as-a-skill

mcp
SUMMARY

Turn every AI agent session into company intelligence. Nex silently unifies every AI agent conversation with your email, Slack, CRM, and 100+ tools into one knowledge graph. The more your team works, the smarter every agent gets.

README.md

Nex: Intelligence Layer for AI Agents

npm version
Discord

Nex turns AI agent conversations into a unified knowledge graph. Tell something to one agent, recall it from any other. Context follows you across tools — no copy-pasting, no re-explaining.

Supports Claude Code, OpenClaw, Cursor, Windsurf, Codex, Aider, Continue, Zed, and more. Adds context from Email, Meetings, Slack, HubSpot, Salesforce.

Join our Discord

Talk to the team, share feedback, and connect with other developers building AI agents with Nex.

Quick Start

Install

# Option A: standalone binary (no Node.js required, auto-installs nex-cli)
curl -fsSL https://raw.githubusercontent.com/nex-crm/nex-as-a-skill/main/install.sh | sh

# Option B: install the nex-cli binary directly
curl -fsSL https://raw.githubusercontent.com/nex-crm/nex-cli/main/install.sh | sh

# Option C: install via npm (or bun/pnpm)
npm install -g @nex-ai/nex

Sign up and configure

# Create an account (or log in if you already have one)
nex register --email [email protected]

# Auto-detect your AI platforms and install hooks, MCP, slash commands
nex setup

nex setup detects your platforms (Claude Code, Cursor, Windsurf, etc.), installs hooks, scans project files, and writes config. After setup:

nex ask "who is Maria Rodriguez?"
nex remember "Met with Maria, CTO of TechFlow. European expansion Q3, $2M budget."

Skills & Platform Rules

The core of this repo is a set of skills, slash commands, and agent instructions that teach any AI platform how to use Nex.

Slash Commands (plugin-commands/)

Drop these .md files into your agent's commands directory to get Nex slash commands:

Command What it does
/nex:recall <query> Search your knowledge base
/nex:remember <text> Store information for later recall
/nex:entities <query> Find people, companies, topics
/nex:scan <dir> Scan project files into Nex
/nex:integrate <provider> Connect an OAuth integration
/nex:register <email> One-time account registration
/nex:notify Check recent notifications

For Claude Code: cp plugin-commands/*.md ~/.claude/commands/

Platform Rules (platform-rules/)

Pre-written agent instructions that teach each platform how to use Nex tools. Copy the relevant file into your editor's config:

Platform File Destination
Cursor cursor-rules.md .cursor/rules/
Windsurf windsurf-rules.md .windsurf/rules/
GitHub Copilot vscode-instructions.md .github/instructions/
Zed zed-rules.md .zed/rules/
Aider aider-conventions.md .aider/conventions/
Cline cline-rules.md .cline/rules/
Continue continue-rules.md .continue/rules/
KiloCode kilocode-rules.md .kilocode/rules/
Codex codex-agents.md .codex/agents/
OpenCode opencode-agents.md .opencode/agents/

Platform Plugins (platform-plugins/)

Deeper integrations for editors that support plugin APIs:

  • Continue (continue-provider.ts) — Nex as a context provider for autocomplete
  • OpenCode (opencode-plugin.ts) — Session lifecycle hooks for context preservation
  • KiloCode (kilocode-modes.yaml) — Nex memory mode definitions
  • Windsurf (windsurf-workflows/) — Native workflow definitions for ask, remember, search, notify

Plugins

Claude Code Plugin

Full auto-recall and auto-capture via Claude Code hooks. Queries Nex before each prompt and captures conversation facts after each response.

cd claude-code-plugin && bun install && bun run build

Then add hooks to ~/.claude/settings.json (see settings.json for the template) and register the MCP server:

cp claude-code-plugin/commands/*.md ~/.claude/commands/
claude mcp add nex -- nex-mcp

The fastest path is just nex setup — it does all of this automatically.

See claude-code-plugin/README.md for details.

OpenClaw Plugin

15+ tools, auto-recall, and auto-capture for OpenClaw agents.

cp -r openclaw-plugin /path/to/openclaw/plugins/nex
cd /path/to/openclaw/plugins/nex && bun install && bun run build

Add to openclaw.json:

{
  "plugins": {
    "load": { "paths": ["/path/to/plugins/nex"] },
    "slots": { "memory": "nex" },
    "entries": {
      "nex": {
        "enabled": true,
        "config": { "apiKey": "sk-your_key_here" }
      }
    }
  }
}

See openclaw-plugin/README.md for details.

MCP Server (Claude Desktop, Cursor, Windsurf)

{
  "mcpServers": {
    "nex": {
      "command": "nex-mcp",
      "env": { "NEX_API_KEY": "sk-your_key_here" }
    }
  }
}

Or without a global install:

{
  "mcpServers": {
    "nex": {
      "command": "npx",
      "args": ["-y", "@nex-ai/nex", "mcp"],
      "env": { "NEX_API_KEY": "sk-your_key_here" }
    }
  }
}

Shell-only Agents (no Node.js)

Bash scripts for agents that can only run shell commands. Requires curl and jq.

bash scripts/nex-openclaw-register.sh [email protected] "Your Name"
printf '{"query":"who is Maria?"}' | bash scripts/nex-api.sh POST /v1/context/ask
bash scripts/nex-scan-files.sh --dir . --max-files 10

Copy-Paste Bootstrap Prompt

Drop this into any terminal-capable AI agent to bootstrap Nex end-to-end:

Install and fully bootstrap Nex in this project from start to finish.

1. If the `nex` CLI is missing, install it globally with `npm install -g @nex-ai/nex`.
2. If Nex is not authenticated yet, ask me for the email address I want to use for registration, then continue. If Nex is already authenticated, reuse the existing account and key.
3. Run `nex setup` and complete the full install flow for every detected AI coding platform in this environment.
4. After setup, inspect integrations and connect the first available unconnected integration. Prefer this order when multiple choices are available: gmail, google-calendar, slack, salesforce, hubspot, attio, outlook, outlook-calendar. If OAuth is required, open the browser flow and wait for it to complete.
5. Run a fresh file scan for the current directory so the workspace is up to date.
6. After the scan finishes, trigger Nex compounding jobs by calling the authenticated `POST https://app.nex.ai/api/developers/v1/compounding/trigger` endpoint for these job types: `consolidation`, `pattern_detection`, and `playbook_synthesis`. Use the active Nex API key from the current environment or the config written by Nex setup.
7. Fetch the last 24 hours of insights with the insights endpoint or `nex insight list --last 24h`, then give me a clean digest with sections for Highlights, Risks, Opportunities, Open Loops, and Recommended Next Actions.
8. Finish by showing me:
   - what Nex installed
   - which integration was connected
   - how many files were scanned and ingested
   - whether the compounding/playbooks trigger succeeded
   - the formatted 24-hour insight digest

Do not stop after partial setup. Only pause if you need my email for registration or if an OAuth flow requires my interaction.

Development

Repo structure

src/                    # Bootstrapper binary source (compiled via Bun)
bin/                    # Thin Node.js shims that delegate to nex-cli (npm fallback)
install.sh              # curl-pipe installer for the standalone binary
claude-code-plugin/     # Claude Code hooks (auto-recall, auto-capture)
openclaw-plugin/        # OpenClaw plugin (15+ tools, auto-recall, auto-capture)
plugin-commands/        # Slash command definitions (.md files)
platform-rules/         # Agent instructions for 10 platforms
platform-plugins/       # Editor integrations (Continue, OpenCode, KiloCode, Windsurf)
scripts/                # Bash API wrappers for shell-only agents
server.json             # MCP Registry manifest

Build and test

# Standalone binary (compiles via Bun)
bun run build:binary            # native platform
bun run build:all               # all 4 targets (darwin/linux × arm64/x64)

# Shims (syntax check only)
npm test

# Claude Code plugin
cd claude-code-plugin && bun install && bun run build && bun test

# OpenClaw plugin
cd openclaw-plugin && bun install && bun run build && bun test

How it works

Standalone binary (src/nex.ts): Compiled via bun build --compile. Finds nex-cli on PATH or common locations and delegates all commands. If nex-cli isn't installed, auto-downloads it on first run. Detects nex-mcp symlink invocation to transparently prepend mcp to args.

npm package (bin/nex.js): Thin Node.js shim with the same delegation logic, for npx @nex-ai/nex and MCP Registry compatibility.

CI/CD

  • CI (ci.yml): Validates shims, builds + tests both plugins, builds + smoke tests the binary on every PR
  • Release (release.yml): Cross-compiles 4 binary targets on v* tags, creates GitHub Release with checksums
  • Publish (publish-cli.yml): Auto-publishes to npm on push to main
  • MCP Registry (publish-mcp.yml): Publishes server.json to the MCP Registry on version tags

Environment Variables

Variable Required Default
NEX_API_KEY Yes (or register)
NEX_DEV_URL No (dev only) https://app.nex.ai
NEX_SCAN_ENABLED No true
NEX_SCAN_MAX_FILES No 5
NEX_SCAN_DEPTH No 20
NEX_NOTIFY_INTERVAL_MINUTES No 15

Architecture

graph TD
    API["Nex Context Graph<br/><i>app.nex.ai API</i>"]
    CLI["nex-cli binary"]

    API --- CLI

    NEX["nex binary / npm shim"]
    MCP["MCP Server<br/><i>nex-mcp</i>"]
    OC["OpenClaw Plugin"]
    CC["Claude Code Plugin"]

    CLI --- NEX
    CLI --- MCP
    CLI --- OC
    CLI --- CC

    NEX -.- T1["Any terminal"]
    MCP -.- T2["Claude Desktop · Cursor<br/>Windsurf · ChatGPT"]
    OC -.- T3["OpenClaw agents"]
    CC -.- T4["Claude Code"]

License

MIT

Reviews (0)

No results found