Relax! MCP DOM Intelligence
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Relax! MCP DOM Intelligence
An MCP server that gives coding agents structured access to HTML and CSS files. Instead of reading raw source text, agents query parsed ASTs and get back only the specific information they need.
Why not just read the files?
When an agent reads an HTML or CSS file with a generic read_file tool, it dumps the entire file into context. This is wasteful and error-prone:
Token cost -- A 2000-line HTML file burns thousands of tokens even if the agent only needs to know what classes are on the nav bar.
Noise -- Raw markup buries the structural information agents actually need (element hierarchy, which selectors exist, what rules apply to an element) inside a wall of content, attributes, and boilerplate.
No cross-file reasoning -- Understanding which CSS rules apply to a given HTML element requires matching selectors across multiple files. A file-read tool can't do that; the agent has to load everything and figure it out manually, which is slow and unreliable.
Stale reads -- Files change during development. This server watches loaded files and re-parses automatically, so agents always work with current state.
This server solves these problems by parsing files once, caching the ASTs in memory, and exposing targeted query tools that return compact, structured results.
Related MCP server: webnav-mcp
Tools
Tool | What it does |
| Load HTML/CSS files into memory. Must be called first. Watches for changes. |
| Compact tree showing tag names, ids, and classes -- like the DOM inspector sidebar. |
| Query elements by CSS selector. Returns structured info (tag, id, classes, attributes, text, children). |
| List all selectors in a CSS file with line numbers and property counts. |
| Find CSS rules matching a selector string (substring match). |
| List all CSS classes used in an HTML file with frequency counts. |
| Find all CSS rules that apply to a specific element -- inline styles, |
Installation
Prerequisites
Node.js 18+
Build
git clone <repo-url>
cd relax-dom-intelligence
npm install
npm run buildAdd to Claude Code
For the current project (run from your project directory):
claude mcp add relax-dom -- node /absolute/path/to/relax-dom-intelligence/dist/index.jsFor a specific directory (global use -- run multiple instances with distinct names):
claude mcp add relax-dom-mysite -s user -- node /absolute/path/to/relax-dom-intelligence/dist/index.js /path/to/mysite --name relax-dom-mysiteThe -s user flag makes the server available across all your projects.
Add to Claude Desktop
Add an entry to your claude_desktop_config.json:
{
"mcpServers": {
"relax-dom": {
"command": "node",
"args": ["/absolute/path/to/relax-dom-intelligence/dist/index.js", "/path/to/project"]
}
}
}CLI options
node dist/index.js [directory] [--name <name>] [--description <desc>]Option | Default | Description |
| Current working directory | Root directory for resolving relative file paths |
|
| Server name (use distinct names when running multiple instances) |
|
| Server description shown to clients |
Examples
Serve current directory (typical local project use):
node dist/index.jsServe a specific project:
node dist/index.js /home/user/projects/my-websiteMultiple instances for global access:
# In Claude Code config, register two servers:
claude mcp add relax-dom-docs -s user -- node /path/to/dist/index.js /sites/docs --name relax-dom-docs
claude mcp add relax-dom-blog -s user -- node /path/to/dist/index.js /sites/blog --name relax-dom-blogRunning and debugging
Run directly
npm start
# or with options:
node dist/index.js /path/to/project --name my-serverThe server communicates over stdio (stdin/stdout). Diagnostic messages are written to stderr, so they won't interfere with the MCP protocol.
Watch mode (development)
Rebuild on source changes in one terminal:
npm run devThen run/restart the server in another.
Inspect with MCP Inspector
The MCP Inspector lets you interact with the server in a browser UI -- useful for testing tools without a full agent setup:
npx @modelcontextprotocol/inspector node dist/index.js /path/to/projectDebug logging
All log output goes to stderr. You'll see messages like:
[relax-dom-mysite] Server started on stdio (root: /sites/mysite)
[relax-dom-mysite] Re-parsed: /sites/mysite/index.htmlTo capture logs while running through an MCP client, redirect stderr to a file:
node dist/index.js /path/to/project 2>server.logTests
npm testTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Serves your design system and coding standards to coding agents, so they stop guessing.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Give your agent eyes: screenshots of any web page it can see, pages as markdown, and PDFs.
Related MCP Servers
- AlicenseAqualityCmaintenanceGives coding agents structured code understanding via tree-sitter with 23 tools and 10 languages, enabling precise queries instead of reading entire files.2332 PyPI30MIT
- AlicenseAqualityCmaintenanceEnables AI agents to navigate JS/TS/HTML/CSS code through TypeScript, HTML, and CSS language servers, answering hover, definition, references, symbol search, outline, and diagnostics queries. Adds a cross-file index of CSS custom properties and #id/.class selectors that single-file language servers cannot provide.10MIT
- AlicenseAqualityBmaintenanceEnables AI agents to navigate JS/TS, HTML, and CSS code — symbol info, outlines, callers, implementations, definitions, references, hover, and diagnostics — through bundled Node language servers. It also builds a cross-file index answering where CSS custom properties and #id/.class selectors are defined and used across stylesheets, markup, and scripts.1233 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to query a project's living frontend index — components, pages, data flow, global state, API calls, styles, health issues and history — through tools for search, component cards, impact analysis, page trees and incremental rescans.16 npm2Apache 2.0