Metadata-Version: 2.4
Name: spamescudo-mcp
Version: 1.0.0
Summary: SPAM Escudo Model Context Protocol (MCP) Server for AI coding assistants
Author-email: SPAM Escudo <support@spamescudo.com>
License-Expression: MIT
Project-URL: Homepage, https://spamescudo.com
Project-URL: Documentation, https://spamescudo.com/mcp
Project-URL: Repository, https://github.com/spamescudo/spamescudo-mcp
Keywords: mcp,model-context-protocol,spam-escudo,honeypot,ai-agents,cursor,claude-desktop,antigravity,form-security
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: boto3>=1.28.0
Requires-Dist: cryptography>=41.0.0

# SPAM Escudo Model Context Protocol (MCP) Server

[![PyPI version](https://img.shields.io/pypi/v/spamescudo-mcp.svg)](https://pypi.org/project/spamescudo-mcp/)
[![Python versions](https://img.shields.io/pypi/pyversions/spamescudo-mcp.svg)](https://pypi.org/project/spamescudo-mcp/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Official Model Context Protocol (MCP) server for **SPAM Escudo**. Enables AI coding assistants (Cursor, Claude Desktop, Antigravity, Copilot) to inspect contact forms, generate strict validation schemas, provision scoped subkeys, inject signed timing honeypot tokens, and run end-to-end synthetic pipeline verifications.

---

## Zero-Install Execution (Recommended)

Modern MCP clients can execute the server on-demand without manual cloning, virtual environment management, or `PYTHONPATH` manipulation using `uvx`:

```bash
uvx spamescudo-mcp
```

### Global Installation via Pip

Alternatively, install globally via `pip`:

```bash
# macOS / Linux
pip3 install spamescudo-mcp

# Windows
pip install spamescudo-mcp
```

---

## AI Assistant Configuration

### 1. Cursor (`.cursor/mcp.json`)

Add to your project root or user configuration:

```json
{
  "mcpServers": {
    "spam-escudo": {
      "command": "uvx",
      "args": ["spamescudo-mcp"]
    }
  }
}
```

*Or if installed via pip:*
```json
{
  "mcpServers": {
    "spam-escudo": {
      "command": "spamescudo-mcp"
    }
  }
}
```

### 2. Claude Desktop (`claude_desktop_config.json`)

- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "spam-escudo": {
      "command": "uvx",
      "args": ["spamescudo-mcp"]
    }
  }
}
```

### 3. Antigravity (`.agents/mcp_config.json`)

```json
{
  "mcpServers": {
    "spam-escudo": {
      "command": "uvx",
      "args": ["spamescudo-mcp"]
    }
  }
}
```

---

## Terminal CLI Management

The MCP package includes CLI commands for local authentication and status checks:

```bash
# 1. Authenticate securely via loopback browser flow (no passwords exposed to AI)
spamescudo-mcp login
# Or with uvx:
uvx spamescudo-mcp login

# 2. Check authentication status, tenant ID, and expiration
spamescudo-mcp status
# Or with uvx:
uvx spamescudo-mcp status

# 3. Log out and clear cached tokens (~/.spamescudo/session.json)
spamescudo-mcp logout

# 4. Run the stdio MCP server directly
spamescudo-mcp serve
```

---

## Out-of-Band Loopback Browser Authentication

Administrative operations (creating schemas, provisioning subkeys) require authenticated account permissions:
1. When your AI assistant invokes `spamescudo_login()`, the local MCP server spawns a local HTTP server on `127.0.0.1` and opens your default browser.
2. You authenticate directly in your browser with SPAM Escudo.
3. Your credentials **never touch the LLM prompt or chat history**.
4. Sessions are securely saved to `~/.spamescudo/session.json` (`0600` permissions) and refreshed in the background automatically.

---

## Exposed MCP Tools

| Tool | Scope | Description |
|---|---|---|
| `spamescudo_login` | Public / Auth | Opens browser on `127.0.0.1` for out-of-band user authentication. |
| `spamescudo_get_auth_status` | Read-only | Returns active user status, account ID, tier, and session expiration. |
| `spamescudo_create_schema` | Control-plane | Registers strict field validation schemas for $0 drop at the gateway. |
| `spamescudo_list_schemas` | Control-plane | Lists all schemas registered by the tenant. |
| `spamescudo_generate_subkey` | Control-plane | Generates public `se_sub_v1_...` subkeys bound to a schema ID. |
| `spamescudo_list_subkeys` | Control-plane | Lists tenant subkeys. |
| `spamescudo_get_honeypot_snippet` | Boilerplate | Generates React, FastAPI, Express, or HTML boilerplate with `_t`, `_h` and dummy traps. |
| `spamescudo_verify_pipeline` | Diagnostic | Sends synthetic valid and invalid submissions to verify pipeline enforcement. |
| `spamescudo_logout` | Local state | Clears cached session credentials. |

---

## License

MIT © SPAM Escudo.
