Skip to main content
Glama
xybstone

macOS Calendar MCP Server

by xybstone

list-calendars

Retrieve all available macOS calendars through direct integration with the Calendar application, enabling event management without OAuth setup.

Instructions

列出所有macOS日历

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the list-calendars tool by executing AppleScript to retrieve and format the list of macOS calendars.
    async listCalendars() {
      try {
        const script = `tell application "Calendar" to get name of calendars`;
        const result = execSync(`osascript -e '${script}'`, { encoding: 'utf8' });
        const calendars = result.trim().split(', ');
        
        return {
          content: [
            {
              type: 'text',
              text: `📅 可用日历 (${calendars.length}个):\n${calendars.map(cal => `• ${cal}`).join('\n')}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`获取日历列表失败: ${error.message}`);
      }
    }
  • The handler function that implements the list-calendars tool by executing AppleScript to retrieve and format the list of macOS calendars.
    listCalendars() {
      try {
        const script = `tell application "Calendar" to get name of calendars`;
        const result = execSync(`osascript -e '${script}'`, { encoding: 'utf8' });
        const calendars = result.trim().split(', ');
        
        return {
          content: [{
            type: "text",
            text: `📅 可用日历 (${calendars.length}个):\n${calendars.map(cal => `• ${cal}`).join('\n')}`
          }]
        };
      } catch (error) {
        throw new Error(`获取日历列表失败: ${error.message}`);
      }
    }
  • The handler function that implements the list-calendars tool by executing AppleScript to retrieve and format the list of macOS calendars.
    listCalendars() {
      try {
        const script = `tell application "Calendar" to get name of calendars`;
        const result = execSync(`osascript -e '${script}'`, { encoding: 'utf8' });
        const calendars = result.trim().split(', ');
        
        return {
          content: [{
            type: "text",
            text: `📅 可用日历 (${calendars.length}个):\n${calendars.map(cal => `• ${cal}`).join('\n')}`
          }]
        };
      } catch (error) {
        throw new Error(`获取日历列表失败: ${error.message}`);
      }
    }
  • Input schema definition for the list-calendars tool (no parameters required).
    name: 'list-calendars',
    description: '列出所有macOS日历',
    inputSchema: {
      type: 'object',
      properties: {},
      additionalProperties: false,
    },
  • Registration of the list-calendars handler in the tool call switch statement.
    case 'list-calendars':
      return await this.listCalendars();

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/xybstone/macos-calendar-mcp'

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