Metadata-Version: 2.5
Name: cadence-mcp
Version: 0.1.0
Summary: Official Model Context Protocol (MCP) server for Cadence Meeting Intelligence
Author: Cadence AI Team
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: python-dotenv>=1.0.1
Description-Content-Type: text/markdown

# Cadence MCP Server (Model Context Protocol)

Official Model Context Protocol (MCP) server for the **Cadence Meeting & Speech Intelligence Platform**.

Connects autonomous AI coding agents (**Cursor**, **Claude Desktop**, **Claude Code**, **Windsurf**, **Copilot**) directly to your team's live meeting context, verbal directives, anti-patterns, and architectural decisions.

---

## ⚡ What Cadence MCP Does

1. **Organizational Decision Verification:**  
   Ask: *"Hey Claude, did we decide to go with MongoDB or Postgres in our architecture sync?"*  
   Claude invokes `search_cadence_knowledge` to retrieve the exact spoken decision and quotes.
2. **Post-Meeting Code Handoff:**  
   Ask: *"Implement the cache invalidation logic we just finished discussing."*  
   Claude invokes `get_latest_meeting` to extract verified verbal directives and implementation rules.
3. **Meeting Discovery:**  
   Query meetings by date or keyword (e.g. `list_meetings(query="sprint")`) to pull historical architectural constraints.
4. **Anti-Pattern Guardrails:**  
   Automatically loads explicit architectural rejections (e.g. *"Do not introduce MongoDB into the relational service"*) so AI agents don't write disallowed code.

---

## 🛠️ MCP Tools Exposed

| Tool Name | Arguments | Description |
| :--- | :--- | :--- |
| `search_cadence_knowledge` | `query: str`, `search_type: str = "all"`, `limit: int = 5` | Searches decisions, directives, and transcripts across all meetings the user attended. |
| `list_meetings` | `query: str = None`, `date: str = None`, `limit: int = 5` | Lists past meetings with optional title or date filters. |
| `get_latest_meeting` | *None* | Zero-argument shortcut fetching the compiled directives and constraints of the latest meeting. |
| `get_meeting_context` | `meeting_id: str`, `include_transcript: bool = False` | Retrieves the full technical specification for a specific meeting ID. |

---

## 🚀 Setup & IDE Configuration

### Step 1: Generate Your API Key
In your Cadence web app, navigate to **Profile → Developer / API Keys** and click **Generate API Key**. Copy your `cad_live_...` key.

---

### Method A: Option 1 — Remote Cloud SSE (Recommended, Zero Local Installation)
No local Python environment or packages required! Your IDE connects directly to the Cadence API Gateway over Server-Sent Events (SSE).

#### 1. Cursor IDE / Windsurf
Add to `.cursor/mcp.json` in your workspace root, or configure via **Cursor Settings → Features → MCP**:

```json
{
  "mcpServers": {
    "cadence": {
      "url": "http://localhost:8000/mcp/sse",
      "headers": {
        "Authorization": "Bearer cad_live_your_api_key_here"
      }
    }
  }
}
```
*(In production, replace `http://localhost:8000/mcp/sse` with your production URL, e.g. `https://api.yourcadenceapp.com/mcp/sse`)*

#### 2. Claude Desktop (SSE Support)
Add to your `claude_desktop_config.json`:
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "cadence": {
      "url": "http://localhost:8000/mcp/sse",
      "headers": {
        "Authorization": "Bearer cad_live_your_api_key_here"
      }
    }
  }
}
```

---

### Method B: Option 2 — Local stdio CLI Runner
If you prefer running the MCP server locally via standard I/O (e.g. for air-gapped environments or local package development):

#### 1. Cursor IDE (`.cursor/mcp.json`)
```json
{
  "mcpServers": {
    "cadence": {
      "command": "python",
      "args": ["-m", "cadence_mcp"],
      "env": {
        "CADENCE_API_KEY": "cad_live_your_api_key_here",
        "CADENCE_BASE_URL": "http://localhost:8000"
      }
    }
  }
}
```
Or with `uvx` (zero installation CLI runner):
```json
{
  "mcpServers": {
    "cadence": {
      "command": "uvx",
      "args": ["cadence-mcp"],
      "env": {
        "CADENCE_API_KEY": "cad_live_your_api_key_here",
        "CADENCE_BASE_URL": "http://localhost:8000"
      }
    }
  }
}
```

#### 2. Claude Code (CLI)
```bash
claude mcp add cadence -e CADENCE_API_KEY=cad_live_... -e CADENCE_BASE_URL=http://localhost:8000 -- python -m cadence_mcp
```

---

## 🔒 Security & Multi-Tenant Isolation
- **Transport Security:** Credentials (`CADENCE_API_KEY`) are handled strictly by the local MCP server over HTTP Authorization headers—the LLM never passes credentials in prompt context.
- **Tenant Isolation:** Every query in the Cadence backend is strictly constrained to meetings where `user_id == meeting_participant.user_id`. Calling another organization's `meeting_id` returns an immediate `403 Forbidden`.
