Skip to main content

webnav-mcp

An MCP server that gives AI agents JS/TS/HTML/CSS navigation, plus a cross-file index of CSS custom properties and #id/.class selectors that single-file language servers can't provide. It's the front-end counterpart to codenav-mcp.

Quick start

You need uv (or pipx) and Node.js ≥ 18:

uvx webnav-mcp

Register it with your MCP host. For Claude Code, from the project root:

claude mcp add webnav -- uvx webnav-mcp

Or add it to a project .mcp.json (Claude Code) or .cursor/mcp.json (Cursor):

{
	"mcpServers": {
		"webnav": {
			"command": "uvx",
			"args": ["webnav-mcp"]
		}
	}
}

In Cursor, also set "env": {"WEBNAV_MCP_WORKSPACE": "${workspaceFolder}"}, because Cursor may start MCP servers with your home directory as the working directory.

Language servers

Requests are routed to three Node language servers by file extension:

Extension Backend
.js / .mjs / .cjs / .jsx / .ts / .mts / .cts / .tsx TypeScript 7 native LSP: tsc --lsp --stdio (JS via allowJs / jsconfig.json)
.html vscode-html-language-server
.css vscode-css-language-server

Resolution order for tsc / HTML / CSS binaries: navigated project's node_modules/.bin/ → webnav's own package-local install (see Development) → PATH → npx --yes (JS/TS: npx -p typescript@7 tsc --lsp --stdio). webnav does not use typescript-language-server — TypeScript 7 no longer ships classic tsserver.js.

To skip downloads, install in the project (or under this package for standalone):

npm install --save-dev typescript@^7 vscode-langservers-extracted

Tools

For JS/TS, start with the name-based tools:

Tool Answers
symbol_info What is this? Header, hover, definition and references in one call
outline What's in this file? (source order; locals left out unless detailed=true)
search_symbol JS/TS workspace symbol search (ranked, capped; optional kind= / path= filters; fuzzy-only hits summarised unless fuzzy=true)
workspace Which directory is being navigated, and why

Then use the position tools once you have a path:line:col:

Tool Answers
hover Type and docs at a position
definition Go to definition (CSS/HTML tokens answer from the index below)
references All usages (CSS/HTML tokens answer from the index below)
diagnostics Language-server diagnostics; CSS/HTML also get unreferenced-selector and undefined-variable warnings

Cross-file CSS/HTML index (a Python scanner, not the language servers):

Tool Answers
css_var Where is --name defined and used?
selector Where is #id or .class defined and used (CSS, HTML, JS)?

search_symbol, symbol_info and outline are JS/TS only. Use css_var and selector for markup and stylesheets.

name and query are accepted as aliases of each other on the name-based tools. A missing parameter gets a short hint back instead of a validation error.

Positions are 1-indexed. column is a UTF-16 character offset (a leading tab counts as one character).

Environment

Variable Default Purpose
WEBNAV_MCP_WORKSPACE unset: follows the client's MCP roots when they name a worktree of the same git repository, else CLAUDE_PROJECT_DIR, else the working directory Pins the project root (never overridden). See the workspace tool
WEBNAV_MCP_ROOTS the whole workspace as one root, labelled web Comma-separated label=relative/path pairs to index separately, e.g. app=src,prototypes=design when two trees define their own values
WEBNAV_MCP_EXCLUDE nothing Comma-separated workspace-relative paths of generated script output (e.g. the JS a TS build emits). These aren't opened, are hidden from search_symbol, and are rejected by the position tools. The CSS/selector index still reads them

Requirements

  • Python ≥ 3.11
  • Node.js ≥ 18 (for TypeScript 7's tsc shim and the HTML/CSS servers)
  • Installed automatically: mcp, mcp-nav-shared

Development

Developed in the SpaceMaker repository as a uv workspace member (mcp-servers/webnav_mcp). From a checkout: uv sync --group dev, then npm ci in this directory (owns typescript@^7 + vscode-langservers-extracted for standalone launch), then uv run webnav-mcp.

License

MIT. See LICENSE.

Release files for webnav-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webnav-mcp 0.1.0
File Size Uploaded
webnav_mcp-0.1.0.tar.gz 23.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webnav-mcp 0.1.0
File Interpreter ABI Platform
webnav_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.3 kB

Release files / webnav_mcp-0.1.0.tar.gz

Download URL webnav_mcp-0.1.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c261ad237717ddc4b941be3c4ed5f24b103ca5a17c50f519cf018e797fd6e5bc
BLAKE2b-256 checksum
How to use checksums
a878b7d08ffb3f39fe858874709a3fd73ac9803d89f6c5479f918f4c55c2d7e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / webnav_mcp-0.1.0-py3-none-any.whl

Download URL webnav_mcp-0.1.0-py3-none-any.whl
Size 26.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf6bb6bc8e69090742e840a1476daa72b848275faa427a88e297e89329339fd
BLAKE2b-256 checksum
How to use checksums
136fd5039780d8ea41cbb924aa68f685c4ca47240486b906d23174e75ff88b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page