calendar-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@calendar-mcpWhat's my schedule today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
calendar-mcp
An MCP (Model Context Protocol) server that reads your Microsoft 365 calendar and answers two questions for any day:
What meetings do I have? (
get_todays_meetings)When am I free? (
get_availability— busy blocks + free gaps within working hours)
It authenticates as you using the Microsoft device code flow (no admin consent, no app secrets) and reads your calendar via the Microsoft Graph API.
This README doubles as a learning guide structured around four topics:
1. Understand MCP Fundamentals & Architecture
What MCP is. The Model Context Protocol is an open standard that lets an AI client (Claude Desktop, Claude Code, etc.) call external tools, read resources, and use prompts through a uniform JSON-RPC interface. Instead of every integration being bespoke, an MCP server exposes capabilities and any MCP client can use them.
The three roles.
Role | In this project |
Host / Client | Claude Desktop or Claude Code — starts the server, sends requests |
Server |
|
Transport |
|
Message flow (this server):
Client calendar-mcp (server) Microsoft Graph
│ initialize ──────────────────▶ │
│ ◀────────────── capabilities │ │
│ tools/list ──────────────────▶ │
│ ◀──────── [get_todays_meetings, get_availability] │
│ tools/call get_availability ─▶ │
│ │ acquireTokenSilent (MSAL cache) │
│ │ GET /me/calendarView ──────────────▶│
│ │ ◀──────────────── events │
│ ◀──── text: free/busy slots │ │Architecture of this codebase (one responsibility per file — see team standards):
src/
├── index.ts MCP server: registers tools, formats output
├── login.ts one-time device-code sign-in CLI
├── config.ts env validation (Zod) → Config
├── logger.ts structured logger → STDERR (stdout is the protocol!)
├── time.ts timezone math (wall-clock ⇄ UTC instants)
├── types/calendar.ts Zod schemas + domain types + Result<T>
└── services/
├── auth-service.ts MSAL device-code flow + token cache persistence
├── graph-service.ts calls Microsoft Graph, normalizes events
└── availability-service.ts merges busy blocks, computes free gaps (pure)Two architectural rules worth internalizing:
stdout is sacred. A stdio MCP server speaks JSON-RPC on stdout. Any stray
console.logcorrupts the stream. That's whylogger.tswrites only to stderr.Auth is separated from serving. The interactive sign-in lives in a separate
loginscript. The server itself only refreshes tokens silently, so it never needs to prompt a human mid-request.
Related MCP server: testCal
2. Practical MCP Server Implementation & Deployment
Prerequisites
Node.js ≥ 18 (you have v22 ✓)
A Microsoft 365 / Outlook account with a calendar
An Azure App Registration (free — guide below)
Step A — Create an Azure App Registration
You need a Client ID and Tenant ID. This app uses delegated permissions (it acts as you), so no client secret and no admin consent are required.
Go to https://portal.azure.com → search App registrations → New registration.
Name:
calendar-mcp(anything).Supported account types:
Just your work/school account → Accounts in this organizational directory only.
Personal Microsoft accounts too → Accounts in any org directory and personal Microsoft accounts.
Redirect URI: leave blank. Click Register.
On the Overview page, copy:
Application (client) ID → this is
AZURE_CLIENT_IDDirectory (tenant) ID → this is
AZURE_TENANT_ID(or usecommonif you chose a multi-tenant/personal account type).
Left menu → Authentication → Advanced settings → set Allow public client flows to Yes. (Required for device code flow.) Save.
Left menu → API permissions → Add a permission → Microsoft Graph → Delegated permissions → search and add
Calendars.Read→ Add permissions.Personal accounts consent on first sign-in; org accounts may need an admin to Grant admin consent depending on tenant policy.
Step B — Configure the project
cp .env.example .env
# edit .env and set AZURE_CLIENT_ID (and AZURE_TENANT_ID if not "common")Variable | Required | Default | Notes |
| ✅ | — | Application (client) ID GUID |
|
| Tenant GUID, or | |
|
| Where tokens are stored (chmod 600) | |
| system tz | IANA name, e.g. | |
|
| Hour 0–23 for availability window | |
|
| Hour 1–24 for availability window |
Step C — Install, sign in, build
npm install
npm run login # device-code flow: opens a URL, you paste a code, sign in ONCE
npm run build # compile TypeScript → dist/npm run login prints something like:
To sign in, use a web browser to open https://microsoft.com/devicelogin
and enter the code ABCD-EFGH to authenticate.After success, a token cache is written to TOKEN_CACHE_PATH. The server uses it
silently from then on.
Step D — Run it
npm start # runs dist/index.js over stdio
# or during development:
npm run dev # runs src/index.ts via tsx (no build step)Deployment: wire it into an MCP client
Claude Desktop — edit claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"calendar": {
"command": "node",
"args": ["/Users/khushal/Documents/practice project/calendar-mcp/dist/index.js"],
"env": {
"AZURE_CLIENT_ID": "your-client-id-guid",
"AZURE_TENANT_ID": "common",
"TIMEZONE": "Asia/Kolkata"
}
}
}
}Claude Code (CLI):
claude mcp add calendar -- node "/Users/khushal/Documents/practice project/calendar-mcp/dist/index.js"Restart the client. The calendar server's tools will appear.
Note: run
npm run loginfirst so the token cache exists before the client launches the server. The server never prompts for sign-in itself.
3. Integrate MCP with a Real Workflow
Once connected, you talk to your calendar in natural language and the model picks the right tool:
You ask… | Tool called | Result |
"What meetings do I have today?" |
| Ordered list with times, locations, organizers |
"What's on my calendar on 2026-06-25?" |
| Same, for that date |
"When am I free today?" |
| Free gaps + busy blocks within 9–18 |
"Do I have a 2-hour block this afternoon?" |
| Model reads the free slots and reasons over them |
"Find me 30 min between meetings before 2pm" |
| Narrowed window |
Why this composes well: get_availability returns structured free/busy
spans, so the model can chain reasoning ("schedule the review in your longest free
block") without you doing the arithmetic. This is the real value of MCP — the tool
provides facts; the model provides judgment.
Example tool output:
Availability for 2026-06-23 (Asia/Kolkata), working hours 09:00–18:00:
Total free: 5h 30m
Free slots:
• 9:00 AM – 11:00 AM
• 11:30 AM – 1:00 PM
• 2:00 PM – 4:00 PM
Busy blocks:
• 11:00 AM – 11:30 AM
• 1:00 PM – 2:00 PM
• 4:00 PM – 6:00 PM4. Reinforcement & Validation
Validate the protocol without a calendar
The server answers initialize and tools/list before any auth. Smoke-test with
raw JSON-RPC (a well-formed dummy client ID is enough):
printf '%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| AZURE_CLIENT_ID=11111111-1111-1111-1111-111111111111 node dist/index.js 2>/dev/nullYou should see the server info and both tool schemas.
Validate the auth boundary
Calling a tool with no cached login returns a friendly, non-crashing error:
printf '%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_todays_meetings","arguments":{}}}' \
| AZURE_CLIENT_ID=11111111-1111-1111-1111-111111111111 TOKEN_CACHE_PATH=/tmp/none.json node dist/index.js 2>/dev/null
# → "Not signed in. Run `npm run login` ..."Validate against your real calendar
npm run login # if you haven't already
npx @modelcontextprotocol/inspector node dist/index.jsThe MCP Inspector opens a UI where you can call get_todays_meetings and
get_availability and see live results from your calendar.
Checklist
npm run buildcompiles with no errorstools/listreturns both toolsnpm run logincompletes and writes the token cacheget_todays_meetingsmatches what you see in Outlookget_availabilityfree + busy spans add up to the working windowAll-day events do not block availability; tentative meetings show as busy
Timezone is correct (compare a meeting time vs Outlook)
Things to try next (stretch goals)
Add a
find_slottool that takes a duration and returns the earliest free block.Expose the calendar as an MCP resource (read-only data) in addition to tools.
Support multiple calendars or a
freeBusyquery across attendees (/me/calendar/getSchedule).Cache Graph responses briefly to cut latency on repeated calls.
Security notes
The token cache (
TOKEN_CACHE_PATH) holds refresh/access tokens. It's writtenchmod 600and is git-ignored. Treat it like a password.Only
Calendars.Readis requested — the server cannot modify your calendar.No secrets are stored in code; the Client ID is not a secret but lives in env.
Project scripts
Command | Does |
| Run the server from source (tsx) |
| Compile to |
| Run the compiled server |
| One-time device-code sign-in (source) |
| Same, from compiled |
| Type-check without emitting |
Available Tools
2 toolsget_availabilityGet daily availabilityA
Report free and busy time within working hours for a given day, based on the Microsoft 365 calendar. Defaults to today.
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Target date in YYYY-MM-DD. Defaults to today in the server timezone. | |
| workingHoursEnd | No | Override the working-hours end hour (1-24). | |
| workingHoursStart | No | Override the working-hours start hour (0-23). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description bears the full disclosure burden. It does reveal several behaviors: it limits results to 'working hours,' uses the 'Microsoft 365 calendar' as the data source, and defaults to today. Yet it doesn't disclose the output format, timezone handling, or how working hours are determined, leaving notable gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core action and scope, and contains no filler. Every word contributes to understanding the tool's purpose and default behavior.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only tool with three optional, well-documented parameters and no output schema, the description covers purpose, scope, and default. However, without annotations or an output schema, it leaves out return-format details and lacks any positioning against the sibling tool, making it only minimally complete for agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides 100% coverage for all parameters, so the baseline is 3. The description adds minimal parameter-related meaning beyond what the schema already states—only reinforcing 'given day' and 'Defaults to today,' which are already documented on the date parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Report') and a clear resource ('free and busy time within working hours... based on the Microsoft 365 calendar'), making the tool's function easy to grasp. It implies a distinction from the sibling tool 'get_todays_meetings' by focusing on general daily availability rather than today's meetings, but it doesn't explicitly name the alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states it reports availability for 'a given day' and 'Defaults to today,' giving the agent a clear sense of when to use the tool. However, it doesn't provide explicit when-to-use versus when-not-to-use guidance or reference the sibling tool 'get_todays_meetings' as an alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_todays_meetingsGet meetings for a dayA
List the meetings on the signed-in user's Microsoft 365 calendar for a given day. Defaults to today if no date is provided.
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Target date in YYYY-MM-DD. Defaults to today in the server timezone. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden. It indicates a read-only operation ('List'), notes that it operates on the signed-in user's calendar, and mentions default date behavior. However, it does not disclose return format, pagination, or any limitations, which would be useful for a tool without annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single focused sentence (two clauses) that immediately states the action and scope, with no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description covers the core behavior and default. It could be more complete by describing the return structure or noting any restrictions, but it is adequate for basic use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (the only parameter 'date' is fully described with pattern and default). The description adds no new semantic meaning beyond the schema, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb ('List') and resource ('meetings on the signed-in user's Microsoft 365 calendar for a given day'), distinguishing it from the sibling tool get_availability which likely returns availability slots rather than meeting details.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context (listing meetings for a day, with default to today), but does not explicitly mention when to use this instead of get_availability, so it lacks explicit exclusion/alternative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
The two tools are distinct: one lists meetings, the other shows free/busy availability. While both relate to the calendar for a given day, their descriptions clearly differentiate the outputs.
Both tool names follow the 'get_' prefix with a clear noun phrase (todays_meetings, availability). The naming pattern is consistent and predictable.
With only two tools, the server feels under-scoped for a calendar integration. However, the narrow focus on read-only queries makes the count somewhat acceptable, though it is on the thin side.
The tool surface lacks any CRUD operations for meetings (create, update, delete) and only provides read-only queries. This is a significant gap for a calendar MCP server, as agents cannot manage calendar events.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Permissioned access to Outlook, OneDrive and Teams via the user's own Microsoft account
GDPR-compliant calendar access for AI assistants. Google, Microsoft 365, Apple & more. EU-hosted.
Manage Microsoft 365 email, calendar, contacts and inbox rules via the Graph API with OAuth 2.0.
Merged free/busy, find mutual time, propose bookings with human approval. Never event contents.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to manage Microsoft 365 and Outlook calendars through the Microsoft Graph API. It supports comprehensive event operations including listing, creating, and updating meetings, as well as finding available slots across multiple attendees.
- FlicenseAqualityDmaintenanceEnables users to get and set meeting appointments in Google Calendar.24
- AlicenseNot gradedqualityCmaintenanceEnables interaction with Outlook / Microsoft 365 calendar, allowing users to list events, get event details, find meeting times, and access calendar and profile information.161MIT
- -licenseNot gradedqualityNot gradedmaintenanceProvides access to Microsoft Teams, Outlook, Calendar, and SharePoint via the Microsoft Graph API, enabling natural language interactions to read and manage messages, emails, events, and files.1
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/khushalB-sf/calendar-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server