pghoya2956/gdrive-mcp-server
If you are the rightful owner of gdrive-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Google Drive server provides secure and scoped access to Google Drive files and Google Sheets within a specified folder range, enabling AI assistants to interact with Google Drive content.
gdrive_search
Searches for files within the allowed folder scope on Google Drive.
gdrive_read_file
Reads the content of a file from Google Drive.
gsheets_read
Reads data from a Google spreadsheet with flexible range options.
gsheets_update_cell
Updates the value of a cell in a Google spreadsheet.
MCP Google Drive μλ²
μ§μ λ ν΄λ λ²μ λ΄μμ Google Drive νμΌκ³Ό Google Sheetsμ λν μμ νκ³ λ²μκ° μ§μ λ μ‘μΈμ€λ₯Ό μ 곡νλ Model Context Protocol (MCP) μλ²μ λλ€. μ΄ μλ²λ₯Ό ν΅ν΄ AI μ΄μμ€ν΄νΈκ° Google Drive μ½ν μΈ μ μνΈμμ©ν μ μμ΅λλ€.
λλΌμ΄λΈ μ κ·Ό λ²μ
μ΄ μλ²λ λ΄ λλΌμ΄λΈμ 곡μ λλΌμ΄λΈ λͺ¨λ μ§μν©λλ€. GDRIVE_ROOT_FOLDER_ID
λ‘ μ§μ λ ν΄λμ κ·Έ νμ ν΄λμλ§ μ κ·Όν©λλ€.
- λ΄ λλΌμ΄λΈ: νΉμ ν΄λ IDλ₯Ό μ€μ νλ©΄ ν΄λΉ ν΄λ μ΄νλ§ μ κ·Ό
- 곡μ λλΌμ΄λΈ: 곡μ λλΌμ΄λΈ λ΄ ν΄λ IDλ₯Ό μ€μ νλ©΄ ν΄λΉ λ²μλ§ μ κ·Ό
- API μ€μ :
supportsAllDrives: true
λ‘ λͺ¨λ λλΌμ΄λΈ μ ν μ§μ
κΈ°λ₯
- νμΌ μμ : Google Docs, Sheets λ° μΌλ° νμΌ μ½κΈ°
- κ²μ κΈ°λ₯: νμ©λ λ²μ λ΄μμ νμΌ κ²μ
- Sheets ν΅ν©: Google Sheets μ μ½κΈ° λ° μ λ°μ΄νΈ
- 보μ: Google APIλ₯Ό μ¬μ©ν OAuth2 μΈμ¦
- μ€λ₯ μ²λ¦¬: μ§μλμ§ μλ νμΌ μ νμ λν μ°μν μ²λ¦¬
μ¬μ© κ°λ₯ν λꡬ
νμΌ κ΄λ¦¬
gdrive_search
: Google Drive νμΌ κ²μ (query
,pageToken
,pageSize
)gdrive_read_file
: νμΌ λ΄μ© μ½κΈ° (fileId
)gdrive_read_large_file
: λμ©λ νμΌ μ½κΈ° (fileId
,startLine
,endLine
)gdrive_folder_structure
: ν΄λ ꡬ쑰 νμ (folderId
)gdrive_analyze_image
: μ΄λ―Έμ§ λΆμ (fileId
,prompt
)
μ€νλ λμνΈ
gsheets_read
: μνΈ λ°μ΄ν° μ½κΈ° (spreadsheetId
,ranges
,sheetId
)gsheets_update_cell
: μ μ λ°μ΄νΈ (fileId
,range
,value
)
μ§μ νμΌ μ ν
- Google Docs β Markdown
- Google Sheets β CSV
- Google Slides β ν μ€νΈ
- Google Drawings β PNG
- μΌλ° νμΌ (ν μ€νΈ/λ°μ΄λ리)
μ€μΉ
npm install @pghoya2956/gdrive-mcp-server
ꡬμ±
νκ²½ λ³μ
νλ‘μ νΈ λ£¨νΈμ λ€μ λ³μλ₯Ό ν¬ν¨ν .env
νμΌμ μμ±ν©λλ€:
CLIENT_ID=your-oauth-client-id
CLIENT_SECRET=your-oauth-client-secret
GDRIVE_CREDS_DIR=/path/to/credentials/directory
GDRIVE_ROOT_FOLDER_ID=your-root-folder-id
νκ²½ λ³μ μν :
CLIENT_ID
,CLIENT_SECRET
: ν ν° κ°±μ μ μ¬μ© (gcp-oauth.keys.jsonμ κ°κ³Ό λμΌ)GDRIVE_CREDS_DIR
: μΈμ¦ νμΌλ€μ΄ μ μ₯λλ λλ ν 리 κ²½λ‘GDRIVE_ROOT_FOLDER_ID
: μ κ·Όμ μ νν λ£¨νΈ ν΄λ ID
Google Cloud μμνκΈ°
-
- Google Drive API
- Google Sheets API
- Google Docs API
-
- μ‘°μ§ λ΄μμ ν μ€νΈνλ €λ©΄ "λ΄λΆ"λ₯Ό μ ν
- λ€μ OAuth λ²μλ₯Ό μΆκ°:
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/spreadsheets
-
OAuth ν΄λΌμ΄μΈνΈ ID μμ±
- μ ν리μΌμ΄μ μ ν: "λ°μ€ν¬ν± μ±"
- ν΄λΌμ΄μΈνΈμ OAuth ν€ JSON νμΌ λ€μ΄λ‘λ
-
μ격 μ¦λͺ μ€μ :
- λ€μ΄λ‘λν ν€ νμΌμ μ΄λ¦μ
gcp-oauth.keys.json
μΌλ‘ λ³κ²½ GDRIVE_CREDS_DIR
λλ ν 리μ λ°°μΉ (μ:/Users/username/.config/gdrive-mcp-server
)- μ΄ νμΌμ μ΅μ΄ μΈμ¦ μμλ§ μ¬μ©λλ©°, λΈλΌμ°μ μΈμ¦ νλ¦μ μμν©λλ€
- λ€μ΄λ‘λν ν€ νμΌμ μ΄λ¦μ
-
νκ²½ λ³μ μ€μ :
gcp-oauth.keys.json
μμ client_idμ client_secret κ°μ νμΈ- μ΄ κ°λ€μ νκ²½ λ³μ
CLIENT_ID
,CLIENT_SECRET
μ μ€μ - ν ν° μλ κ°±μ μ νμν©λλ€
-
λ£¨νΈ ν΄λ ID μ°ΎκΈ°:
- 루νΈλ‘ μ¬μ©ν Google Drive ν΄λ μ΄κΈ°
- ν΄λ IDλ URLμ μμ΅λλ€:
https://drive.google.com/drive/folders/[FOLDER_ID]
MCP ν΄λΌμ΄μΈνΈ ꡬμ±
Claude Desktop
claude_desktop_config.json
μ μΆκ°:
{
"mcpServers": {
"gdrive": {
"command": "npx",
"args": ["@pghoya2956/gdrive-mcp-server"],
"env": {
"CLIENT_ID": "your-oauth-client-id",
"CLIENT_SECRET": "your-oauth-client-secret",
"GDRIVE_CREDS_DIR": "/path/to/credentials/directory",
"GDRIVE_ROOT_FOLDER_ID": "your-root-folder-id"
}
}
}
}
μΈμ¦ νλ¦
- μ΅μ΄ μ€ν: λΈλΌμ°μ κ° μ΄λ¦¬λ©° Google κ³μ μΈμ¦
- ν ν° μ μ₯:
.gdrive-server-credentials.json
μ μλ μ μ₯ - μλ κ°±μ : ν ν° λ§λ£ μ μλμΌλ‘ κ°±μ
μ¬μ© μμ
ꡬμ±μ΄ μλ£λλ©΄ μμ°μ΄λ₯Ό μ¬μ©νμ¬ Google Driveμ μνΈμμ©ν μ μμ΅λλ€:
- "νλ‘μ νΈ μ μμκ° ν¬ν¨λ λ¬Έμ κ²μ"
- "λΆκΈ°λ³ λ³΄κ³ μμ λ΄μ© μ½κΈ°"
- "μμ° μ€νλ λμνΈμ A1 μ μ 5000μΌλ‘ μ λ°μ΄νΈ"
- "λ΄ λλΌμ΄λΈμ λͺ¨λ μ€νλ λμνΈ λ³΄κΈ°"
보μ κ³ λ €μ¬ν
- μλ²λ μ§μ λ λ£¨νΈ ν΄λμ νμ ν΄λ λ΄μ νμΌμλ§ μ‘μΈμ€ν μ μμ΅λλ€
- Drive νμΌμ λν΄ μ½κΈ° μ μ© μ‘μΈμ€ μ¬μ© (μ λ°μ΄νΈλ₯Ό νμ©νλ Sheets μ μΈ)
- OAuth ν ν°μ μ격 μ¦λͺ λλ ν 리μ λ‘μ»¬λ‘ μ μ₯λ©λλ€
- μ격 μ¦λͺ μ΄λ ν ν°μ λ²μ κ΄λ¦¬μ 컀λ°νμ§ λ§μΈμ
λ¬Έμ ν΄κ²°
μΌλ°μ μΈ λ¬Έμ
-
"GDRIVE_ROOT_FOLDER_ID νκ²½ λ³μκ° νμν©λλ€"
- νκ²½μ΄λ ꡬμ±μμ
GDRIVE_ROOT_FOLDER_ID
λ₯Ό μ€μ νλμ§ νμΈνμΈμ
- νκ²½μ΄λ ꡬμ±μμ
-
"μ΄ μ νμ Google Apps νμΌμ μ½μ μ μμ΅λλ€"
- μΌλΆ Google Apps νμΌ(Forms, Sites λ±)μ λ΄λ³΄λΌ μ μμ΅λλ€
- Docs, Sheets, Slides, Drawingsλ§ μ§μλ©λλ€
-
μΈμ¦ μ€λ₯
.gdrive-server-credentials.json
μ μμ νκ³ λ€μ μΈμ¦νμΈμ- OAuth ν΄λΌμ΄μΈνΈκ° μ¬λ°λ₯΄κ² ꡬμ±λμλμ§ νμΈνμΈμ
-
"νμΌμ΄ νμ©λ ν΄λ λ²μλ₯Ό λ²μ΄λ¬μ΅λλ€"
- νμΌμ΄ ꡬμ±λ λ£¨νΈ ν΄λ λ΄μ μμ΅λλ€
- νμΌμ΄ μ¬λ°λ₯Έ ν΄λ κ³μΈ΅ ꡬ쑰μ μλμ§ νμΈνμΈμ
κ°λ°
μμ€μμ λΉλ
# μ μ₯μ 볡μ
git clone https://github.com/pghoya2956/gdrive-mcp-server.git
cd gdrive-mcp-server
# μ’
μμ± μ€μΉ
npm install
# TypeScript λΉλ
npm run build
# κ°λ° λͺ¨λλ‘ μ€ν
npm run watch
λΌμ΄μΌμ€
μ΄ νλ‘μ νΈλ μ΄ μ μ₯μμμ MIT λΌμ΄μΌμ€λ‘ λ°°ν¬λ Anthropic, PBCκ° μλ κ°λ°ν μ½λλ₯Ό ν¬ν¨ν©λλ€.
κΈ°μ¬
κΈ°μ¬λ₯Ό νμν©λλ€! Pull Requestλ₯Ό μμ λ‘κ² μ μΆν΄ μ£ΌμΈμ.