Decompose any text into classified semantic units — authority, risk, attention, entities. No LLM. Deterministic.
Add this skill
npx mdskills install echology-io/decompose-mcpWell-documented deterministic text classifier with clear tool descriptions and transparent security model
1---2name: decompose-mcp3description: Decompose any text into classified semantic units — authority, risk, attention, entities. No LLM. Deterministic.4metadata: {"clawdbot":{"emoji":"🧩","requires":{"anyBins":["python3","python"]},"install":[{"id":"pip","kind":"uv","pkg":"decompose-mcp","bins":["decompose"],"label":"Install decompose-mcp (pip/uv)"}]}}5---67# Decompose89Decompose any text or URL into classified semantic units. Each unit gets authority level, risk category, attention score, entity extraction, and irreducibility flags. No LLM required. Deterministic. Runs locally.1011## Setup1213### 1. Install1415```bash16pip install decompose-mcp17```1819### 2. Configure MCP Server2021Add to your OpenClaw MCP config:2223```json24{25 "mcpServers": {26 "decompose": {27 "command": "python3",28 "args": ["-m", "decompose", "--serve"]29 }30 }31}32```3334### 3. Verify3536```bash37python3 -m decompose --text "The contractor shall provide all materials per ASTM C150-20."38```3940## Available Tools4142### `decompose_text`4344Decompose any text into classified semantic units.4546**Parameters:**47- `text` (required) — The text to decompose48- `compact` (optional, default: false) — Omit zero-value fields for smaller output49- `chunk_size` (optional, default: 2000) — Max characters per unit5051**Example prompt:** "Decompose this spec and tell me which sections are mandatory"5253**Returns:** JSON with `units` array. Each unit contains:54- `authority` — mandatory, prohibitive, directive, permissive, conditional, informational55- `risk` — safety_critical, security, compliance, financial, contractual, advisory, informational56- `attention` — 0.0 to 10.0 priority score57- `actionable` — whether someone needs to act on this58- `irreducible` — whether content must be preserved verbatim59- `entities` — referenced standards and codes (ASTM, ASCE, IBC, OSHA, etc.)60- `dates` — extracted date references61- `financial` — extracted dollar amounts and percentages62- `heading_path` — document structure hierarchy6364### `decompose_url`6566Fetch a URL and decompose its content. Handles HTML, Markdown, and plain text.6768**Parameters:**69- `url` (required) — URL to fetch and decompose70- `compact` (optional, default: false) — Omit zero-value fields7172**Example prompt:** "Decompose https://spec.example.com/transport and show me the security requirements"7374## What It Detects7576- **Authority levels** — RFC 2119 keywords: "shall" = mandatory, "should" = directive, "may" = permissive77- **Risk categories** — safety-critical, security, compliance, financial, contractual78- **Attention scoring** — authority weight x risk multiplier, 0-10 scale79- **Standards references** — ASTM, ASCE, IBC, OSHA, ACI, AISC, AWS, ISO, EN80- **Financial values** — dollar amounts, percentages, retainage, liquidated damages81- **Dates** — deadlines, milestones, notice periods82- **Irreducibility** — legal mandates, threshold values, formulas that cannot be paraphrased8384## Use Cases8586- Pre-process documents before sending to your LLM — save 60-80% of context window87- Classify specs, contracts, policies, regulations by obligation level88- Extract standards references and compliance requirements89- Route high-attention content to specialized analysis chains90- Build structured training data from raw documents9192## Library: `filter_for_llm()`9394When using Decompose as a Python library (not MCP), `filter_for_llm()` pre-filters decompose output for LLM context windows:9596```python97from decompose import decompose_text, filter_for_llm9899result = decompose_text(document_text)100filtered = filter_for_llm(result, max_tokens=4000)101# filtered["text"] = high-value units only (mandatory, safety-critical, financial, compliance)102# filtered["meta"]["reduction_pct"] = typically 60-80% token reduction103```104105Keeps mandatory, prohibitive, directive, conditional authority + safety-critical, compliance, financial, contractual risk + requirement, constraint, data, definition types. Configurable via keyword arguments.106107## Performance108109- ~14ms average per document on Apple Silicon110- 1,000+ chars/ms throughput111- Zero API calls, zero cost, works offline112- Deterministic — same input always produces same output113114## Security & Trust115116**Text classification is fully local.** The `decompose_text` tool performs all processing in-process with no network I/O. No data leaves your machine.117118**URL fetching performs outbound HTTP requests.** The `decompose_url` tool fetches the target URL, which necessarily involves network I/O to the specified host. This is why the skill declares the `network` permission in `claw.json`. If you do not need URL fetching, you can use `decompose_text` exclusively with no network access required.119120**SSRF protection.** URL fetching blocks private/internal IP ranges before connecting: `0.0.0.0/8`, `10.0.0.0/8`, `100.64.0.0/10`, `127.0.0.0/8`, `169.254.0.0/16`, `172.16.0.0/12`, `192.168.0.0/16`, `::1/128`, `fc00::/7`, `fe80::/10`. The implementation resolves the hostname via DNS *before* connecting and checks all returned addresses against the blocklist. See [`src/decompose/mcp_server.py` lines 19-49](https://github.com/echology-io/decompose/blob/main/src/decompose/mcp_server.py#L19-L49).121122**No API keys or credentials required.** No external services are contacted except when using `decompose_url` to fetch user-specified URLs.123124**Source code is fully auditable.** The complete source is published at [github.com/echology-io/decompose](https://github.com/echology-io/decompose). The PyPI package is built from this repo via GitHub Actions ([`publish.yml`](https://github.com/echology-io/decompose/blob/main/.github/workflows/publish.yml)) using PyPI Trusted Publishers (OIDC), so the published artifact is traceable to a specific commit.125126## Resources127128- [Source Code (GitHub)](https://github.com/echology-io/decompose) — full source, auditable129- [PyPI](https://pypi.org/project/decompose-mcp/) — published via Trusted Publishers130- [Documentation](https://echology.io/decompose)131- [Blog: When Regex Beats an LLM](https://echology.io/blog/regex-beats-llm)132- [Blog: Why Your Agent Needs a Cognitive Primitive](https://echology.io/blog/cognitive-primitive)133
Full transparency — inspect the skill content before installing.