Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ You can install this server as a Desktop Extension for Claude Desktop using the
### Identity & Testing Tools

- **list_identities**: List sending identities (email addresses that can be used for sending)
- **check_function_availability**: Check which functions are available based on account permissions (includes setup guidance)
- **check_function_availability**: Check which functions are available based on account permissions (includes setup guidance). Calendar tools run over CalDAV, so calendar is reported available when CalDAV credentials are configured, regardless of the JMAP calendar capability.
- **test_bulk_operations**: Safely test bulk operations with dry-run mode
- Parameters: `dryRun` (default: true), `limit` (default: 3)

Expand Down
27 changes: 19 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
},
{
name: 'check_function_availability',
description: 'Check which MCP functions are available based on account permissions',
description: 'Check which MCP functions are available based on account permissions. Calendar tools run over CalDAV, so calendar is reported available when CalDAV credentials are configured, regardless of the JMAP calendar capability.',
inputSchema: {
type: 'object',
properties: {},
Expand Down Expand Up @@ -1747,7 +1747,19 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
case 'check_function_availability': {
const client = initializeClient();
const session = await client.getSession();


// Calendar tools run on CalDAV, not JMAP. So calendar is available if
// EITHER the JMAP calendar capability is present OR CalDAV credentials
// are configured (FASTMAIL_CALDAV_USERNAME / FASTMAIL_CALDAV_PASSWORD).
const jmapCalendar = !!session.capabilities['urn:ietf:params:jmap:calendars'];
const caldavConfigured = initializeCalDAVClient() !== null;
const calendarAvailable = jmapCalendar || caldavConfigured;
const calendarNote = jmapCalendar
? 'Calendar is available (JMAP)'
: caldavConfigured
? 'Calendar is available via CalDAV'
: 'Calendar access not available - set FASTMAIL_CALDAV_USERNAME and FASTMAIL_CALDAV_PASSWORD, or enable calendar scope in Fastmail account settings';

const availability = {
email: {
available: true,
Expand Down Expand Up @@ -1780,14 +1792,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
}
},
calendar: {
available: !!session.capabilities['urn:ietf:params:jmap:calendars'],
available: calendarAvailable,
functions: ['list_calendars', 'list_calendar_events', 'get_calendar_event', 'create_calendar_event'],
note: session.capabilities['urn:ietf:params:jmap:calendars'] ?
'Calendar is available' :
'Calendar access not available - may require enabling in Fastmail account settings',
enablementGuide: session.capabilities['urn:ietf:params:jmap:calendars'] ? null : {
note: calendarNote,
enablementGuide: calendarAvailable ? null : {
steps: [
'1. Log into Fastmail web interface',
'Option A (CalDAV): set FASTMAIL_CALDAV_USERNAME and FASTMAIL_CALDAV_PASSWORD (app password) — calendar tools run over CalDAV',
'Option B (JMAP scope): 1. Log into Fastmail web interface',
'2. Go to Settings → Privacy & Security → Connected Apps & API tokens',
'3. Check if calendar scope is enabled for your API token',
'4. If not available, you may need to upgrade your Fastmail plan or contact support'
Expand Down