# Fireflies MCP Server

MCP Server for the Fireflies.ai API, enabling transcript retrieval, search, and summary generation.

### Features

- **Transcript Management**: Retrieve and search meeting transcripts with filtering options
- **Detailed Information**: Get comprehensive details about specific transcripts
- **Advanced Search**: Find transcripts containing specific keywords or phrases
- **Summary Generation**: Generate concise summaries of meeting transcripts in different formats
- **Multiple Transport Modes**: Support for STDIO, HTTP, and SSE transport protocols
- **Multi-User Session Support**: HTTP and SSE modes support multiple users with isolated sessions
- **Bearer Token Authentication**: Per-session API key authentication via Authorization headers
- **Session Isolation**: Complete isolation between user sessions for security and reliability


## Tools

1. `fireflies_get_transcripts`
   - Retrieve a list of meeting transcripts with optional filtering
   - Inputs:
     - `limit` (optional number): Maximum number of transcripts to return
     - `from_date` (optional string): Start date in ISO format (YYYY-MM-DD)
     - `to_date` (optional string): End date in ISO format (YYYY-MM-DD)
   - Returns: Array of transcript objects with basic information

2. `fireflies_get_transcript_details`
   - Get detailed information about a specific transcript
   - Inputs:
     - `transcript_id` (string): ID of the transcript to retrieve
   - Returns: Comprehensive transcript details including speakers, content, and metadata

3. `fireflies_search_transcripts`
   - Search for transcripts containing specific keywords
   - Inputs:
     - `query` (string): Search query to find relevant transcripts
     - `limit` (optional number): Maximum number of transcripts to return
   - Returns: Array of matching transcript objects

4. `fireflies_generate_summary`
   - Generate a summary of a meeting transcript
   - Inputs:
     - `transcript_id` (string): ID of the transcript to summarize
     - `format` (optional string): Format of the summary ('bullet_points' or 'paragraph')
   - Returns: Generated summary text

## Setup

### Fireflies API Key
[Create a Fireflies API Key](https://fireflies.ai/dashboard/settings/api) with appropriate permissions:
   - Go to the Fireflies.ai dashboard
   - Navigate to Settings > API
   - Generate a new API key
   - Copy the generated key

### Usage with Claude Desktop
To use this with Claude Desktop, add the following to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "fireflies": {
      "command": "npx",
      "args": [
        "-y",
        "@gongrzhe/server-fireflies-mcp"
      ],
      "env": {
        "FIREFLIES_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

## Installation

### Option 1: Using npx (Recommended)

Run directly without installation:

```bash
# STDIO mode (default)
npx @gongrzhe/server-fireflies-mcp

# HTTP transport mode  
npx @gongrzhe/server-fireflies-mcp --http

# SSE transport mode
npx @gongrzhe/server-fireflies-mcp --sse

# Multi-user session-aware HTTP mode
npx @gongrzhe/server-fireflies-mcp --http --port 3000
```

### Option 2: Global Installation

Install the package globally:

```bash
npm install -g @gongrzhe/server-fireflies-mcp

# Then run with:
fireflies-mcp --http
```

### Option 3: Development Installation

1. Clone this repository
2. Install dependencies:

```bash
npm install
# or
pnpm install
```

3. Build the project:

```bash
npm run build
# or
pnpm build
```

## Usage

### Transport Modes

The server supports three transport modes:

#### 1. STDIO Transport (Single-User)
For use with Claude Desktop and other MCP clients. Requires a global API key:

```bash
FIREFLIES_API_KEY=your_api_key npm start
```

**Note**: STDIO mode is single-user and requires a global API key for backwards compatibility.

#### 2. HTTP Transport (Multi-User Session-Aware) ⭐ **Recommended**
For HTTP-based clients with per-session Bearer token authentication:

```bash
npm run start:http
```

**No global API key needed!** Each user provides their own Fireflies API key per session.

The server will start on `http://localhost:3000/mcp` with the following endpoints:
- `POST /mcp` - Main MCP endpoint
- `GET /health` - Health check
- `GET /` - API documentation

**Key Features:**
- ✨ **Multi-user support**: Multiple users can connect simultaneously
- 🔒 **Session isolation**: Each user session is completely isolated
- 🔐 **Per-session authentication**: Each user provides their own API key
- ⚡ **No global setup**: No need to configure a global API key

**Authentication:** Use `Authorization: Bearer <your-fireflies-api-key>` header

#### 3. SSE Transport (Multi-User Server-Sent Events)
For SSE-based clients:

```bash
npm run start:sse
```

**Same multi-user benefits as HTTP mode** with SSE protocol support.

The server will start on:
- `GET /sse` - SSE connection endpoint
- `POST /messages` - Message handling endpoint
- `GET /health` - Health check
- `GET /` - API documentation

### Multi-User Session Example

```bash
# Start the server (no global API key needed!)
npm run start:http

# Check server health and session stats
curl http://localhost:3000/health

# User 1 connects with their API key
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer user1-fireflies-api-key" \
  -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1, "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "user1", "version": "1.0.0"}}}'

# User 2 connects with their own API key (completely isolated)
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer user2-fireflies-api-key" \
  -d '{"jsonrpc": "2.0", "method": "initialize", "id": 1, "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "user2", "version": "1.0.0"}}}'

# Check active sessions
curl http://localhost:3000/sessions
```

### Setup Script

You can also use the setup script:

```bash
./setup.sh
FIREFLIES_API_KEY=your_api_key npm start
```

## License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 