Integrations
Outlook
Manage emails, calendar, and contacts
The Outlook integration provides access to Microsoft Outlook's API through the Integrate MCP server.
Installation
The Outlook integration is included with the SDK:
import { outlookIntegration } from "integrate-sdk/server";Setup
1. Create a Microsoft App Registration
- Go to Azure Portal - App Registrations
- Create a new registration
- Configure redirect URIs
- Create a client secret
- Note your Application (client) ID and Client Secret
2. Configure the Integration on Your Server
Add the Outlook integration to your server configuration. The integration automatically reads OUTLOOK_CLIENT_ID and OUTLOOK_CLIENT_SECRET from your environment variables:
import { createMCPServer, outlookIntegration } from "integrate-sdk/server";
export const { client: serverClient } = createMCPServer({
apiKey: process.env.INTEGRATE_API_KEY,
integrations: [
outlookIntegration({
scopes: [
"Mail.Read",
"Mail.Send",
"Calendars.ReadWrite",
"Contacts.Read",
], // Optional
}),
],
});You can override the environment variables by passing explicit values:
outlookIntegration({
clientId: process.env.CUSTOM_OUTLOOK_ID,
clientSecret: process.env.CUSTOM_OUTLOOK_SECRET,
scopes: ["Mail.Read", "Mail.Send"],
});3. Client-Side Usage
The default client automatically includes all integrations. You can use it directly:
import { client } from "integrate-sdk";
await client.authorize("outlook");
const messages = await client.outlook.listMessages({});If you're using a custom client, add the integration to the integrations array:
import { createMCPClient, outlookIntegration } from "integrate-sdk";
const customClient = createMCPClient({
integrations: [outlookIntegration()],
});Configuration Options
Prop
Type
Available Tools
outlook_list_messages- List email messagesoutlook_get_message- Get a specific messageoutlook_send_message- Send an emailoutlook_search- Search messages and events
Calendar
outlook_list_events- List calendar eventsoutlook_get_event- Get a specific eventoutlook_create_event- Create a new event
Contacts
outlook_list_contacts- List contactsoutlook_get_contact- Get a specific contact
Examples
Send an Email
const result = await client.outlook.sendMessage({
subject: "Meeting Follow-up",
body: {
contentType: "HTML",
content: "<p>Thanks for the great discussion today!</p>",
},
toRecipients: [{ emailAddress: { address: "colleague@example.com" } }],
});
console.log("Email sent:", result);List Messages
const result = await client.outlook.listMessages({
filter: "isRead eq false",
top: 10,
orderby: "receivedDateTime desc",
});
console.log("Unread messages:", result);Create Calendar Event
const result = await client.outlook.createEvent({
subject: "Team Standup",
start: {
dateTime: "2024-12-10T09:00:00",
timeZone: "Pacific Standard Time",
},
end: {
dateTime: "2024-12-10T09:30:00",
timeZone: "Pacific Standard Time",
},
attendees: [
{
emailAddress: { address: "team@example.com" },
type: "required",
},
],
});
console.log("Event created:", result);OAuth Scopes
The default scopes are ['Mail.Read', 'Mail.Send', 'Calendars.ReadWrite', 'Contacts.Read']. You may need different scopes:
Mail.Read- Read user mailMail.Send- Send mail as userMail.ReadWrite- Read and write user mailCalendars.Read- Read user calendarsCalendars.ReadWrite- Read and write user calendarsContacts.Read- Read user contactsContacts.ReadWrite- Read and write user contacts
Error Handling
try {
const result = await client.outlook.sendMessage({
subject: "Test",
body: { content: "Test message" },
toRecipients: [{ emailAddress: { address: "test@example.com" } }],
});
} catch (error) {
if (error.message.includes("invalid recipient")) {
console.error("Invalid email address");
} else if (error.message.includes("authentication")) {
console.error("Authentication failed");
} else {
console.error("Unexpected error:", error);
}
}Next Steps
- Explore the Gmail Integration
- Explore the Google Calendar Integration
- See Advanced Usage for more examples