# entrapulse-polyarchy [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/darrenjrobinson/entrapulse-polyarchy  
**GitHub Stars:** 0  
**npm Downloads (last month):** 501  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/entrapulse-polyarchy

## Description
Interactive Entra ID identity relationship visualization — the 2003 polyarchy, live as an MCP App

## Tools
Capabilities this server exposes over MCP:

- **visualize-identity** — Open the interactive Identity Polyarchy — a live relationship graph over Microsoft Entra ID (org hierarchy, groups, shared attributes, roles and app assignments). Call when the user asks to visualize, explore or map identity relationships, or says "open the polyarchy" / "show me the polyarchy around <name>". With no arguments it opens focused on the signed-in user (delegated modes only — in app-only mode pass search or userId). If search matches several people the tool returns the candidates instead of opening — ask the user which one they mean and call again with that userId (or use polyarchy-search first for names you suspect are common). Once opened the UI is interactive; no further action is needed unless the user asks for something new.
- **polyarchy-expand** — Fetch one node's relationships from Microsoft Graph as a nodes/edges delta. Dimensions for a user node: org (manager chain + direct reports), groups (memberships), access (directory roles + app assignments), attributes (pivot hub for attr). For nodeType group/role, returns members. For nodeType attribute pass attr+value to load the whole cohort. The delta is returned to the caller only — it does not update an open polyarchy canvas (the UI fetches its own data when the user interacts with it).
- **polyarchy-search** — Search Entra ID users by name or UPN (top 15 matches with core attributes).
- **polyarchy-report** — Structured JSON report of one user's identity relationships — no UI needed, works headless. Dimensions: org (full manager chain to the root + direct reports), groups (direct memberships with group type — Security / Microsoft 365 / Distribution list / Mail-enabled security — and assigned vs dynamic membership), roles (directory roles), applications (app assignments), attributes (core profile values), or all (default). Use when the user wants analysis, a summary or the underlying data — after exploring the polyarchy visually, or instead of opening it. With no person argument it reports on the signed-in user (delegated modes only). Ambiguous names return candidates — re-call with userId.
- **get-photo** — Photo for a user (or, with kind "group", a Microsoft 365 group) as a data: URI (48x48), or null.
- **get-app-logo** — An application's logo (its service principal's info.logoUrl, else its gallery template's logo) as a data: URI, or null.
- **get-manager** — A user's manager (core attributes), or null at the top of the chain.
- **set-access-token** — Provide/refresh a Microsoft Graph bearer token when the server runs with USE_CLIENT_TOKEN=true (e.g. EntraPulse passing its own token for seamless SSO). expiresOn is ISO 8601; defaults to the token's exp claim or 1 hour.
- **get-auth-status** — Current auth mode, signed-in account, client app id, decoded token scopes/roles, and token expiry (expiresOn + tokenExpiresInMinutes; renewal is silent) — use to diagnose 401/403s and missing consent.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "entrapulse-polyarchy": {
    "command": "npx",
    "args": ["-y","entrapulse-polyarchy"]
  }
}
```

## Documentation

## What entrapulse-polyarchy does

entrapulse-polyarchy turns Microsoft Entra ID relationship data into an interactive polyarchy graph inside MCP App-compatible clients. The visualization can center on the signed-in user, a searched person, or a specified object ID. It combines several relationship dimensions in one graph:

- Organizational links, including manager chains and direct reports
- Group memberships and group-to-member expansion
- Directory roles and application assignments
- Attribute pivots that connect people sharing values such as department, office, city, or employee data

The graph supports node profiles, focus changes, relationship filtering, fullscreen or inline display, and session caching. A reset clears the visible canvas while retaining data fetched during the session.

## How it works

The server queries Microsoft Graph using delegated or application authentication, then exposes identity data through MCP tools. `visualize-identity` opens the graph around the current user, a search term, or an object ID. When a name matches multiple people, the tool returns candidates rather than selecting one without confirmation.

`polyarchy-search` finds people by name or UPN and returns identifying details such as UPN, title, department, and object ID. `polyarchy-expand` returns a nodes-and-edges delta for a selected node. Expansion can cover organizational relationships, groups, access, attributes, group or role members, and attribute cohorts; nested attribute paths are supported.

For workflows that do not need a visual interface, `polyarchy-report` produces structured JSON containing selected relationship dimensions or the complete report. The report can include a manager chain, direct reports, group memberships with group type and assigned-versus-dynamic status, directory roles, app assignments, and core attributes.

## Setup and configuration

For a typical MCP client, run the package through `npx`:

```json
{
  "mcpServers": {
    "entrapulse-polyarchy": {
      "command": "npx",
      "args": ["-y", "entrapulse-polyarchy"]
    }
  }
}
```

Interactive authentication is the default and starts when the first tool is called. Tokens are persisted in the operating system keychain, while the signed-in account is recorded under `~/.entrapulse-polyarchy/auth-record.json`. Authentication events are logged to `~/.entrapulse-polyarchy/auth.log`.

Use `USE_DEVICE_CODE=true` for headless or SSH environments. App-only access requires `TENANT_ID`, `CLIENT_ID`, and `CLIENT_SECRET`; this mode has no `/me` identity, so a person must be supplied to identity queries. `USE_CLIENT_TOKEN=true` enables client-provided Graph tokens through `set-access-token`, with `ACCESS_TOKEN` available as an optional value. `TENANT_ID` and `CLIENT_ID` can also select a tenant and custom app registration for interactive or device-code sign-in.

## Tools and capabilities

- `visualize-identity`: Open the relationship graph around the current user, a name, or an object ID.
- `polyarchy-search`: Find people by name or UPN.
- `polyarchy-expand`: Retrieve relationship deltas for a graph node.
- `polyarchy-report`: Return relationship data as structured JSON without opening the UI.
- `set-access-token`: Pass through a Microsoft Graph bearer token and support authentication diagnostics.

The main delegated permissions are `User.Read.All`, `Group.Read.All`, `RoleManagement.Read.Directory`, and `Application.Read.All`.

## Limitations and notes

A tenant may block or restrict the default Microsoft Graph Command Line Tools public client through consent policies, Conditional Access, or application management controls. In that situation, configure an app registration with the required Microsoft Graph delegated permissions. Custom interactive registrations need a portless `http://localhost` redirect, and device-code sign-in requires public client flows to be enabled.

The default focus is `/me` only when the authentication mode provides a signed-in user. App-only mode requires an explicit person. Access also depends on Graph scopes and tenant directory-read policies; some restricted or guest accounts may need Directory Readers access.

_Full upstream README: https://allmcps.com/mcp/entrapulse-polyarchy/readme_

