Metadata-Version: 2.5
Name: clue2app-mcp
Version: 0.1.1
Summary: MCP Server for Clue2App - Deploy apps from AI coding assistants
Project-URL: Homepage, https://github.com/clue2solve/clue2app-mcp
Project-URL: Documentation, https://clue2app.ai/docs/cli-quickstart
Project-URL: Repository, https://github.com/clue2solve/clue2app-mcp
Author-email: Clue2Solve <support@clue2solve.io>
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: mcp<2.0.0,>=1.28.1
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Clue2App MCP Server

MCP (Model Context Protocol) server for Clue2App, enabling AI coding assistants like Claude Code to deploy applications directly.

## Features

- **Seamless Deployment**: Deploy apps from within your AI assistant conversation
- **Project Management**: Create and switch between projects
- **App Lifecycle**: Create, rebuild, delete applications
- **Monitoring**: Check build status, view logs, get runtime info
- **Custom Domains**: Register domains, assign apex (`@`) and subdomains, manage TLS — all via CLI proxy

## Installation

```bash
pip install clue2app-mcp
```

## Configuration

### Claude Code

Add to your `~/.claude/claude_code_config.json`:

```json
{
  "mcpServers": {
    "clue2app": {
      "command": "clue2app-mcp",
      "args": []
    }
  }
}
```

### Claude Desktop

Add to your Claude Desktop config:

```json
{
  "mcpServers": {
    "clue2app": {
      "command": "python",
      "args": ["-m", "clue2app_mcp.server"]
    }
  }
}
```

## Prerequisites

1. Install and authenticate with Clue2App CLI:
   ```bash
   pip install clue2app-cli
   c2a login
   ```

2. Set up a project context:
   ```bash
   c2a project create MyProject            # namespace is auto-generated
   c2a project use MyProject
   ```

## Available Tools

### Auth & Projects
| Tool | Description |
|------|-------------|
| `c2a_auth_status` / `c2a_status` | Check authentication and active project |
| `c2a_login` | Open browser login |
| `c2a_list_projects` | List all projects |
| `c2a_use_project` | Switch active project |
| `c2a_create_project` | Create a new project |
| `c2a_show_project` | Show project details |

### Apps
| Tool | Description |
|------|-------------|
| `c2a_list_apps` | List apps in current project |
| `c2a_get_app` | Get app details (URL, status, image) |
| `c2a_create_app` | Deploy a new app from a Git repo |
| `c2a_rebuild_app` | Trigger a build |
| `c2a_restart_app` | Restart the app (new revision) |
| `c2a_delete_app` | Delete an app |
| `c2a_app_logs` | Runtime logs |
| `c2a_build_logs` | Build logs |
| `c2a_build_list` | List builds |
| `c2a_set_env` / `c2a_list_env` | Environment variables |
| `c2a_deploy_current` / `c2a_check_repo` | Deploy from current directory |
| `c2a_analyze` | Analyze a repo for deployment readiness |

### Custom Domains
| Tool | Description |
|------|-------------|
| `c2a_domains_register` | Register a domain zone (`DELEGATION` / `SUBDOMAIN_DELEGATION` / `CNAME_ONLY`) |
| `c2a_domains_verify` | Check NS delegation health (live DNS lookup) |
| `c2a_domains_status` | Check delegation status via API |
| `c2a_domains_info` | Show NS records and setup instructions |
| `c2a_domains_list` | List registered domains in the project |
| `c2a_domains_assign` | Assign a single subdomain or apex (`@`) to an app |
| `c2a_domains_add` | Add one or more FQDNs to an app (auto-registers base if needed) |
| `c2a_domains_assignments` | List FQDN→app mappings in the project |
| `c2a_domains_remove` | Remove a domain assignment from an app |
| `c2a_domains_delete` | Delete a registered domain (and its assignments) |

### Secrets
| Tool | Description |
|------|-------------|
| `c2a_secrets_list` / `c2a_secrets_create` / `c2a_secrets_delete` | Manage Git/registry credentials for private repos |

### Daari LLM Gateway
| Tool | Description |
|------|-------------|
| `c2a_daari_llm_list_instances` | List Daari LLM Gateway instances in the active project |
| `c2a_daari_llm_create_instance` | Create a per-project LLM Gateway instance (mints JWT + writes `OPENAI_API_KEY`/`OPENAI_BASE_URL` binding secret) |
| `c2a_daari_llm_bind_app` | Attach a Gateway binding secret to an app via `envFrom` (emits kubectl patch for operator review) |

## Example Usage

In Claude Code or Claude Desktop:

> "Create a new project called 'demo' with namespace 'demo'"

> "Deploy my FastAPI app from https://github.com/user/fastapi-app"

> "Check the status of my-app"

> "Show me the logs for my-app"

> "Rebuild my-app"

> "Register example.com with DELEGATION method"

> "Point example.com (apex) and www.example.com at my-app"

> "Show me the NS records I need to add at my registrar"

## Development

```bash
# Clone the repo
git clone https://github.com/clue2solve/clue2app-mcp.git
cd clue2app-mcp

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest
```

## Releasing

Releases are cut by pushing a `v<version>` tag that matches the version in
`pyproject.toml`. The `.github/workflows/release.yml` workflow then:

1. Builds a wheel + sdist with `python -m build`.
2. Verifies the tag matches the `pyproject.toml` `[project].version`; fails
   the run if they diverge.
3. Publishes both artifacts to PyPI as `clue2app-mcp` — **only if** the
   `PYPI_API_TOKEN` repo secret is set. Without the token the publish step
   is skipped with a clear warning and the build artifacts are still
   uploaded to the run so the release itself is not blocked.
4. Creates a GitHub Release for the tag with the wheel and sdist attached.

Typical cut:

```bash
# 1. Bump the version in pyproject.toml (e.g. 0.1.0 -> 0.1.1) and commit.
git commit -am "chore(release): v0.1.1"

# 2. Tag and push.
git tag v0.1.1
git push origin main --tags
```

The tag push triggers the workflow; watch it under Actions → Release.

**One-time setup** (still pending — see SCK-441 follow-ups):

- Claim the `clue2app-mcp` name on PyPI (requires a human PyPI account).
- Add a `PYPI_API_TOKEN` repo secret scoped to that project under
  Settings → Secrets and variables → Actions.

Until both are done the workflow will build and attach artifacts but skip
the PyPI upload with a warning.

## License

MIT
