-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.py
More file actions
64 lines (52 loc) · 1.74 KB
/
config.py
File metadata and controls
64 lines (52 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
__all__ = [
"settings",
"SERVER_VERSION",
"MS_CLIENT_ID",
"MS_CLIENT_SECRET",
"MS_AUTH_SERVER_URL",
"MS_SCOPES",
"MS_TOKEN_STORE_PATH",
]
from pathlib import Path
from typing import List
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
SERVER_NAME: str = "outlook-assistant"
SERVER_VERSION: str = "v1.0.0"
MS_CLIENT_ID: str
MS_CLIENT_SECRET: str
MS_AUTH_SERVER_URL: str = "http://localhost:3333"
MS_SCOPES: List[str] = [
"offline_access",
"User.Read",
"Mail.Read",
"Mail.Send",
"Calendars.Read",
"Calendars.ReadWrite",
"Contacts.Read",
]
MS_TOKEN_STORE_PATH: str = str(Path.home() / ".outlook-mcp-tokens.json")
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
settings = Settings()
MS_CLIENT_ID = settings.MS_CLIENT_ID
MS_CLIENT_SECRET = settings.MS_CLIENT_SECRET
MS_AUTH_SERVER_URL = settings.MS_AUTH_SERVER_URL
MS_SCOPES = settings.MS_SCOPES
MS_TOKEN_STORE_PATH = settings.MS_TOKEN_STORE_PATH
SERVER_NAME = settings.SERVER_NAME
SERVER_VERSION = settings.SERVER_VERSION
# Microsoft Graph API
GRAPH_API_ENDPOINT = "https://graph.microsoft.com/v1.0/"
# Calendar constants
CALENDAR_SELECT_FIELDS = (
"id,subject,bodyPreview,start,end,location,organizer,attendees,isAllDay,isCancelled"
)
# Email constants
EMAIL_SELECT_FIELDS = "id,subject,from,toRecipients,ccRecipients,receivedDateTime,bodyPreview,hasAttachments,importance,isRead"
EMAIL_DETAIL_FIELDS = "id,subject,from,toRecipients,ccRecipients,bccRecipients,receivedDateTime,bodyPreview,body,hasAttachments,importance,isRead,internetMessageHeaders"
# Pagination
DEFAULT_PAGE_SIZE = 25
MAX_RESULT_COUNT = 50