Metadata-Version: 2.3
Name: textbook-cover-mcp
Version: 0.1.1
Summary: An MCP Server for the Textbook Cover Editor
Author: Sankar
Author-email: Sankar <sankarvnk.ai@gmail.com>
Requires-Dist: fastmcp>=3.4.7
Requires-Dist: httpx>=0.28.1
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# Textbook Cover Editor MCP Server

A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server built with `FastMCP` that allows AI assistants (like Claude) to programmatically interact with a live Textbook Cover Editor canvas. 

This server acts as a bridge between your AI assistant and a local Node.js backend (`http://127.0.0.1:3000`), enabling the AI to retrieve canvas states, create new design elements, update existing ones, and delete them in real-time.

## Features

- **Read Canvas State**: Fetches the current live state of the document.
- **Add Elements**: Create rectangles, ellipses, triangles, stars, arrows, lines, rich text, and markdown-formatted tables.
- **Update Elements**: Modify coordinates, dimensions, colors, text content, and layer names dynamically.
- **Delete Elements**: Remove items from the canvas via their unique IDs.
- **Rich Text Support**: Automatically translates standard text into character-by-character rich text payload arrays.

## Prerequisites

- Python 3.8 or higher.
- A running Node.js backend server at `http://127.0.0.1:3000` with the `/api/document/...` endpoints configured.
- An AI client that supports the MCP standard (e.g., Claude Desktop).

## Installation

Install the package directly from PyPI:

```bash
pip install textbook-cover-mcp
```

```
{
  "mcpServers": {
    "textbook-cover-editor": {
      "command": "python",
      "args": ["-m", "textbook-cover-mcp"], 
      "env": {
        "TEXTBOOK_API_KEY": "your_api_key_here",
        "ACTIVE_PROJECT_ID": "your_project_id_here"
      }
    }
  }
}
```