Mmcp.market

add-emacs skill

by nanocoai·nanocoai/nanoclaw·31k stars·MIT

Add Emacs as a channel. Opens an interactive chat buffer and org-mode integration so you can talk to NanoClaw from within Emacs (Doom, Spacemacs, or vanilla). Local HTTP bridge — no bot token or external service needed.

A100/100content scan

Is the add-emacs skill safe?

Clean: nothing in its files matched our rules. We read 2 files in the folder on 2026-09-28.

No findings.

Install the add-emacs skill

A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.

git clone --depth 1 https://github.com/nanocoai/nanoclaw.git /tmp/nanoclaw
mkdir -p ~/.claude/skills
cp -r /tmp/nanoclaw/.claude/skills/add-emacs ~/.claude/skills/add-emacs
available in every project

In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub

The instructions your agent would load

SKILL.md as published, without the frontmatter. Read it on GitHub

Add Emacs Channel

Adds Emacs support via a local HTTP bridge. Works with Doom Emacs, Spacemacs, and vanilla Emacs 27.1+.

What you can do with this

  • Ask while coding — open the chat buffer (C-c n c / SPC N c), ask about a function or error without leaving Emacs
  • Code review — select a region and send it with nanoclaw-org-send; the response appears as a child heading inline in your org file
  • Meeting notes — send an org agenda entry; get a summary or action item list back as a child node
  • Draft writing — send org prose; receive revisions or continuations in place
  • Research capture — ask a question directly in your org notes; the answer lands exactly where you need it

Install

NanoClaw doesn't ship channels in trunk. This skill copies the Emacs adapter and the Lisp client in from the channels branch. Native HTTP bridge — no Chat SDK, no adapter package.

1. Copy the adapter and Lisp client

Fetch the channels branch from the configured remote that carries it, then overwrite the skill-owned files with the canonical registry copies:

src/channels/emacs.ts
src/channels/emacs.test.ts
src/channels/emacs-registration.test.ts
emacs/nanoclaw.el

2. Append the self-registration import

Append to src/channels/index.ts (skip if the line is already present):

import './emacs.js';

3. Build and validate

pnpm run build
pnpm exec vitest run src/channels/emacs-registration.test.ts

Both must be clean before proceeding. emacs-registration.test.ts is the one integration test: it imports the real channel barrel and asserts the registry contains emacs. It goes red if the import './emacs.js'; line is deleted or drifts, or if the barrel fails to evaluate (so the channel genuinely would not register). The adapter uses only Node builtins (http), so there is no npm dependency to guard for this channel.

End-to-end message delivery from a real Emacs buffer is verified manually once the service is running — see Verify and Troubleshooting.

Enable

The adapter is gated by EMACS_ENABLED so the HTTP port isn't opened on hosts that aren't running Emacs. Add to .env:

EMACS_ENABLED=true
EMACS_CHANNEL_PORT=8766       # optional — change only if 8766 is taken
EMACS_AUTH_TOKEN=             # optional — set to a random string to lock the endpoint
EMACS_PLATFORM_ID=default     # optional — only change if you want a non-default chat id

Generate an auth token (recommended even on single-user machines — prevents other local processes from poking the endpoint):

node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"

Wire the channel

Emacs is a single-user, single-chat channel. One host = one messaging group with platform_id = "default".

If this is your first agent group

Run /init-first-agent — pick Emacs as the channel, use any short handle as the "user id" (e.g. your OS username), and the skill will create the agent group, wire the channel, and write a welcome message that the agent delivers back to your Emacs buffer.

Otherwise — wire to an existing agent group

Run the register step directly. The EMACSPLATFORMID (default default) becomes the messaging group's platform id:

pnpm exec tsx setup/index.ts --step register -- \
  --platform-id "default" --name "Emacs" \
  --folder "<existing-folder>" --channel "emacs" \
  --session-mode "agent-shared" \
  --assistant-name "<existing-assistant-name>"

agent-shared puts Emacs messages in the same session as any other channel wired to the same agent group — so a conversation you started in Telegram continues in Emacs. Use shared to keep an independent Emacs thread with the same workspace, or a new --folder for a dedicated Emacs-only agent.

Alternatively create the rows with ncl — the host service must be running (ncl connects to it over a Unix socket). Engage mode/pattern and unknownsenderpolicy default to the Emacs adapter's declared channel defaults:

ncl messaging-groups create --channel-type emacs --platform-id "default" --name "Emacs"
ncl wirings create --messaging-group-id <mg-id-from-above> --agent-group-id <ag-id> \
  --session-mode agent-shared

Configure Emacs

nanoclaw.el needs only Emacs 27.1+ builtins (url, json, org) — no package manager.

AskUserQuestion: Which Emacs distribution are you using?

  • Doom Emacs — config.el with map! keybindings
  • Spacemacs — dotspacemacs/user-config in ~/.spacemacs
  • Vanilla Emacs / other — init.el with global-set-key

Doom Emacs — add to ~/.config/doom/config.el (or ~/.doom.d/config.el):

;; NanoClaw — personal AI assistant channel
(load (expand-file-name "~/src/nanoclaw/emacs/nanoclaw.el"))

(map! :leader
      :prefix ("N" . "NanoClaw")
      :desc "Chat buffer"  "c" #'nanoclaw-chat
      :desc "Send org"     "o" #'nanoclaw-org-send)

Reload: M-x doom/reload

Spacemacs — add to dotspacemacs/user-config in ~/.spacemacs:

;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")

(spacemacs/set-leader-keys "aNc" #'nanoclaw-chat)
(spacemacs/set-leader-keys "aNo" #'nanoclaw-org-send)

Reload: M-x dotspacemacs/sync-configuration-layers or restart Emacs.

Vanilla Emacs — add to ~/.emacs.d/init.el:

;; NanoClaw — personal AI assistant channel
(load-file "~/src/nanoclaw/emacs/nanoclaw.el")

(global-set-key (kbd "C-c n c") #'nanoclaw-chat)
(global-set-key (kbd "C-c n o") #'nanoclaw-org-send)

Reload: M-x eval-buffer or restart Emacs.

Replace ~/src/nanoclaw/emacs/nanoclaw.el with your actual NanoClaw checkout path.

If EMACSAUTHTOKEN is set, also add (any distribution):

(setq nanoclaw-auth-token "<your-token>")

If you changed EMACSCHANNELPORT from the default:

(setq nanoclaw-port <your-port>)

Restart NanoClaw

Run from your NanoClaw project root:

pnpm run build
source setup/lib/install-slug.sh
launchctl kickstart -k gui/$(id -u)/$(launchd_label)   # macOS
# systemctl --user restart $(systemd_unit)             # Linux

Verify

HTTP endpoint

curl -s http://localhost:8766/api/messages?since=0

Expected: {"messages":[]}. With an auth token:

curl -s -H "Authorization: Bearer <token>" http://localhost:8766/api/messages?since=0

From Emacs

Tell the user:

More skills from nanocoai/nanoclaw

  • Aadd-anydocAdd local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when agents need to read attached Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, or text-based PDF files without uploading them to a hosted parser.
  • Aadd-atomic-chat-toolAdd Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its OpenAI-compatible API.
  • Fadd-clidashAdd clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists resources as JSON. Ships pre-wired for NanoClaw's ncl CLI (agent groups, sessions, channels, users, roles), plus message-activity charts, a log tail, and a read-only file viewer for group skills/CLAUDE.md/profiles.
  • Aadd-codexUse Codex (OpenAI's codex app-server) as a full agent provider — planning, tool orchestration, MCP tools, server-side history, session resume — alongside or instead of Claude. ChatGPT subscription or OpenAI API key, vault-only via the selected gateway. Per-group via `ncl groups config update --provider codex`. Distinct from using OpenAI as an MCP tool (where Claude remains the planner).
  • Aadd-dashboardAdd a monitoring dashboard to NanoClaw. Installs @nanoco/nanoclaw-dashboard and a pusher that sends periodic JSON snapshots.
  • Aadd-deltachatAdd DeltaChat channel integration via @deltachat/stdio-rpc-server. Native adapter — no Chat SDK bridge. Email-based messaging with end-to-end encryption.
  • Cadd-dialAdd Dial channel integration — a real phone number for SMS and AI voice calls via the Dial platform (getdial.ai). Native adapter — no Chat SDK bridge.
  • Aadd-dial-numberAdd another phone number to an existing Dial channel — a second (or third) public line for the agent, so one NanoClaw install answers SMS and AI voice calls on multiple numbers. Use when Dial is already installed and the operator wants an additional number (e.g. a personal line plus a support line). Requires the Dial channel to already be installed (see /add-dial).
  • Aadd-dial-toolGive chosen NanoClaw agents a real phone number as a container tool — the `dial` CLI baked into the agent image plus OneCLI credential injection for api.getdial.ai, scoped per agent, so the agents you pick can send SMS, place AI voice calls, and receive verification codes from inside the sandbox. Independent of the Dial channel; idempotent; re-run to change which agents may use it. Use when the user wants agents to text, call, or run `dial …` from a chat, without wiring Dial as a messaging channel.
  • Aadd-discordAdd Discord bot channel integration via Chat SDK.
  • Aadd-gchatAdd Google Chat channel integration via Chat SDK.
  • Aadd-githubAdd GitHub channel integration via Chat SDK. PR and issue comment threads as conversations.

All agent skills → · MCP servers