Skip to main content
Glama
MCPBird

MCPBird

by gdkrmr
README.md
# MCPBird

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Thunderbird](https://img.shields.io/badge/Thunderbird-121%2B-0a84ff.svg)](https://www.thunderbird.net/)
[![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io/)


MCPBird is a **Thunderbird extension** that allows MCP clients to access and control your emails via the MCP protocol.

## How it works:


## Table of Contents

TODO

## Features

TODO

## Installation

- Install the extension in Thunderbird
- Configure your MCP client
```json
{
  "MCPServers": {
    "MCPBird": {
      "command": "node",
      "args": ["/path/to/mcpbridge.mjs"]
    }
  }
}
```

## Architecture

```mermaid
flowchart LR
    Thunderbird --> MCPBird_Extension
    MCPBird_Extension --> WebSocket
    WebSocket --> mcpbridge.mjs
    mcpbridge.mjs --> LLM_Client
```

### Security

#### Data
- If you do not use a local LLM, you are sending potentially sensitive information of yourself and others to a third party. The other person may not have consented to this.

#### Communication
This software assumes a secure local environment! It should only listen or connect to anything else than `127.0.0.1`, except explicitly requested by the user, see [Architecture](#Architecture).
- There is no authentication for the MCP server.
- There is no SSL encryption, local programs can sniff the traffic.
- The bridge accepts connections on `127.0.0.1` and the Thunderbird plugin connects to a port on `127.0.0.1`, so any local program can access the server and interfere.

#### LLMs 
- Selecting tools is responsibility of the user and should be done in the MCP client.
- Enable only the tools required for a task.
- Some of the tools have write access to your emails or can send emails, enable these on your own risk. Your email may get moved, deleted, classified as spam, the LLM may accidentally reply to someone, etc...

## Development

### Project Structure

```
TODO
```

### Development installation

TODO

### Building the Native Host

```sh
npm run build   # (optional) compile/transpile source
npm start       # runs bridge.mjs directly for debugging
```

### Testing

Load the thunderbird plugin and run `npm test`

### Quirks

- Because we are using a fixed port for the websocket, we cannot spin up more than one bridge process at a time.
    - if used with e.g. mcp inspector(`npx @modelcontextprotocol/inspector node mcpbridge.mjs`), you will have to kill the entire inspector process, just clicking restart or connect for a second time will not work because the bridge is still running in the background on the same port. The same issue probably also applies when using other mcp clients.
- A possible alternative to implement the same functionality would be through native messaging, but this requires an executable that cannot be distributed with the extension and has to be registered and installed in a very specific manner. See `browser.runtime.connectNative()`
- We cannot access the calendar because it is an internal Thunderbird API.
    
### Similar software

- [Thunderbird MCP](https://github.com/TKasperczyk/thunderbird-mcp) Provides a working MCP server for Thunderbird.
  - Uses internal Thunderbird APIs and, therefore access to more Thunderbird functionality.
  - Spins up an HTTP server inside of Thunderbird.
  - Uses a bridge process to connect stdin of the MCP client with the HTTP server.
- [thunderbird-mcp](https://github.com/bb1/thunderbird-mcp). As far as I know the first attempt to create an MCP server for Thunderbird.



### TODOs

- [ ] No idea what the minimum version of Thunderbird is, I have set it to 121, because this is what the query tool requires for some arguments.
- [ ] Package
  - [ ] Package Thunderbird addon
  - [ ] Package bridge
- [ ] Add more tools
- [ ] Use a proper email as ID
- [ ] ...

## License

This project is licensed under the MIT License – see the [`LICENSE`](./LICENSE) file for details.