Metadata-Version: 2.4
Name: stewreads-mcp
Version: 0.1.0
Summary: Local StewReads MCP server for EPUB conversion
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastmcp>=2.0.0
Requires-Dist: pypandoc-binary>=1.15
Requires-Dist: aiofiles>=24.1.0
Requires-Dist: tomli>=2.0.1; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"

# stewreads

Local-first StewReads MCP server for Claude Desktop on macOS.

## Current Scope
- Local stdio MCP server (no backend calls)
- EPUB generation from markdown
- Save generated ebooks to a configured local directory
- Reuse current StewReads ebook-generation prompt

## Not In Scope (Current Iteration)
- Email sending
- Gmail config
- PDF generation

## Requirements
- Python 3.10+
- uv

macOS install:
```bash
brew install uv
```

## Install (Recommended)
Install as a local tool:

```bash
uv tool install --force git+https://github.com/ankitvg/stewreads.git
```

This includes pandoc via `pypandoc-binary`, so no separate pandoc install is required.

## Install (Repo Development)
```bash
uv sync
```

## Configuration
Create `~/.config/stewreads/config.toml`:

```toml
[paths]
output_dir = "/Users/you/Projects/generated_books"
```

Optional environment overrides:
- `STEWREADS_CONFIG_PATH` (path to config file)
- `STEWREADS_OUTPUT_DIR` (overrides configured output dir)

## Run MCP Server (Tool Install)
```bash
stewreads-mcp
```

## Run MCP Server (Repo Development)
```bash
uv run stewreads-mcp
```

## Claude Desktop (Mac) Example
Add to Claude Desktop MCP config:

```json
{
  "mcpServers": {
    "stewreads": {
      "command": "/Users/you/.local/bin/stewreads-mcp",
      "env": {
        "STEWREADS_CONFIG_PATH": "/Users/you/.config/stewreads/config.toml"
      }
    }
  }
}
```

## Exposed MCP Tools
- `get_stew_prompt()`
- `get_stew_config()`
- `save_stew_config(output_dir)`
- `save_ebook(markdown, title, filename?, original_prompt?)`

## First-Time Claude Flow
1. Call `get_stew_config()`.
2. If `configured` is `false`, ask the user for their preferred output directory and call `save_stew_config(output_dir=...)`.
3. Call `save_ebook(...)` after config is set.

## Dev Shell Safety
When running multi-step shell commands, you may see `set -euo pipefail`:
- `-e`: stop on command failure.
- `-u`: fail on unset variables.
- `-o pipefail`: fail if any command in a pipeline fails.
