# Decompose

Splits text into semantic units tagged by authority, risk and attention. Useful when an agent has to read a spec or contract before reasoning over it.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: echology-io
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/echology-io/decompose
- Updated: 2026-05-24
- HTML: https://affpapa.org/en/nevibecode/mcp/decompose

## What it does

Decompose is an MCP server that breaks text into individual units and labels each one: authority (mandatory, prohibitive, directive), risk (safety_critical, compliance, financial), type, an irreducible flag and an attention score from 0.0 to 10.0. Formal references such as standards and codes land in entities. The whole thing runs on regex and heuristics, so no model call happens.

Two tools come with it: `decompose_text` handles text you pass in, `decompose_url` fetches a page and processes its content. There is also a CLI (`decompose --pretty`, `--compact`) and a Python library exposing `decompose_text` and `filter_for_llm`. That last function drops boilerplate and keeps mandatory, safety-critical and financial units, which matters if you trim context before sending it to a model.

No API key, no GPU. The server works offline and returns the same output for the same input every time. Classification patterns were built for construction documents — specs, contracts, RFIs, inspection reports, pay applications — so expect noise on prose or source code.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add decompose -- uvx decompose-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from decompose-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add decompose -- uvx decompose-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from decompose-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "decompose": {
            "command": "uvx",
            "args": [
                "decompose-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from decompose-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "decompose": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "decompose-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from decompose-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add decompose uvx decompose-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from decompose-mcp <command>

## When to use it
- split a spec into individual requirements
- drop boilerplate before sending text to an LLM
- sort contract clauses by risk level
- pull out cited standards and codes
- count how many units actually need analysis

## Example prompts
- Decompose `spec.txt` and show only the units with safety_critical risk
- Run `decompose_url` on this link and list the mandatory requirements
- Filter the document with `filter_for_llm` and tell me the token reduction

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
