Skip to main content
Glama
README.md
# Hillnote MCP Server

[![NPM Version](https://img.shields.io/npm/v/@hillnote/mcp-server)](https://www.npmjs.com/package/@hillnote/mcp-server)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![MCP SDK](https://img.shields.io/badge/MCP%20SDK-1.0.4-green)](https://modelcontextprotocol.io)
[![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Windows%20%7C%20Linux-blue)](https://hillnote.com)
[![Node](https://img.shields.io/badge/Node.js-%3E%3D%2018.0.0-brightgreen)](https://nodejs.org)

Official [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for **Hillnote**. It runs on your computer, next to the Hillnote app, and gives AI agents three things:

- **Control of the Hillnote app.** While the app is open, agents show their work on screen instead of only describing it. They can open a document at the passage they mean, present a deck, open a board on the right card, jot something in the Notepad, open code in Build mode and check the app you are building. See [Drive the Hillnote app](#drive-the-hillnote-app).
- **The `hillnote` command.** Every tool is also a shell command, so terminal agents (Claude Code, Codex, Cursor's agent…) can use Hillnote without loading any tool definitions. See [The `hillnote` command](#the-hillnote-command-hillnote-desktop-app).
- **Your local workspaces.** Agents read and edit documents, databases, sheets, libraries, moodboards, slides and HTML tools straight from the files on this computer.

Hillnote's cloud MCP server (`https://hillnote.com/mcp`) reaches synced workspaces from anywhere, but it can't drive the app or run commands. That needs this server, which runs next to the app.

> **Platform Support:** Supports **macOS**, **Windows**, and **Linux**.

## Features

- πŸ–₯️ **App Control** - Drive the running Hillnote app: open documents at a heading, present slides, open databases, sheets and libraries, use the Notepad, Build mode and live preview checks
- ⌨️ **The `hillnote` command** - Every tool as a shell command for terminal agents; ships with the desktop app
- πŸ“ **Multi-Workspace Support** - Manage multiple document workspaces
- πŸ“ **Document Management** - Full CRUD operations for documents
- πŸ” **Smart Search** - Fuzzy search with intelligent ranking across titles, tags, and content
- ✏️ **Content Manipulation** - Advanced content editing with validation and preview
- 🎯 **AI Recipes** - Manage and execute AI prompt recipes
- πŸ› οΈ **HTML Tools** - Create interactive HTML-based utilities
- πŸ“‹ **Database & Task Management** - Create databases with rows, columns, views, and kanban boards for task tracking
- 🎨 **Slide Presentations** - Two-phase slide creation with storytelling guides and visual design tools
- πŸ“Œ **Moodboards** - Build free-form boards of images, document cards, videos, text notes, sticky notes, links, swatches, frames and connectors
- 🏷️ **Metadata Support** - Rich document metadata with tags, emojis, and descriptions

## Drive the Hillnote app

While the Hillnote app is open, agents can put what they mean on your screen:

| You ask | What happens in the app |
|---|---|
| "Show me the Risks section of the roadmap" | `open_document` opens it, scrolls to the heading and highlights it |
| "Present the Q3 review" | `show_slide` puts the deck in presentation view on the right slide |
| "Open Tasks as a kanban, on the Ship CLI card" | `open_database` switches the view and flashes the card. Cards the agent moves slide to their new column live |
| "Where does the handbook say that?" | `open_library` opens the section it cited |
| "How does the board look?" | `render_moodboard` returns a picture of the board, painted by the app |
| "Jot this down" | `notepad` adds it to the workspace's scratchpad instead of creating a document |
| "Open the file you changed" | `build_mode` opens it in Build mode's code editor, at the line |
| "Does the settings page still work?" | `check_preview` loads it like a new visitor and returns console errors, failed requests and a screenshot |
| "What am I looking at?" | `get_app_state` reads the open workspace and document, including whether it has unsaved edits |

You can follow each step in the app's activity feed (`post_activity`). The first app-control call from a new agent asks for your approval inside Hillnote, and the app remembers your answer for that agent (Settings β†’ Connections). Apart from `render_moodboard`, every other tool works on the files directly, so it doesn't need the app to be running. All 14 app-control tools are listed under **App Interface Control** below.

## The `hillnote` command (Hillnote desktop app)

Agents that work in a terminal (Claude Code, Codex, Cursor's agent…) can use the same tools as shell commands instead of connecting an MCP client β€” nothing is loaded into the agent's context until it runs `hillnote --help`:

```bash
hillnote status
hillnote view Roadmap --outline
hillnote db rows Tasks --where 'status is "In Progress"' --fields title,due
hillnote doc edit Roadmap --old "ships in Q3" --new "ships in Q4" --dry-run
hillnote db create Tasks --column "Status:status=To Do|Doing|Done" --kanban status
hillnote lib search "notice period" && hillnote lib view s-4f2a9c
hillnote guide moodboard && hillnote board add "Brand Inspiration.moodboard" --file items.json
hillnote doc delete "Old draft" --yes && hillnote trash restore "Old draft"
hillnote automation set Tasks "In progress" --agent claude --when-done Review   # kanban: an agent per status
hillnote schedule add Tasks "Fix login" --to "In progress" --at "2026-10-23 09:00"
hillnote open Tasks --view kanban --row "Ship CLI"   # show it in the running app
hillnote open Roadmap --heading "Risks"              # ...down to one section, highlighted
hillnote app build open src/App.jsx --line 42        # Build mode: show code in the app's editor
hillnote preview check /settings                     # the app you are building: errors + a screenshot
hillnote app notepad append --text "- call the printer back"
hillnote raw --list            # the escape hatch: any tool in this server as  hillnote raw <tool> --args '{…}'
```

Every tool in this server has a command (`hillnote --help`): documents, databases and their structure, sheets, libraries and playbooks, moodboards, HTML tools, recipes, kanban automation and scheduled moves, the authoring guides, and the app-control tools.

The command **ships with the Hillnote desktop app, not with this npm package**. It is on `PATH` in every terminal the app opens; for your own terminal and agent apps, press **Configure** next to your agent app in **Settings β†’ Connections β†’ Local MCP** (it adds the Hillnote skill too), or install just the command from the **Command line** card. It runs on the app's own runtime, so it needs no Node.js install. Deleted documents, database rows and databases go to `.hillnote/trash/` in the workspace; `hillnote trash restore <name>` (the `restore_from_trash` tool) puts one back, registry entry included.

## Requirements

- **macOS**, **Windows**, or **Linux**
- **Hillnote Desktop App**
- **Node.js** >= 18.0.0
- **MCP-compatible client** (Claude Desktop, Cursor, VS Code, etc.)

## Installation

### Option 1: Install from NPM (Recommended)

```bash
# Install globally (IMPORTANT: Use -g flag!)
npm install -g @hillnote/mcp-server

# Verify installation worked
npm list -g @hillnote/mcp-server

# If using Homebrew Node.js, the files will be in:
# /opt/homebrew/lib/node_modules/@hillnote/mcp-server/
```

⚠️ **Important:** The `-g` flag is required for global installation. Without it, the package installs locally and won't work with the Claude Desktop configuration.

### Option 2: Install from Source

```bash
# Clone the repository
git clone https://github.com/hillnote/hillnote-mcp-server.git
cd hillnote-mcp-server

# Install dependencies (NO -g flag needed here)
npm install
```

## Updating to Latest Version

### NPM Installation

```bash
# Update to the latest version
npm update -g @hillnote/mcp-server

# Or reinstall to force latest version
npm install -g @hillnote/mcp-server@latest

# Check current version
npm list -g @hillnote/mcp-server

# After updating, restart your MCP client (Claude Desktop, Cursor, etc.)
```

### Source Installation

```bash
# Navigate to your cloned repository
cd /path/to/hillnote-mcp-server

# Pull latest changes
git pull origin main

# Reinstall dependencies
npm install

# After updating, restart your MCP client
```

### Version Check

To see what version you're currently running:

```bash
# For NPM installation
npm list -g @hillnote/mcp-server

# For source installation
cd /path/to/hillnote-mcp-server
cat package.json | grep version
```

### Troubleshooting Updates

If you experience issues after updating:

1. **Clear npm cache:**
   ```bash
   npm cache clean --force
   ```

2. **Uninstall and reinstall:**
   ```bash
   npm uninstall -g @hillnote/mcp-server
   npm install -g @hillnote/mcp-server
   ```

3. **Restart your MCP client completely** (not just reload - fully quit and reopen)

## Configuration

The MCP server automatically discovers all your Hillnote workspaces from the app's configuration:

- **macOS:** `~/Library/Application Support/Hillnote/workspaces.json`
- **Windows:** `%APPDATA%/Hillnote/workspaces.json`
- **Linux:** `~/.config/Hillnote/workspaces.json`

The Hillnote app can also set up Claude Desktop for you, with no Node.js install: **Settings β†’ Connections β†’ Local MCP β†’ Configure** next to Claude Desktop. It uses the server bundled with the app.

Name the server `hillnote-app`, as the app does. `hillnote` is the name Hillnote's cloud MCP server uses, so the two can be connected side by side.

### Configuration Examples

#### NPM Installation
If installed via NPM, use your global Node modules path:

```json
{
  "mcpServers": {
    "hillnote-app": {
      "command": "hillnote-mcp"
    }
  }
}
```

Find your path with: `npm root -g`

#### Source Installation
If cloned from GitHub:

```json
{
  "mcpServers": {
    "hillnote-app": {
      "command": "node",
      "args": ["/path/to/hillnote-mcp-server/index.js"]
    }
  }
}
```

### Client-Specific Configuration

<details>
<summary><strong>Claude Desktop</strong></summary>

Location: `~/Library/Application Support/Claude/claude_desktop_config.json`

Add the configuration above to this file.
</details>

<details>
<summary><strong>Cursor</strong></summary>

Location: Settings β†’ Features β†’ MCP

Add the configuration above to the MCP servers section.
</details>

<details>
<summary><strong>VS Code</strong></summary>

Install an MCP extension and add the configuration to your settings.json or extension configuration.
</details>

## Available Tools

### πŸ“ Workspace Management

#### `list_workspaces`
Lists all available workspaces with document counts and metadata.

```javascript
// No input required
// Returns: Array of workspace objects with path, name, overview, and documentCount
```

#### `read_registry`
Get complete workspace overview including all documents, folders, and relationships.

```javascript
// Input: { workspace: "workspace-name" }
// Returns: Complete registry with documents and folder structure
```

### πŸ“„ Document Operations

#### `read_document`
Read a specific document's content and metadata.

```javascript
// Input: { workspace: "workspace-name", documentId: "doc-id" }
// Returns: Document content, metadata, and frontmatter
```

#### `add_document`
Create a new document with content and metadata.

```javascript
// Input: {
//   workspace: "workspace-name",
//   name: "Document Name",
//   content: "Document content",
//   emoji: "πŸ“„",
//   description: "Brief description",
//   parent: "optional-folder-id"
// }
// Returns: { success: true, documentId: "new-id", fileName: "Document Name.md" }
```

The document keeps the title you give it: Hillnote lists a document under its **file name**, so the file is `Document Name.md` β€” only characters a file name cannot hold (`/ \ : * ? " < > |`) are dropped. Titles in any script work (`δΌšθ­°γƒ‘γƒ’.md`). Nothing is ever overwritten: an existing file with that name is an error.

#### `rename_document`
Rename a document and update its file name.

```javascript
// Input: { workspace: "workspace-name", documentId: "doc-id", newTitle: "New Title" }
// Returns: { success: true, newFileName: "New Title.md", path: "documents/New Title.md" }
```

A true rename: the content is kept byte for byte and the registry entry (emoji, pin, position) moves with it. Links to the document from other documents are not rewritten.

#### `delete_document`
Delete a document. Recoverable: the file moves to `.hillnote/trash/<timestamp>/…` in the workspace (kept 30 days) and `restore_from_trash` puts it back.

```javascript
// Input: { workspace: "workspace-name", documentId: "documents/Old Draft.md" }
// Returns: { success: true, path: "documents/Old Draft.md", trashPath: ".hillnote/trash/2026-09-18T10-00-00-000Z/documents/Old Draft.md" }
```

### πŸ—‘οΈ Trash

`delete_document`, `delete_rows` and `delete_database` move their target to the workspace trash instead of unlinking it. (Sheet rows and moodboard items are not recoverable.)

#### `list_trash`
What the trash holds, newest first.

```javascript
// Input: { workspace: "workspace-name" }
// Returns: { items: [{ path: "documents/Old Draft.md", kind: "document", deletedAt: "…", trashPath: "…" }], count: 1, retentionDays: 30 }
```

#### `restore_from_trash`
Put a deleted document, database row or database back where it was β€” with the registry entry (emoji, pin, position, links) it had. Never overwrites: if something now exists at the original path, the restore is refused.

```javascript
// Input: { workspace: "workspace-name", path: "documents/Old Draft.md" }   // or its trashPath, or just "Old Draft"
// Returns: { success: true, path: "documents/Old Draft.md", kind: "document", registryEntriesRestored: 1 }
```

### πŸ” Search

#### `search_documents`
Search documents with fuzzy matching and smart ranking.

```javascript
// Input: {
//   query: "search term",
//   workspace: "optional-workspace",
//   fuzzy: true,
//   threshold: 0.6,
//   limit: 10
// }
// Returns: Ranked search results with snippets and scores
```

### ✏️ Content Manipulation

#### `insert_content`
Insert content at a specific position with validation.

```javascript
// Input: {
//   workspace: "workspace-name",
//   documentId: "doc-id",
//   position: "start" | "end" | number | { line: number } | { after: "heading" },
//   text: "Content to insert",
//   validate: true,
//   preview: true
// }
// Returns: { success: true, preview: "...", validation: {...} }
```

#### `replace_content`
Replace text in a document with preview and occurrence info.

```javascript
// Input: {
//   workspace: "workspace-name",
//   documentId: "doc-id",
//   searchText: "text to find",
//   replaceText: "replacement text",
//   all: false,
//   caseSensitive: false,
//   wholeWord: false,
//   useRegex: false
// }
// Returns: { success: true, replacements: 1, preview: "..." }
```

#### `delete_content`
Delete content between positions or patterns.

```javascript
// Input: {
//   workspace: "workspace-name",
//   documentId: "doc-id",
//   startPos: 0 | { line: 5 } | { pattern: "## Section" },
//   endPos: 100 | { line: 10 } | { pattern: "## Next Section" }
// }
// Returns: { success: true, deletedChars: 95, preview: "..." }
```

### 🎯 AI Recipe Management

Recipes are AI prompt overrides that trigger custom instructions when a user's request matches specific topics.

#### `list_recipes`
List all AI prompt recipes in a workspace.

```javascript
// Input: { workspacePath: "/path/to/workspace" }
// Returns: Array of recipe objects with metadata
```

#### `get_recipe`
Get a specific recipe by ID.

```javascript
// Input: { workspacePath: "/path/to/workspace", recipeId: "recipe-id" }
// Returns: Complete recipe with trigger, instructions, and document references
```

#### `create_recipe`
Create a new AI prompt recipe.

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   recipe: {
//     when_user_asks_about: "quarterly reports",
//     override_instructions: "Use the company template and include KPIs...",
//     required_documents: ["documents/template.md"],
//     optional_documents: ["documents/past-reports.md"],
//     output_format: "markdown"
//   }
// }
// Returns: { success: true, recipe: { id: "recipe_...", ... } }
```

#### `update_recipe`
Update an existing recipe.

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   recipeId: "recipe-id",
//   updates: {
//     when_user_asks_about: "updated trigger",
//     override_instructions: "updated instructions"
//   }
// }
// Returns: { success: true }
```

#### `get_recipe_documents`
Load the content of documents referenced by a recipe.

```javascript
// Input: { workspacePath: "/path/to/workspace", recipeId: "recipe-id", includeOptional: true }
// Returns: { recipe: {...}, documents: { required: [...], optional: [...] } }
```

### πŸ“‹ Database & Task Management

Databases are flexible folders containing markdown files (rows) with a `database.json` configuration. They can be used as task boards by adding `status` columns with kanban views.

#### `create_database`
Create a new database in a workspace.

```javascript
// Input: {
//   workspace: "workspace-name",
//   name: "Project Tasks",
//   columns: [
//     { id: "title", name: "Title", type: "title" },
//     { id: "status", name: "Status", type: "status",
//       options: ["To Do", "In Progress", "Done", "Archived"],
//       optionColors: { "To Do": "gray", "In Progress": "amber", "Done": "emerald", "Archived": "purple" },
//       optionStates: { "To Do": "normal", "In Progress": "normal", "Done": "done", "Archived": "archive" }
//     },
//     { id: "priority", name: "Priority", type: "select", options: ["Low", "Medium", "High"] },
//     { id: "recurring", name: "Recurring", type: "recurring" }
//   ],
//   views: [
//     { id: "kanban", name: "Board", type: "kanban", groupBy: "status" },
//     { id: "table", name: "Table", type: "table" }
//   ],
//   defaultView: "kanban",
//   folderPath: "optional/subfolder"
// }
// Returns: { success: true, name: "...", path: "..." }
```

**Column types:** `title`, `text`, `number`, `select`, `multiselect`, `status`, `checkbox`, `date`, `url`, `email`, `recurring`, `location`, `image`

**Status columns** support `optionStates` mapping each option to `"normal"`, `"done"` (strikethrough), or `"archive"` (dimmed) β€” enabling kanban board behaviour.

**Recurring columns** support auto-resetting tasks on daily/weekly/monthly/yearly schedules.

#### `read_database`
Read a database with optional filtering, sorting, and searching.

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   search: "optional search query",
//   filters: [{ column: "status", operator: "equals", value: "In Progress" }],
//   sort: { column: "priority", direction: "desc" },
//   viewId: "kanban",
//   limit: 50
// }
// Returns: Database config (columns, views) and matching rows
```

#### `list_databases`
List all databases in a workspace.

```javascript
// Input: { workspace: "workspace-name" }
// Returns: Array of databases with metadata and row counts
```

#### `delete_database`
Delete a database and all its rows. Blocked unless `confirm: true`. Recoverable: the folder moves to the workspace trash (`restore_from_trash`).

```javascript
// Input: { workspace: "workspace-name", databasePath: "Project Tasks" }
// Returns: { success: true }
```

#### `add_rows`
Add one or more rows to a database.

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   rows: [
//     { title: "Implement feature X", status: "To Do", priority: "High", _content: "Task details..." },
//     { title: "Fix bug Y", status: "In Progress", priority: "Medium" }
//   ]
// }
// Returns: { success: true, addedRows: [{ title: "Implement feature X", fileName: "Implement feature X.md", … }], count: 2 }
```

A row's **file name is its title** β€” in the app and here β€” so a row keeps the title you give it (`Implement feature X.md`); a duplicate title becomes `Implement feature X 2`. `addedRows[].title` is the name the row now has.

#### `update_rows`
Update rows by ID (file path) or matching criteria.

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   updates: { status: "Done", priority: "Low" },
//   ids: ["/path/to/row.md"],       // by file path
//   where: { status: "In Progress" } // or by criteria
// }
// Returns: { success: true, updatedRows: [...], count: 1 }
```

`updates.title` renames the row's file (one row at a time). The file is written in place and then renamed β€” a rename never deletes anything, and a title that names the file the row already has is a plain update.

Filters (`read_database`, `read_sheet`): `greaterThan` / `lessThan` (and the sheet's `…OrEqual` forms) compare **dates** when the filter value is one (`{ column: "due", operator: "lessThan", value: "2026-10-01" }`), and `equals` on a multiselect column means "has this option".

#### `delete_rows`
Delete rows by ID or matching criteria.

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   ids: ["/path/to/row.md"],
//   where: { status: "Archived" }
// }
// Returns: { success: true, deletedRows: [{ title: "…", trashPath: "…" }] }
```

Recoverable: deleted row files move to the workspace trash (`restore_from_trash` takes a row's original path or its title). A `where` that matches several rows needs `allowMultiple: true`.

#### `add_column`
Add a new column to a database.

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   column: { id: "assignee", name: "Assignee", type: "text" },
//   defaultValue: "Unassigned"
// }
// Returns: { success: true }
```

#### `update_column`
Update column properties (name, type, options, colors, states).

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   columnId: "status",
//   updates: { options: ["To Do", "In Progress", "Review", "Done"] }
// }
// Returns: { success: true }
```

#### `delete_column`
Remove a column from a database and all rows.

```javascript
// Input: { workspace: "workspace-name", databasePath: "Project Tasks", columnId: "priority" }
// Returns: { success: true }
```

#### `create_view`
Create a saved view with filters, sorts, and display options.

```javascript
// Input: {
//   workspace: "workspace-name",
//   databasePath: "Project Tasks",
//   view: {
//     name: "Active Tasks",
//     type: "kanban",        // table, kanban, gallery, calendar, chart, gantt, dashboard, map (Custom tool views: add_tool_view)
//     groupBy: "status",
//     filters: [{ column: "status", operator: "notEquals", value: "Archived" }],
//     sorts: [{ column: "priority", direction: "desc" }]
//   }
// }
// Returns: { success: true, viewId: "..." }
```

#### `list_views`
List all saved views for a database.

```javascript
// Input: { workspace: "workspace-name", databasePath: "Project Tasks" }
// Returns: Array of view configurations
```

### πŸ’Ύ Sheets

Sheets are CSV-backed datasets: a folder with a `sheet.json` config and a single `data.csv` β€” no per-row documents, built for large datasets (tens of thousands of rows). Rows carry stable ids in a hidden `_hnid` CSV column; edits made through these tools are merged into a running Hillnote app within a couple of seconds (or on the sheet's next open). Sheets can be LARGE β€” always filter/search and paginate.

#### `list_sheets`
List all sheets in a workspace with their columns and row counts.

```javascript
// Input: { workspace: "workspace-name" }
// Returns: { sheets: [{ name, path, columns: [{ id, name, type }], rowCount }], count }
```

#### `read_sheet`
Read a sheet with filtering, sorting, searching, and pagination.

```javascript
// Input: {
//   workspace: "workspace-name",
//   sheetPath: "Customers",              // relative to documents/, from list_sheets
//   search: "acme",                      // optional, matched across all columns
//   filters: [{ column: "plan", operator: "equals", value: "Pro" }],
//   sort: { column: "mrr", direction: "desc" },
//   limit: 50,                           // default 50, max 200
//   offset: 0
// }
// Returns: { sheet: { name, path, columns, views }, rows: [{ id, ...cells }],
//            count, totalRows, hasMore }
```

**Filter operators:** `equals`, `notEquals`, `contains`, `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual`, `isEmpty`, `isNotEmpty`

#### `add_sheet_rows`
Append rows to a sheet (row ids are generated automatically).

```javascript
// Input: {
//   workspace: "workspace-name",
//   sheetPath: "Customers",
//   rows: [{ title: "Acme Corp", email: "hi@acme.com", mrr: 99 }]
// }
// Returns: { success: true, added: 1, ids: ["r_..."], totalRows: 30001 }
```

#### `update_sheet_rows`
Update cells on existing rows, targeted by id or by equality match.

```javascript
// Input: {
//   workspace: "workspace-name",
//   sheetPath: "Customers",
//   updates: { plan: "Pro", mrr: 199 },
//   options: { ids: ["r_..."] }          // or { where: { column: "email", value: "hi@acme.com" } }
// }
// Returns: { success: true, count: 1, updatedIds: ["r_..."] }
```

#### `delete_sheet_rows`
Permanently delete rows by id. Requires `confirm: true`.

```javascript
// Input: { workspace: "workspace-name", sheetPath: "Customers",
//          ids: ["r_..."], confirm: true }
// Returns: { success: true, deleted: 1, totalRows: 30000 }
```

#### `create_sheet`
Create a new sheet. The first column is always the title column.

```javascript
// Input: {
//   workspace: "workspace-name",
//   name: "Customers",
//   columns: [
//     { name: "Customer" },                                   // first = title column
//     { name: "MRR", type: "number" },
//     { name: "Plan", type: "select", options: ["Free", "Pro"] }
//   ],
//   rows: [{ title: "Acme Corp", mrr: 99, plan: "Pro" }],     // optional seed rows
//   folderPath: "optional/subfolder"
// }
// Returns: { success: true, sheetPath: "Customers", columns, rowCount: 1 }
```

**Column types:** `title`, `text`, `number`, `checkbox`, `date`, `datetime`, `email`, `url`, `select`, `multiselect`

### πŸ€– Kanban Automation (local only)

A database or sheet with a **status** column can run its board by itself. Per status, Hillnote can **start an agent CLI** (`claude`, `codex`, `cursor`, `antigravity`, `copilot`) on a card that lands there β€” in the board's project folder, with the task as its prompt β€” and/or **auto-move** every card that lands there on to another status (as soon as it lands, or after a delay). Single cards can be **scheduled** to move at a set time.

**Only moves Hillnote makes set anything off** (a drag in the app, or a scheduled move it applies): editing a status with `update_rows` / `update_sheet_rows` starts nothing. To hand a card on, schedule the move β€” `at: "now"` works. Scheduled moves run on the machine that scheduled them, while Hillnote is open (or once when it next opens).

#### `get_board_automation`
A board's statuses with their agent and auto-move, the defaults for delegated agents, this machine's project folder, and pending scheduled moves. Omit the board to list every scheduled move in the workspace.

```javascript
// Input: { workspace, databasePath: "Tasks" }        // or sheetPath; omit both for all scheduled moves
// Returns: { board, statusColumn, statuses: [{ status, agent: { cli, instructions, permissions, whenDoneMoveTo } | null,
//            autoMove: { to, afterMinutes } | null }], defaults, projectFolder: { thisBoard, allBoards, effective },
//            scheduledMoves: [{ id, row, to, at, auto, thisMachine }], agentClis, notes }
```

#### `configure_board_automation`
Change only what you pass. `null` removes an agent / auto-move / folder.

```javascript
// Input: {
//   workspace, databasePath: "Tasks",
//   statuses: {
//     "In progress": { agent: { cli: "claude", instructions: "Implement it, run the tests", permissions: "ask", whenDoneMoveTo: "Review" } },
//     "Done": { autoMove: { to: "Archived", afterMinutes: 1440 } },   // 0 = as soon as it lands
//     "Inbox": { autoMove: null }
//   },
//   defaults: { permissions: "ask", closeAfterMinutes: 2, notifyOnInput: true },
//   projectFolder: { thisBoard: "/Users/me/builds/app" }                // or allBoards; this machine only
// }
```

#### `schedule_card_move`
Move one card to a status at a time (default `"now"`) β€” Hillnote makes the move, so its agent and auto-move run. One schedule per card.

```javascript
// Input: { workspace, databasePath: "Tasks", row: "Fix login", to: "In progress", at: "2026-10-23 09:00" }
//        // row: a database row title, or a sheet row id (r_…); at: "now" | ISO 8601 | "YYYY-MM-DD HH:MM" (local)
// Returns: { scheduled: { id, row, to, at }, whenItLands: { startsAgent, thenAutoMovesTo } }
```

#### `cancel_scheduled_move`
```javascript
// Input: { workspace, id: "sm_…" }
```

### 🎨 Slide Presentations

Slides use a two-phase workflow: write the story first, then add visual design.

#### `get_slides_story_guide`
Get the storytelling guide with 8 proven techniques (Hero's Journey, Sparklines, In Medias Res, etc.).

```javascript
// No input required
// Returns: Story-writing guide with narrative techniques and structure advice
// Important: Do NOT use any visual layout markers (~split, ~inline, ~bg-, etc.) during this phase
```

#### `get_slides_visual_guide`
Get the visual design guide for adding layout markers, images, charts, and diagrams.

```javascript
// Input: { documentPath: "documents/my-presentation.slides.md" }
// Returns: Visual design guide with layout markers, chart types, mermaid diagrams, and examples
// Note: Requires the .slides.md file to already exist (proves story has been drafted)
```

**Important:** When creating slides with `add_document`, the title MUST end with `.slides.md` (e.g., "My Presentation.slides.md"). The `.slides.md` extension is what makes it a slide presentation.

**Example workflow:**
```javascript
// 1. Get the story guide first
get_slides_story_guide()

// 2. Create the slide presentation (story content only, no visual markers)
add_document({
  workspace: "workspace-name",
  name: "Quarterly Review.slides.md",  // Note: ends with .slides.md
  content: `---
type: slides
theme: minimal
---

# Quarterly Review

Q4 2024 Results

***

# Key Metrics

- Revenue: $1.2M
- Growth: 25%
- Users: 10,000+
`
})

// 3. Get the visual guide and enhance slides in batches of 3-5
get_slides_visual_guide({ documentPath: "documents/quarterly-review.slides.md" })
// Then edit the file to add ~split, ~inline, ~bg-, images, charts, etc.
```

### πŸ“Œ Moodboards

Moodboards (`.moodboard.md`) are free-form boards of images, document cards, videos, text notes, sticky notes, link cards, colour swatches, frames and shapes, optionally joined by connectors. The board JSON is machine-managed β€” never hand-edit it and never use the content tools on it (they refuse `.moodboard.md` paths). All six tools write the file on disk directly; an open board in the app re-parses it automatically.

#### `get_moodboard_guide`
Get the guide for creating and editing moodboards: item types, coordinates, default sizes, connectors, `#index` aliases and best practices.

```javascript
// No input required
// Returns: { success: true, guide: "...", usage_notes: { ... } }
```

**Important:** When creating a moodboard with `add_document`, the title MUST end with `.moodboard.md` (e.g., "Brand Inspiration.moodboard.md"). Do NOT provide content β€” the system writes the empty board and returns `moodboardPath`.

#### `draw_on_moodboard`
Draw a diagram in one call: flowcharts, pipelines, architecture maps, org charts, mind maps and card grids. Give nodes and edges; Hillnote lays them out, sizes each box to its text and routes the arrows. Prefer it over `add_moodboard_items` for anything with connections. It needs no guide call.

```javascript
// Input: {
//   workspace: "workspace-name",
//   moodboardPath: "documents/architecture.moodboard.md",
//   layout: "flow",                                   // flow | tree | mindmap | grid
//   direction: "LR",                                  // auto | TB | LR
//   nodes: ["Browser", { id: "api", label: "API server", tint: "mint" }, { id: "ok", label: "Cached?", shape: "diamond" }],
//   edges: [["Browser", "api", "HTTPS"], ["api", "ok"]],  // edges alone are enough
//   name: "system-overview"                           // call again with this name to redraw in place
// }
// Returns: { success: true, refs: { Browser: "m_…", api: "m_…", ok: "m_…" }, bounds, drawn, connectorsDrawn, replaced, warnings, issues }
```

A redraw keeps item ids but resets positions changed by hand. An unknown endpoint or duplicate id fails the call and nothing is written.

#### `render_moodboard`
See a board as a picture: the running app paints it the way Export as Image does and the result carries a PNG (about 1.6 megapixels; pass `ids` or `region` to look closer). If the app is not running, the result has `rendered: false`, the reason and the `issues`, and the app is never launched.

```javascript
// Input: { workspace: "workspace-name", moodboardPath: "documents/architecture.moodboard.md", region?: { x, y, w, h }, ids?: [...] }
// Returns: { rendered: true, path, width, height, scale, issues } plus the image
```

Every write (`draw_on_moodboard`, `add_moodboard_items`, `update_moodboard_items`) returns `warnings` for input that was ignored or corrected, and `issues` for problems on the board: `edge_through_item`, `text_overflow`, `overlap`, `label_overlap`, `off_frame`.

#### `read_moodboard`
Read and parse a moodboard file, returning an English summary plus every item (with ids), connector and the board settings. On a large board, narrow it with `ids` or `region` (`{ x, y, w, h }`), or pass `compact: true` for ids, positions and short labels only.

```javascript
// Input: { workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md" }
// Returns: { moodboardPath, summary, board: { bg, texture, grid }, viewport, itemCount, connectorCount, strokeCount, items: [...], connectors: [...], warnings: [] }
```

#### `add_moodboard_items`
Append items (and optional connectors) to a moodboard file. Ids are assigned and returned. Frames go to the back layer; everything else on top.

```javascript
// Input: {
//   workspace: "workspace-name",
//   moodboardPath: "documents/brand-inspiration.moodboard.md",
//   items: [
//     { type: "frame", x: 0, y: 300, w: 620, h: 200, title: "Palette", color: "sand" },
//     { type: "image", x: 0, y: 0, src: "resources/images/Brand Inspiration/coast.jpg", caption: "Coastline" },
//     { type: "swatch", x: 40, y: 340, hex: "#0f3d5e", label: "Deep sea" },
//     { type: "doc", x: 720, y: 0, path: "documents/research/notes.md", color: "mint" },
//     { type: "text", x: 720, y: 100, text: "Takeaway: pacing over polish.", fontSize: 20, tint: "peach" }
//   ],
//   connectors: [
//     { from: "#3", to: "#4", label: "cites", style: { dash: "dashed" } }   // "#<index>" = items[index] of this call
//   ]
// }
// Returns: { success: true, added: 5, ids: [...], connectorsAdded: 1, connectorIds: [...], totalItems, totalConnectors, warnings: [], summary }
```

**Item types:** `image`, `doc`, `video`, `text`, `link`, `swatch`, `frame`, `shape`, `sticky`

**Item properties:**
- **Common:** `type`, `x`, `y`, `w`, `h` (omit `w`/`h` for the type default), `locked`, `opacity` (0..1)
- **image:** `src` (`resources/images/<board>/<file>` or `https://…` β€” never base64/`data:`/absolute paths), `fit` (cover/contain), `caption`
- **doc:** `path` (e.g. `documents/notes.md`), `expanded`, `previewHeight`, `color` (tint key)
- **video:** `url` (YouTube/Vimeo) or `provider` + `videoId`, `title`
- **text:** `text`, `fontSize` (14/16/20/28), `align`, `color` (hex), `tint` (key)
- **link:** `url` (http/https), `title`, `description`, `image` (https preview picture; the app fetches og:image automatically when omitted and grows the card to 200 tall)
- **swatch:** `hex` (`#rrggbb`), `label`
- **frame:** `title`, `color` (tint key or hex)
- **shape:** `kind` (rect/ellipse), `fill`, `stroke`, `strokeWidth`, `radius`
- **sticky:** `text`, `color` (tint key; default `sand` = yellow, never uncoloured), `fontSize` (14/16/20/28), `align` β€” a 200Γ—200 sticky-note card that keeps its size

**Connectors:** `{ from, to, label?, style? }` β€” endpoints are an item id, `"#<index>"` (this call's items), `{ item, side }` (`auto|top|right|bottom|left`) or a free point `{ x, y }`. `style`: `color`, `width` (1..12), `dash` (solid/dashed/dotted), `start`/`end` (none/arrow/dot), `curve` (curved/straight/elbow). Dropped items and unresolvable connectors are reported in `warnings`.

#### `update_moodboard_items`
Pass `connectors: [{ id, from?, to?, label?, style? }]` to change arrows as well; `label: null` removes a label.

Patch existing items in place by id β€” move, resize, recaption, retint, relock or change any field the item's type accepts. Connectors stay attached. Only the fields you pass change; `null` removes an optional field (`caption`, `title`, `label`, `color`, `tint`, `radius`, `previewHeight`, `description`, `image`). A patch that would leave the item invalid is skipped with a reason and the item is left as it was; items with `locked: true` are skipped unless the patch sets `locked: false`; `type` is immutable (remove + add instead).

```javascript
// Input: {
//   workspace: "workspace-name",
//   moodboardPath: "documents/brand-inspiration.moodboard.md",
//   updates: [
//     { id: "m_a1b2c3d4", x: 360, y: 0, caption: null },          // move, drop the caption
//     { id: "m_e5f6g7h8", tint: "coral", text: "Risk: pacing" },   // retint + rewrite a note
//     { id: "m_i9j0k1l2", locked: false, w: 480, h: 270 }          // unlock and resize in one go
//   ]
// }
// Returns: { success: true, updated: 3, ids: [...], skipped: [{ id, reason }], notFound: [], warnings: [], summary, totalItems }
// Nothing updated β†’ { error: "No items were updated …", skipped, notFound } and the file is not written.
```

#### `remove_moodboard_items`
Remove items by id (`ids`; their connectors go too) or single arrows by id (`connectorIds`).

```javascript
// Input: { workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md", ids: ["m_a1b2c3d4"] }
// Returns: { success: true, removed: 1, removedIds: [...], notFound: [], connectorsRemoved: 1, remainingItems, remainingConnectors, summary }
```

#### `clear_moodboard`
Remove every item, connector and pen stroke, keeping the board's background/texture settings. A non-empty board requires `confirm: true`.

```javascript
// Input: { workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md", confirm: true }
// Returns: { success: true, message: "All items, connectors and pen strokes cleared from moodboard" }
```

**Example workflow:**
```javascript
// 1. Get the moodboard guide first
get_moodboard_guide()

// 2. Create a new moodboard (no content)
add_document({
  workspace: "workspace-name",
  title: "Brand Inspiration.moodboard.md"  // Note: ends with .moodboard.md, no content
})
// β†’ { ..., moodboardPath: "documents/brand-inspiration.moodboard.md" }

// 3. Add items (and connectors between them)
add_moodboard_items({
  workspace: "workspace-name",
  moodboardPath: "documents/brand-inspiration.moodboard.md",
  items: [
    { type: "text", x: 0, y: 0, text: "Brand Inspiration", fontSize: 28 },
    { type: "image", x: 0, y: 160, src: "https://images.example.com/coast.jpg", caption: "Coastline" },
    { type: "swatch", x: 360, y: 160, hex: "#0f3d5e", label: "Deep sea" }
  ],
  connectors: [{ from: "#1", to: "#2", label: "palette" }]
})

// 4. Read it back (ids, connectors, settings) before editing further
read_moodboard({ workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md" })

// 5. Change items in place β€” move, retint, recaption; connectors stay attached
update_moodboard_items({ workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md", updates: [{ id: "m_a1b2c3d4", x: 360, caption: null }] })

// 6. Targeted removal β€” attached connectors go with the item
remove_moodboard_items({ workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md", ids: ["m_a1b2c3d4"] })

// 7. Only to start over
clear_moodboard({ workspace: "workspace-name", moodboardPath: "documents/brand-inspiration.moodboard.md", confirm: true })
```

### πŸ› οΈ HTML Tool Management

#### `add_html_tool`
Create an interactive HTML tool in the workspace.

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   toolName: "calculator",
//   description: "Scientific calculator",
//   category: "utilities",  // optional
//   files: [
//     { filename: "index.html", content: "<!DOCTYPE html>...", isEntryPoint: true },
//     { filename: "styles.css", content: "body { ... }" },
//     { filename: "script.js", content: "// JS code" }
//   ]
// }
// Returns: { success: true, path: "resources/html/calculator", entryPoint: "index.html", sheets: [], markdownLink: "[html:calculator](...)" }
```

Tools run in a sandbox where `localStorage`, `sessionStorage`, IndexedDB and cookies don't persist. A tool keeps its **records in a Sheet** and small state in `hillnote.settings`. Declare sheets with the optional `sheets` parameter (max 20):

```javascript
// sheets: [
//   // with columns β†’ a NEW sheet at documents/Tools/Expenses, owned by the tool (first column = row title)
//   { name: "Expenses", columns: [{ name: "Item" }, { name: "Amount", type: "number" }, { name: "Date", type: "date" }] },
//   // name only β†’ connects the EXISTING sheet with that name or folder name (the user approves access once β€”
//   // no prompt when its sheet.json is already owned by this tool)
//   { name: "CRM" }
// ]
// Returns sheets: [{ name: "Expenses", path: "Tools/Expenses", owned: true,
//   columns: [{ id: "title", name: "Item", type: "title" }, { id: "amount", name: "Amount", type: "number" }, …] }, …]
```

Every spec is validated before anything is written: a new sheet fails if `documents/Tools/<name>` already exists (connect it by name instead), column names must be distinct, types are create_sheet's (`text`, `number`, `checkbox`, `date`, `datetime`, `email`, `url`, `select`, `multiselect`, `location`, `image`; the first column is always the title), and a name-only spec must match exactly one sheet. The declarations are recorded in the tool's `tool.meta.json` (`sheets`), and the new sheet's `sheet.json` gets an `owner: { tool: "resources/html/<tool>" }` marker. In the tool:

```javascript
const expenses = await hillnote.sheet('Expenses');
const rows = await expenses.rows();                 // [{ id, title, amount, date }] β€” keys are column ids
await expenses.add({ title: 'Coffee', amount: 3.5 });
await expenses.update(rows[0].id, { amount: 4 });
await expenses.remove(rows[0].id);
expenses.onChange(() => render());                   // edits made elsewhere in Hillnote
hillnote.settings.set('tab', 'month');              // small state: get/set/remove/all, JSON values
```

**Existing databases and Custom views.** `databases: [{ name: "Cards" }]` connects an existing database (connect-only β€” tools never create databases); the tool reads/writes it with `await hillnote.database('Cards')` (same `rows/add/update/remove/onChange`; row ids are the row documents' filenames and setting `title` renames the row). Mark one sheet or database `primary: true` and the tool reads it with `await hillnote.data()`. `add_tool_view` then shows the tool as a **Custom view tab** of a database/sheet β€” there `data()` is that view's rows, with the view's filters, search and sort applied (`rows({ ignoreView: true })` for everything), and `hillnote.context` (after `await hillnote.ready()`) says where it is shown.

#### `attach_tool_sheet`
Give an EXISTING tool a sheet β€” for example when moving it off `localStorage`. Same create/connect rules as `add_html_tool`'s `sheets`. Updates the tool's `tool.meta.json` (every other field kept; a sheet with the same name is replaced) and creates one only if the tool has none β€” a `tool.meta.json` that exists but can't be read is an error, and nothing is written. Parallel calls on one tool are serialized. The tool must be `resources/html/<tool>` or `resources/html/<category>/<tool>`. Loose tools (a single `.html` directly in `resources/html/`) are refused. Additive β€” never deletes sheets or rows.

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   toolName: "expense-tracker",          // or toolPath: "resources/html/expense-tracker" (folder or entry file)
//   category: "finance",                  // optional; category folders are searched when omitted
//   sheet: { name: "Expenses", columns: [{ name: "Item" }, { name: "Amount", type: "number" }] }  // omit columns to connect
// }
// Returns: { success: true, tool: "resources/html/expense-tracker",
//   sheet: { name: "Expenses", path: "Tools/Expenses", columns: [...], owned: true },
//   hint: 'In the tool: const s = await hillnote.sheet("Expenses"); …' }
```

#### `attach_tool_database`
Connect an EXISTING database to an EXISTING tool (same rules as `add_html_tool`'s `databases`). Updates `tool.meta.json` (every other field kept; an entry with the same name is replaced); the user approves access once, in the app.

```javascript
// Input: { workspacePath, toolName: "deck-viewer" /* or toolPath */, database: { name: "Cards", primary: true } }
// Returns: { success: true, tool: "resources/html/deck-viewer",
//   database: { name: "Cards", path: "Games/Cards", columns: [{ id: "title", … }, …], primary: true },
//   hint: 'In the tool: const db = await hillnote.database("Cards") …' }
```

#### `add_tool_view`
Show a tool as a Custom view tab of a database or sheet (pass exactly one of `database` / `sheet`, by name or folder name). Appends `{ id, name, type: "tool", toolPath }` to its views and makes it the open view; the tool's `hillnote.data()` reads that data with the view's filters/search/sort. The user approves the tool's access to it once, in the app.

```javascript
// Input: { workspacePath, toolName: "deck-viewer" /* or toolPath */, database: "Cards" /* or sheet */, viewName: "Deck" }
// Returns: { success: true, view: { id: "deck", name: "Deck", type: "tool" },
//   source: { kind: "database", name: "Cards", path: "documents/Games/Cards" }, toolPath: "resources/html/deck-viewer/index.html" }
```

#### `edit_html_tool`
Edit files in an existing HTML tool (create, update, or delete files).

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   toolName: "calculator",
//   category: "utilities",  // optional
//   operations: [
//     { action: "update", filename: "index.html", content: "<!DOCTYPE html>..." },
//     { action: "create", filename: "utils.js", content: "// new file" },
//     { action: "delete", filename: "old-file.js" }
//   ],
//   updateMetadata: { description: "Updated calculator" }
// }
// Returns: { success: true, changes: { created: [...], updated: [...], deleted: [...] } }
```

#### `add_tool_to_doc`
Insert an HTML tool reference into a document.

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   documentPath: "documents/my-doc.md",
//   toolName: "calculator",
//   displayName: "My Calculator",  // optional
//   position: "end"  // "end", "beginning", or "after:<text>"
// }
// Returns: { success: true, toolLink: "[html:My Calculator](...)" }
```

#### `list_html_tools`
List all HTML tools in a workspace.

```javascript
// Input: { workspacePath: "/path/to/workspace", category: "utilities" }
// Returns: Array of HTML tools with metadata and markdown links
```

#### `get_html_tool`
Get a specific HTML tool's details and files.

```javascript
// Input: { workspacePath: "/path/to/workspace", toolName: "calculator", category: "utilities" }
// Returns: Tool info with all file contents, entry point, and markdown link
```

#### `read_html_file`
Read the content of a specific file inside an HTML tool.

```javascript
// Input: { workspacePath: "/path/to/workspace", filePath: "resources/html/calculator/index.html" }
// Returns: { filePath: "...", content: "..." }
```

#### `write_html_file`
Write or create a file inside an HTML tool folder. `tool.meta.json`, `tool.settings.json` (the tool's `hillnote.settings` state) and `tool_registry.json` are managed files β€” this tool, `replace_in_html_file` and `edit_html_tool` refuse them, under any spelling the filesystem treats as the same file (case, `ΕΏ`/`K` compatibility forms). Names that can alias another file on Windows β€” containing `:` or `~<digit>`, or ending in `.` or a space β€” are refused too.

```javascript
// Input: { workspacePath: "/path/to/workspace", filePath: "resources/html/calculator/style.css", content: "body { ... }" }
// Returns: { success: true, filePath: "..." }
```

#### `replace_in_html_file`
Find and replace text in an HTML tool file.

```javascript
// Input: {
//   workspacePath: "/path/to/workspace",
//   filePath: "resources/html/calculator/index.html",
//   searchText: "<title>Old Title</title>",
//   replaceText: "<title>New Title</title>"
// }
// Returns: { success: true, filePath: "..." }
```

### πŸ–₯️ App Interface Control (requires the running app)

These tools drive the **running Hillnote app's interface** through the Agent Bridge β€” a
localhost, token-gated control plane the app exposes while it's open. They let an agent
visibly show its work: open the document it just wrote, switch workspaces, check what the
user is looking at, open code in Build mode, check the app being built, and post progress
into the in-app activity feed.

Notes:
- The Hillnote app must be running (all other tools work without it).
- The first UI call from a new agent shows an approval dialog inside Hillnote; the
  decision is remembered per client (manage under Settings β†’ Connections).
- These tools are **local-only** β€” they are intentionally absent from the cloud MCP server.

#### `get_app_state`
Read what the app is currently showing: the open workspace, the open document
(including `isDirty` β€” if true, the user has unsaved edits; don't rewrite that file with
content tools until they save), and any QuickView document.

```javascript
// Input: {}
// Returns: { success: true, appState: { workspace, document: { path, isDirty }, quickViewDocumentPath, windowVisible, ... } }
```

#### `open_document`
Open an existing document in the app so the user can see it. `target: "quickview"` opens a
read-only side panel instead of replacing the user's main editor. Pass `heading`,
`text` or `anchorId` to also scroll to that spot and highlight it, as `scroll_to` does
(main editor only).

```javascript
// Input: { workspace: "workspace-name", document: "Meeting Notes", target: "main" | "quickview", focusWindow: true }
// Returns: { success: true, opened: { workspace, documentPath, target } }
// or:    { workspace: "workspace-name", document: "Meeting Notes", heading: "Action items" }
// Returns: { success: true, found: 1, highlighted: true }
```

#### `open_workspace`
Switch the app to a workspace (shows its landing page).

```javascript
// Input: { workspace: "workspace-name", focusWindow: true }
// Returns: { success: true, opened: { workspace } }
```

#### `scroll_to`
Scroll a document to a heading or exact text so the user can see it (opens the
document first if needed). The target gets a pulsing highlight that stays until
the user clicks anywhere in the editor. Fails with a clear error if not found.

```javascript
// Input: { workspace: "workspace-name", document: "Meeting Notes", heading: "Action items" }
// or:    { workspace: "workspace-name", document: "Meeting Notes", text: "budget approval", highlight: false }
// Returns: { success: true, found: 1, highlighted: true }
```

#### `highlight_text`
Flash pulsing highlights on text ("look at this part") β€” purely visual, nothing
is written to the document. Scrolls the first match into view; `all: true`
highlights every occurrence (up to 20). Cleared when the user clicks.

```javascript
// Input: { workspace: "workspace-name", document: "Meeting Notes", text: "TODO", all: true }
// Returns: { success: true, found: 4, highlighted: true }
```

#### `show_slide`
Jump a `.slides.md` deck to a specific slide (1-based), switching it into
presentation view first if needed.

```javascript
// Input: { workspace: "workspace-name", document: "Q3 Review.slides.md", slideNumber: 3 }
// Returns: { success: true, slide: 3, totalSlides: 8 }
```

#### `open_database`
Open a database (kanban/table/calendar board) in the app β€” databases are
folders, so `open_document` doesn't apply to them. Optionally switch the view
and/or flash a row (pulsing highlight until the user clicks). `add_rows` and
`update_rows` also trigger the app's follow mode, which opens the database and
flashes the added/renamed row automatically.

```javascript
// Input: { workspace: "workspace-name", database: "tasks", view: "kanban", highlightRow: "Ship v2" }
// Returns: { success: true, database: "tasks", opened: true, view: { id, name, type }, highlightedRow: { id, title }, rowFlashed: true }

// More options:
// filters: apply ad-hoc filters on top of the view (visible in the filter bar so the user can clear them)
//   { workspace, database: "tasks", filters: [{ column: "Status", operator: "equals", value: "Open" }] }
// scrollToColumn (kanban): scroll a column into view by its header value
//   { workspace, database: "tasks", view: "kanban", scrollToColumn: "In Progress" }
// calendarMode / calendarDate (calendar): switch month/week/day and navigate to a date
//   { workspace, database: "events", view: "calendar", calendarMode: "week", calendarDate: "2026-07-15" }
```

Live updates: when an agent changes rows with `add_rows`/`update_rows` while the
database is open, the board reindexes in place β€” on kanban, a card whose status
changed visibly slides from one column to the next.

#### `open_sheet`
Open a sheet (CSV-backed dataset) in the app β€” sheets are folders, so
`open_document` doesn't apply to them. Same controls as `open_database`:
optionally switch the view, apply filters, drive the calendar, and/or flash a
row (by its stable row id from `read_sheet`, or a partial title). `add_sheet_rows`
and `update_sheet_rows` also trigger the app's follow mode, which opens the
sheet and flashes the added/updated row automatically.

```javascript
// Input: { workspace: "workspace-name", sheet: "expenses", view: "table", highlightRow: "r_1f2e3d…" }
// Returns: { success: true, sheet: "expenses", opened: true, view: { id, name, type }, highlightedRow: { id, title }, rowFlashed: true }

// More options (same shapes as open_database):
//   { workspace, sheet: "expenses", filters: [{ column: "Category", operator: "equals", value: "Travel" }] }
//   { workspace, sheet: "events", view: "calendar", calendarMode: "week", calendarDate: "2026-07-15" }
```

Live updates: sheet row writes broadcast into any open view of that sheet β€” the
grid refreshes in place within a second.

#### `open_library`
Open a library in the app: its landing page (volumes, outlines, search), or one
section when `section` is given. Libraries are folders, so `open_document` doesn't
apply to them. Takes the same library/volume/section references as the library
tools. Use it after `search_library` or `get_library_section` to show the passage
you cited.

```javascript
// Input: { workspace: "workspace-name", library: "Handbook", section: "s-4f2a9c" }
// Returns: { success: true, library: { id, title, path }, section: { id, title, file }, ... }
```

#### `open_view`
Show Chat, Terminal, Files or the Browser filling the app's main area instead of
its side panel; `view: "workspace"` goes back. It switches to a tab that already
shows that view, or opens a new tab, so the user's document stays open. In Files,
`path` shows one file.

```javascript
// Input: { view: "files", path: "resources/report.pdf" }
// or:    { view: "terminal" }
```

#### `notepad`
The workspace's Notepad: a scratchpad in the side panel for anything throwaway
("jot this down", a list for now, a number to hold on to). What should last
belongs in a document. Actions: `read`, `append` (the normal way to write),
`replace` and `clear`. The Notepad also holds the user's own notes, so `replace`
and `clear` are for when the user asked or the text is the agent's own; they run
in the open panel, so the user can undo them. About 30 KB per call at most.

```javascript
// Input: { action: "append", text: "- call the printer back" }
// or:    { action: "read" }
```

#### `build_mode`
Drive Build mode, the app's coding side. Actions: `enter`, `exit`,
`open_project`, `open_file` (a project file in the code editor, optionally at a
`line`) and `send_to_terminal`. `send_to_terminal` only types: an instruction at
the project's coding agent, or a shell command with `to: "shell"`. Nothing is
sent or run until the user presses Enter.

```javascript
// Input: { action: "open_file", project: "website", file: "src/App.jsx", line: 42 }
// or:    { action: "send_to_terminal", text: "Add a dark mode toggle to the header" }
```

#### `check_preview`
Check a page of the app being built in a Builds project, the way a visitor sees
it. Hillnote loads it in a hidden window with no cookies or storage, then reports
console errors and warnings, uncaught exceptions and failed requests, with a
screenshot returned as an image. Only this computer's own servers (localhost).
Without `url` it checks the app Hillnote is running for the open project, and a
path such as `/settings` is a page of that app.

```javascript
// Input: { url: "/settings", click: "button[type=submit]", width: 390 }
// Returns: { success: true, ...the report } plus the screenshot as an image
```

#### `post_activity`
Post a short status line to the in-app agent activity feed so the user can follow along.

```javascript
// Input: { message: "Drafting section 2…", workspace: "workspace-name", document: "Meeting Notes" }
// Returns: { success: true, posted: true }
```

## Workspace Structure

Hillnote workspaces are typically stored in your Documents folder or custom locations:

```
~/Documents/YourWorkspace/
β”œβ”€β”€ readme.md                 # Workspace overview
β”œβ”€β”€ documents-registry.json   # Document metadata
β”œβ”€β”€ ai_prompt_overrides.json # AI prompt recipes/overrides
β”œβ”€β”€ documents/               # Markdown documents and databases
β”‚   β”œβ”€β”€ document-1.md
β”‚   β”œβ”€β”€ folder/
β”‚   β”‚   └── document-2.md
β”‚   └── Project Tasks/       # Database (e.g., task board)
β”‚       β”œβ”€β”€ database.json    # Database configuration (columns, views)
β”‚       β”œβ”€β”€ implement-feature-x.md  # Row (task) with frontmatter
β”‚       └── fix-bug-y.md    # Row (task) with frontmatter
└── resources/               # Assets and tools
    β”œβ”€β”€ images/             # Image attachments
    └── html/               # HTML tools
        └── tool-name/
            β”œβ”€β”€ index.html
            └── assets/
```

## Document Format

Documents use Markdown with YAML frontmatter:

```markdown
---
title: Document Title
tags: [tag1, tag2]
emoji: πŸ“„
description: Brief description
created: 2024-01-01T00:00:00Z
modified: 2024-01-02T00:00:00Z
---

# Document Title

Your content here...
```

## Development

### Project Structure

```
mcp-server/
β”œβ”€β”€ index.js                 # Main server entry point
β”œβ”€β”€ config.json             # Server configuration
β”œβ”€β”€ package.json            # Dependencies
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ index.js       # Tool aggregator
β”‚   β”‚   β”œβ”€β”€ workspace.js   # Workspace tools
β”‚   β”‚   β”œβ”€β”€ document.js    # Document tools
β”‚   β”‚   β”œβ”€β”€ content.js     # Content manipulation
β”‚   β”‚   β”œβ”€β”€ search.js      # Search tools
β”‚   β”‚   β”œβ”€β”€ recipe.js      # Recipe management
β”‚   β”‚   β”œβ”€β”€ html-tool.js   # HTML tool management
β”‚   β”‚   β”œβ”€β”€ database.js    # Database, row, column, and view management
β”‚   β”‚   β”œβ”€β”€ sheet.js       # Sheets (CSV-backed datasets)
β”‚   β”‚   β”œβ”€β”€ slides.js      # Slide presentation guides (story + visual)
β”‚   β”‚   └── moodboard.js   # Moodboards (.moodboard.md) β€” read/add/update/remove/clear + guide
β”‚   └── utils/
β”‚       β”œβ”€β”€ helpers.js     # Utility functions
β”‚       β”œβ”€β”€ sheetSchema.mjs # Sheet CSV format helpers (port of the app's sheetSchema)
β”‚       └── moodboardParser.mjs # Moodboard schema, parser and serializer (copy of the app's)
└── README.md
```

### Adding New Tools

1. Create a new tool file in `src/tools/`
2. Export tool definitions and handlers
3. Import in `src/tools/index.js`
4. Tools are automatically available to MCP clients

### Running in Development

```bash
# Enable watch mode
npm run dev

# Run the server
npm start
```

## Error Handling

All tools use structured error responses:

- `InvalidParams`: Missing or invalid parameters
- `InternalError`: Server-side errors
- `MethodNotFound`: Unknown tool name

## Security

- File operations are sandboxed to workspace directories
- No network requests are made, with one exception: the App Interface Control tools talk
  to the running Hillnote app on `127.0.0.1` only, authenticated by a per-launch token
  the app writes to its own config directory, and gated by per-client user consent
- Path traversal protection included
- Input validation on all operations

## License

MIT - See [LICENSE](LICENSE) file

## Support

- **Issues**: [GitHub Issues](https://github.com/hillnote/hillnote-mcp-server/issues)
- **Email**: support@hillnote.com
- **Documentation**: [Hillnote Docs](https://hillnote.com/docs)

---

Built with ❀️ by Rajath Bail

TDQS

B3.1/5.0

Scored across 84 tools

Disambiguation3/5

The server spans many clear resource domains, but several UI-navigation tools overlap heavily: open_document with a heading, scroll_to, and highlight_text all open/scroll/highlight, and library map/outline plus document-vs-sheet-vs-database retrieval require close reading. Descriptions help, but with 84 tools misselection remains plausible.

Naming Consistency4/5

Most names follow a predictable snake_case verb_noun pattern such as create_database, add_sheet_rows, and open_library, with some deviations like notepad, build_mode, scroll_to, and mixed get/read/list retrieval verbs. The convention is mostly consistent and readable.

Tool Count1/5

84 tools is far beyond a practical agent-facing scope; even accounting for Hillnote's broad document/database/sheet/library/moodboard feature surface, the set is extremely heavy and imposes high selection cost. This is an extreme count mismatch.

Completeness2/5

Core workflows exist across documents, databases, sheets, moodboards, and libraries, but descriptions reference add_task, rename_task, and delete_task while those tools are absent, creating dead ends. Several resources also lack lifecycle operations, including sheet deletion/column updates, HTML tool deletion, recipe/playbook deletion, and database view update/delete.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues