melty
README.md
# melty
MCP server with FTS5 full-text search over a SQLite export of a discord server.
The canonical repo is hosted on Tangled at [`dunkirk.sh/melty`](https://tangled.org/dunkirk.sh/melty).
## Setup
```bash
bun install
cp .env.example .env
# Edit .env with your Discord token and guild ID
```
### Export Discord data
```bash
bun run export # Exports messages to discord-export/melty.db (resumable)
```
After export completes, build the thread index:
```bash
bun run src/build-threads.ts
```
### Run the MCP server
```bash
bun run mcp
```
Or configure it in your MCP client:
```json
{
"mcp": {
"melty-discord": {
"command": "bun",
"args": ["run", "./src/mcp-server.ts"],
"type": "stdio"
}
}
}
```
## MCP Tools
| Tool | Description |
|------|-------------|
| `search` | Full-text search across conversation threads (FTS5 with BM25 ranking). Start here. |
| `get_thread` | Read full text of a thread by ID. Use after `search`. |
| `channel_search` | Same as `search` but scoped to a specific channel. |
| `get_messages` | Paginated raw message access within a channel, newest-first. |
| `list_channels` | All channels with message counts, grouped by category. |
| `stats` | Database statistics: total messages, threads, authors, date range. |
| `query` | Raw read-only SQL against the database. Escape hatch. |
### Search syntax
Supports FTS5 query syntax:
- `word` — matches any thread containing "word"
- `"exact phrase"` — exact phrase match
- `search*` — prefix match
- `apple AND banana` — both terms required
- `apple OR banana` — either term
- `apple NOT banana` — exclude term
Optional filters: `after`/`before` (ISO-8601 timestamps), `author` (name substring).
<p align="center">
<img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/main/.github/images/line-break.svg" />
</p>
<p align="center">
<i><code>© 2026-present <a href="https://dunkirk.sh">Kieran Klukas</a></code></i>
</p>
<p align="center">
<a href="https://tangled.org/dunkirk.sh/melty/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a>
</p>
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues