Skip to main content

ContentRX Language Server — inline content-design diagnostics in any LSP-capable editor.

Project description

contentrx-lsp

Inline content-design diagnostics in any LSP-capable editor — VS Code, Cursor, Zed, Neovim, JetBrains IDEs.

ContentRX's Language Server reads JSX/TSX source, pulls out UI copy (JSX text content and stringy JSX attributes), and surfaces violations of the ContentRX content model directly in the editor's problems panel as you type.

Install

uvx contentrx-lsp       # one-shot, no persistent install
pipx install contentrx-lsp
pip install contentrx-lsp

Most editors don't need you to install this by hand — use the ContentRX VS Code / Cursor extension and it will launch the server on first activation.

Configure

Set CONTENTRX_API_KEY in the environment the editor runs with. Generate a key at contentrx.io/dashboard.

export CONTENTRX_API_KEY=cx_...

For local development against npm run dev:

export CONTENTRX_API_URL=http://localhost:3000
export CONTENTRX_INSECURE_HTTP=1

What it emits

For every extracted string, the server calls /api/check and emits one LSP diagnostic per violation:

  • violation verdict → severity Warning (yellow squiggle)
  • review_recommended verdict → severity Information (blue squiggle)
  • pass verdict → no diagnostic

Each diagnostic carries the standard ID as the diagnostic code and points at the full rationale on docs.contentrx.io.

How it works

  1. initialize handshake advertises incremental text sync and UTF-16 position encoding — the LSP spec's default, matches every editor.
  2. didOpen / didChange update the in-memory document state. Lint jobs debounce for 400ms so rapid typing doesn't thrash the API.
  3. A per-document token bucket caps API calls at 2 per second.
  4. Tree-sitter parses the TSX source; string extraction is scoped to JSX text children and allow-listed copy attributes (alt, aria-label, placeholder, title, tooltip, label, …).
  5. /api/check runs server-side — the LSP is a thin HTTP client, no engine imports. Results map to LSP diagnostics via src/contentrx_lsp/diagnostics.py.

Architecture

Three surfaces talk to the same /api/check:

  • MCP server (contentrx-mcp) — Claude Code, Cursor chat, Claude desktop
  • LSP server (contentrx-lsp) — inline diagnostics
  • CLI (contentrx-cli) — terminal + CI

One source of truth for verdicts; no per-surface drift.

Try it

With an API key set, point any LSP client at contentrx-lsp and open a TSX file. The reference test case:

export function SignInButton() {
  return <button>Click here</button>;
}

Expected diagnostic: ACT-01 (generic CTA verb) on the Click here text range.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contentrx_lsp-0.1.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contentrx_lsp-0.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file contentrx_lsp-0.1.0.tar.gz.

File metadata

  • Download URL: contentrx_lsp-0.1.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for contentrx_lsp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db2c686ec28d97c4dda385e7bc1ad70201f24f2fde3f06298e73498a3be923e2
MD5 ab26131a981295c650cb0d1b6638aa3d
BLAKE2b-256 aa26b1d233ef68590f6e0ea2db29de87b2135c710feb89c49f955127df13540f

See more details on using hashes here.

File details

Details for the file contentrx_lsp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: contentrx_lsp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for contentrx_lsp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22ea9944470c6da5251ec372819b9647ce0ebcf75b5ff8470adf1312fe8076c3
MD5 167026c0835271644c1f81760a4514eb
BLAKE2b-256 09992bdcaf384251dd06a9705b1a928e5ba008cbe37d32d05865ac3041868062

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page