Metadata-Version: 2.4
Name: anaplan-mcp
Version: 0.0.1
Summary: MCP Server for Anaplan.
Author-email: Vinzenz Klass <vinzenz.klass@valantic.com>
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.14
Requires-Dist: anaplan-sdk[cert,oauth]>=0.5.16
Requires-Dist: fastmcp>=3.2.4
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.13.4
Description-Content-Type: text/markdown

# anaplan-mcp

MCP server wrapping the [Anaplan SDK](https://github.com/VinzenzKlass/anaplan-sdk).
Plug it into Claude Desktop, Cursor, or any MCP client and talk to Anaplan directly.

## Setup

Add to your MCP client config (`claude_desktop_config.json`, Cursor settings, …):

```json
{
  "mcpServers": {
    "anaplan": {
      "command": "uvx",
      "args": ["anaplan-mcp"],
      "env": {
        "ANAPLAN_WORKSPACE_ID": "...",
        "ANAPLAN_MODEL_ID": "...",
        "ANAPLAN_EMAIL": "me@example.com",
        "ANAPLAN_PASSWORD": "secret"
      }
    }
  }
}
```

Certificate auth is also supported — swap the last two vars for:

```
"ANAPLAN_CERTIFICATE": "/path/to/cert.pem",
"ANAPLAN_PRIVATE_KEY": "/path/to/key.pem"
```

## Python API

For OAuth or any custom auth, use the Python API and pass any `httpx.Auth` subclass:

```python
from anaplan_mcp import AnaplanMCP

# Basic / cert via env vars
AnaplanMCP.from_env().run()

# Explicit credentials
AnaplanMCP(workspace_id="...", user_email="...", password="...").run()
AnaplanMCP(workspace_id="...", certificate="...", private_key="...").run()

# Any httpx.Auth subclass (OAuth, token, …)
from anaplan_sdk._auth import AnaplanLocalOAuth
AnaplanMCP(workspace_id="...", auth=AnaplanLocalOAuth(...)).run()
```

### Running locally with non-standard auth

For auth that can't be expressed as env vars (e.g. OAuth), create a local script and point
your MCP client at it:

**`server.py`**:
```python
from anaplan_sdk._auth import AnaplanLocalOAuth   # or any httpx.Auth subclass
from anaplan_mcp import AnaplanMCP

AnaplanMCP(
    workspace_id="<your-workspace-id>",
    auth=AnaplanLocalOAuth(client_id="...", client_secret="...", redirect_uri="..."),
).run()
```

**MCP client config**:
```json
{
  "mcpServers": {
    "anaplan": {
      "command": "uv",
      "args": ["run", "/path/to/server.py"]
    }
  }
}
```

### Filtering tools

```python
AnaplanMCP(..., include={"tr", "audit"})                   # whitelist API groups
AnaplanMCP(..., exclude={"cw"})                            # blacklist API groups
AnaplanMCP(..., exclude_methods={"tr__delete_list_items"}) # suppress specific tools
```

| Group      | Covers                                  |
|------------|-----------------------------------------|
| *(root)*   | Bulk file I/O, imports, exports         |
| `audit`    | Audit log, users                        |
| `tr`       | Lists, modules, transactional writes    |
| `alm`      | Application Lifecycle Management        |
| `cw`       | CloudWorks integrations & connections   |
| `cw.flows` | CloudWorks flows                        |
| `scim`     | User provisioning (SCIM)                |
