# spreadsheet_local_mcp_server
## 基本信息
- Slug: `masahirookamura-mac-spreadsheet_local_mcp_server`
- Source: modelscope
- Publisher: @MasahiroOkamura-MAC/spreadsheet_local_mcp_server
- Categories: cloud-platforms / workplace-and-productivity / app-automation
- Hosted: No
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/@MasahiroOkamura-MAC/spreadsheet_local_mcp_server
## 简介
暂无描述。
## 安装提示

```bash
git clone <repository-url> cd spreadsheet_local_mcp_server
```

## MCP Server 详情

# Spreadsheet Local MCP Server

Google Spreadsheet / Google Drive 取得 Local MCP (Model Context Protocol) 
Stdio 使用通信Claude Desktop  MCP 直接利用

## 機能

- **取得**: Google Spreadsheet  Google Drive 上 Excel 読込
  - Google Sheets API  Drive API 併用Excel 

## 前提条件

- Node.js (v18以上推奨)
- Google Cloud Platform 
  - Google Sheets API 有効化
  - Google Drive API 有効化
  - OAuth 2.0  ID 作成

## 

1. ****
   ```bash
   git clone <repository-url>
   cd spreadsheet_local_mcp_server
   ```

2. **依存関係**
   ```bash
   npm install
   ```

3. **環境変数設定**
   `.env.example`  `.env` 作成必要値設定
   ```bash
   cp .env.example .env
   ```
   
   `.env` 編集:
   ```env
   PORT=8080
   GOOGLE_REDIRECT_URI=http://localhost:8080/auth/callback
   ```
   
   > **注意**: Google Cloud Console  OAuth 同意画面設定自分追加 URI (`http://localhost:8080/auth/callback`) 許可済 URI 追加

4. ****
   ```bash
   npm run build
   ```

## MCP 設定 (Claude Desktop)

Claude Desktop 使用`claude_desktop_config.json` (通常 `~/Library/Application Support/Claude/claude_desktop_config.json` ) 以下追加

```json
{
  "mcpServers": {
    "spreadsheet-local": {
      "command": "node",
      "args": ["/absolute/path/to/spreadsheet_local_mcp_server/dist/index.js"],
      "env": {
        "GOOGLE_REDIRECT_URI": "http://localhost:8080/auth/callback"
      }
    }
  }
}
```

 `/absolute/path/to/...` 部分実際絶対置換

## 認証

初回利用時期限切時認証必要
MCP 起動認証必要場合自動的 (`http://localhost:8080`) 立上開
Google 権限許可認証完了MCP 機能利用可能

## 利用可能

### `get_data`
Google Spreadsheet  Google Drive 上取得

- **引数**:
  - `url` (string, 必須): Google Spreadsheet  URL  Google Drive  URL
  - `sheetName` (string, ): 名省略時最初使用

## 構成

- `src/index.ts`: 認証起動制御 MCP 初期化行
- `src/mcp.ts`: MCP 設定 (Stdio) 定義 (`get_data`)
- `src/auth.ts`: Google OAuth 認証
- `src/sheets.ts`: Google Sheets API 操作
- `src/drive.ts`: Google Drive API 操作

