Skip to main content
Glama
ailenshen

Apple Notes MCP Server

get_note

Retrieve Apple Notes content as Markdown by specifying a note title, with optional folder filtering to locate specific notes.

Instructions

Get the full content of a note by its title, returned as Markdown. Optionally specify folder to disambiguate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesNote title (exact match)
folderNoFolder name to scope the search

Implementation Reference

  • Tool registration and handler implementation for "get_note". It calls the `getNoteBody` function from `applescript.ts`.
    server.tool(
      "get_note",
      "Get the full content of a note by its title, returned as Markdown. Optionally specify folder to disambiguate.",
      {
        title: z.string().describe("Note title (exact match)"),
        folder: z.string().optional().describe("Folder name to scope the search"),
      },
      async ({ title, folder }) => {
        try {
          const body = await getNoteBody(title, folder);
          return {
            content: [{ type: "text", text: body }],
          };
        } catch (e: unknown) {
          return {
            content: [{ type: "text", text: `Error: ${(e as Error).message}` }],
            isError: true,
          };
        }
      }
    );
  • Actual implementation of the `getNoteBody` function which runs the AppleScript to retrieve and convert note content from Apple Notes.
    export async function getNoteBody(title: string, folder?: string): Promise<string> {
      const folderClause = folder
        ? `of folder ${JSON.stringify(folder)}`
        : "";
    
      // Try to find by exact title; if folder is given, scope to that folder
      const script = `
    tell application "Notes"
      set matchedNotes to (every note ${folderClause} whose name is ${JSON.stringify(title)})
      if (count of matchedNotes) = 0 then
        error "Note not found: ${title.replace(/"/g, '\\"')}"
      end if
      return body of item 1 of matchedNotes
    end tell
    `;
      const html = await runAppleScript(script);
      return turndown.turndown(html);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ailenshen/apple-notes-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server