Metadata-Version: 2.4
Name: arythmatic-connect-mcp
Version: 0.1.0
Summary: MCP server for Arythmatic Connect — let your AI agent post, comment, read channels, file support tickets, and chat from inside Claude / Cursor / any MCP-compatible client.
Author-email: Arythmatic <engineering@arythmatic.cloud>
License: MIT
Project-URL: Homepage, https://connect.arythmatic.cloud
Project-URL: Documentation, https://github.com/askmeidentitycorp/Arythmatic-community-backend/tree/develop/mcp
Project-URL: Source, https://github.com/askmeidentitycorp/Arythmatic-community-backend
Keywords: mcp,claude,arythmatic,connect,agents
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
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"

# Arythmatic Connect — MCP Server

A [Model Context Protocol](https://modelcontextprotocol.io/) server that lets your AI agent (Claude Desktop, Cursor, Continue, or any MCP-compatible host) post, comment, read channels, file support tickets, and chat inside an Arythmatic Connect workspace.

## Install

```bash
pip install arythmatic-connect-mcp
```

or run from source:

```bash
cd mcp/
pip install -e .
```

## Configure

The server authenticates as the **tenant API key** owner — every action the agent takes is performed as if that user did it (so the access scopes match what they normally have in the community UI). Mint a key at `https://<your-tenant>.connect.arythmatic.cloud/admin/api-keys` and copy the `arc_live_<prefix>_<secret>` value.

Set two env vars:

```bash
export ARYTHMATIC_API_BASE_URL="https://api.connect.arythmatic.cloud/api/v1"
export ARYTHMATIC_API_KEY="arc_live_xxxxxxxx_yyyyyyyyyyyy"
```

## Claude Desktop wiring

In `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "arythmatic": {
      "command": "arythmatic-connect-mcp",
      "env": {
        "ARYTHMATIC_API_BASE_URL": "https://api.connect.arythmatic.cloud/api/v1",
        "ARYTHMATIC_API_KEY": "arc_live_xxxxxxxx_yyyyyyyyyyyy"
      }
    }
  }
}
```

Restart Claude Desktop. The Connect tools appear in the tools picker.

## Cursor / Continue wiring

Cursor and Continue follow the same `mcpServers` config block — refer to their docs for the file location.

## Tools

### Discovery
| Tool | Description |
|---|---|
| `get_current_user` | Who the agent is acting as + their permission scopes. |
| `list_workspaces` | Workspaces the caller is a member of. |
| `list_channels` | Channels inside a workspace. |
| `search_content` | Cross-tenant search across posts, articles, channel messages. |

### Channel chat
| Tool | Description |
|---|---|
| `list_channel_messages` | Recent messages in a channel (paginated). |
| `post_channel_message` | Send a message to a channel. |

### Feed posts
| Tool | Description |
|---|---|
| `list_feed_posts` | Recent feed posts in a workspace. |
| `create_feed_post` | Create a new feed post. |
| `comment_on_post` | Comment on a feed post. |

### Direct messages
| Tool | Description |
|---|---|
| `list_conversations` | DM and group chat conversations the caller is part of. |
| `list_conversation_messages` | Messages in a single conversation. |
| `send_conversation_message` | Reply in a DM or group chat. |

### Long-form content
| Tool | Description |
|---|---|
| `create_article` | Publish a new article in a workspace. |
| `create_question` | Open a new Q&A question. |

### Support tickets
| Tool | Description |
|---|---|
| `list_my_tickets` | Tickets the caller has filed. |
| `create_ticket` | File a new support ticket. |
| `comment_on_ticket` | Reply on a ticket thread. |

### Admin / moderator
These require the caller's API key to be minted by an admin/moderator (the relevant scope is checked server-side, same as the web UI).

| Tool | Description |
|---|---|
| `list_all_tickets` | Tenant-wide ticket queue. Requires `tickets:manage`. |
| `update_ticket` | Change a ticket's status / assignee. Requires `tickets:manage`. |
| `list_workspace_members` | Members of a workspace. Requires `members:view`. |

## Security model

- **Authentication:** the tenant API key acts as the caller. There's no per-tool gating in the MCP server itself — the Django API enforces scopes on every request, returning 403 when the calling key lacks the right scope. If your agent shouldn't be able to do something, mint a key with narrower scopes via the admin API-keys UI.
- **Audit:** every API call lands in `integrations.APIKeyUsageLog` (90-day retention) just like any other key-driven call, so you can audit the agent's behaviour after the fact.

## Publishing

Build + upload:

```bash
cd mcp/
pip install build twine
python -m build
python -m twine upload dist/*
```

## Local development

```bash
cd mcp/
pip install -e ".[dev]"
pytest
```

Run the server manually to sanity-check tool registration:

```bash
ARYTHMATIC_API_BASE_URL=http://localhost:8000/api/v1 \
ARYTHMATIC_API_KEY=arc_test_xxxx \
python -m arythmatic_connect_mcp
```

(Stdio-mode — you can pipe MCP JSON-RPC at it manually if you want, but typically you wire it into an MCP client.)
