webnav-ts-mcp
Summary: Use webnav to navigate and inspect JS/TS, HTML, and CSS code, especially with cross-file CSS/HTML index lookups and diagnostics; the provided schema exposes read-only tools, while the README also describes checked editing tools not listed here.
JS/TS exploration: search symbols, get symbol summaries, find callers/implementations, and outline files.
Position-based navigation: hover, definition, references, and diagnostics at a file/line/column.
CSS/HTML cross-file lookup: find CSS custom-property definitions/usages and
#id/.classselector usages across files and roots.Workspace inspection: show which directory is being navigated and troubleshoot wrong checkout/worktree results.
README-only extras: checked edit/rename/move/quick-fix, verification, apply/undo, and batching tools.
Indexes and navigates CSS across the workspace: locates where custom properties (--name) and #id/.class selectors are defined and used across stylesheets, HTML and JS, and surfaces CSS diagnostics including unreferenced-selector and undefined-variable warnings (with an option to mark public stylesheets as an external API).
Provides name-based and position-based navigation of JS/TS source via the TypeScript 7 native language server: symbol info (header, hover, definition, references), file outlines, call hierarchy (callers), interface/class/method implementations, ranked workspace symbol search, hover/definition/references and diagnostics.
webnav-ts-mcp
An MCP server that gives AI agents JavaScript, TypeScript, HTML and CSS navigation, a cross-file index of CSS custom properties and selectors, and editing tools that check changes before writing them.
An MCP client sends requests to webnav. Webnav uses language servers for navigation and diagnostics, and a workspace index for CSS variables and selectors. For edits, it checks an in-memory proposal before applying it to files. How it works and limits.
Quick start
With Node.js 20 or later installed, register webnav with your MCP host. Run the command for your host from the project directory:
# Claude Code
claude mcp add webnav -- npx -y webnav-ts-mcp
# Codex
codex mcp add webnav -- npx -y webnav-ts-mcp
# OpenCode
opencode mcp add webnav -- npx -y webnav-ts-mcpYour MCP host starts the server when needed. See the setup guide for manual configuration, Cursor, and project-local installation.
Related MCP server: webnav-mcp
What you can do
Task | Start with |
Explore JS/TS code |
|
Navigate by position |
|
Find CSS variables and selectors across files |
|
Change code with checks |
|
Review or group changes |
|
The name-based navigation tools are JS/TS only; use the CSS and HTML index for markup and stylesheets. Positions are 1-indexed and columns use UTF-16 offsets. See the tool reference for write safeguards, previews, batching and scope.
Requirements and limits
Node.js 20 or later is required. Language servers are npm dependencies; webnav uses a project's TypeScript 7 or newer when available, otherwise its own copy. The cross-file CSS/HTML index is regex-based, and write checks have limits around importers and path aliases. The project has been verified on Linux with Node 22; Windows, macOS and Node 20/24 have not been verified. See configuration and language servers and design notes and costs.
Tests
For a checkout, run npm install and npm run check to run lint, type checking and the Vitest suite. The suite includes integration tests with language servers and MCP. See development for more commands and test details.
Documentation
Setup: manual host configuration, Cursor and project-local installation.
Tool reference: navigation, edits, safety and batching.
Configuration: language servers and environment variables.
Development and design: layout, tests, implementation notes and costs.
License
MIT. See LICENSE.
Available Tools
12 toolscallersA
Who calls this function? Example: callers(name="renderSidebar").
Narrower than references, since it leaves out imports and type-only usages and only lists actual call sites, each with the calling function and its call-site lines. name resolves the same way as symbol_info (dotted Class.method accepted, inherited members included; pass file_path to disambiguate a common name). query is accepted as an alias for name. JS/TS only.
Inputs: name, query, file_path.
css_varA
Where is this --custom-property defined and used? Example: css_var(name="--bg").
The CSS/HTML language servers only see one file at a time, so var(--x) usages can't be cross-referenced across files that way. This scans .css files and HTML <style>/style="…" blocks/attributes instead. name may be given with or without the leading --. Definitions (value + enclosing context, e.g. @media (prefers-color-scheme: dark) › :root) and usages (grouped by file with line numbers) are reported separately per configured root (see WEBNAV_MCP_ROOTS; a single unnamed root by default), since each may define its own values. query is accepted as an alias for name.
Inputs: name, query.
definitionA
Go to the definition of the symbol at a position.
line and column are 1-indexed. column is a UTF-16 character offset on the line (not a visual/display column): a leading tab counts as one character. On a --custom-property/#id/.class token in a .css/.html file (or a name inside an HTML id="..."/class="..." value), answers from the cross-file index (see css_var/selector) instead of the single-file language server: for definition, just the definition(s) in the file's own root (each WEBNAV_MCP_ROOTS root is separate); for references, that root's definitions and usages.
Inputs: line (required), column (required), file_path (required).
diagnosticsA
Get the relevant language server's diagnostics (errors/warnings) for a single file.
For .css/.html files, this also includes index-derived warnings the single-file language server can't see: var(--x) used with no matching declaration anywhere in the same indexed root, and CSS selectors (#id/.class) with no HTML/JS reference in that root.
Inputs: file_path (required).
hoverB
Get type/documentation info for the symbol at a position.
line and column are 1-indexed. column is a UTF-16 character offset on the line (not a visual/display column): a leading tab counts as one character.
Inputs: line (required), column (required), file_path (required).
implementationsA
Who implements or extends this? Example: implementations(name="Shape").
For an interface or class, lists the classes that implement or extend it (transitively); for an interface or abstract method (Shape.area), lists the methods that implement it. Backed by the language server's textDocument/implementation, so it follows the type checker, not naming. name resolves like symbol_info (pass file_path to disambiguate); query is accepted as an alias. JS/TS only.
Inputs: name, query, file_path.
outlineA
What's in this file? Example: outline(file_path="src/app.ts").
Indented outline (functions, classes, interfaces, with :start-end line spans) of a JS/TS file in source order, so you can navigate without reading it in full. Locals, callbacks and object-literal keys inside functions and variables are left out; pass detailed=true to include them. Follow up with hover/definition/references at a listed line, or symbol_info by name.
Inputs: file_path (required), detailed.
referencesB
Find all usages of the symbol at a position across the workspace.
line and column are 1-indexed. column is a UTF-16 character offset on the line (not a visual/display column): a leading tab counts as one character. On a --custom-property/#id/.class token in a .css/.html file (or a name inside an HTML id="..."/class="..." value), answers from the cross-file index (see css_var/selector) instead of the single-file language server, limited to the file's own root (each WEBNAV_MCP_ROOTS root is separate) unless it has no hits there.
Inputs: line (required), column (required), file_path (required), include_declaration.
search_symbolA
Search JS/TS files for a symbol by name (function, class, const, etc.).
JS/TS-only: the HTML/CSS language servers don't implement useful workspace-wide symbol search (webnav does not reimplement it). Prefer symbol_info for a one-call summary. Returned positions point at the identifier name and use the same character-offset column convention as the other tools. Results include a SymbolKind label and are capped. name is accepted as an alias for query. Narrow broad queries with kind (SymbolKind labels, comma-separated: class, function,method, interface, ...) and path (workspace-relative prefix such as src/, or a glob such as src/**/*.ts). Production code ranks before tests. Loose fuzzy hits whose names don't contain the query are summarised as a count when real matches exist; pass fuzzy=true to list them too.
Inputs: kind, name, path, fuzzy, +1 more.
selectorA
Who uses this #id or .class? Example: selector(name=".card-title").
Looks up the selector across the whole workspace.
Cross-references CSS rule definitions, HTML id=/class= attributes, and JS usages (getElementById, classList.add/remove/toggle/contains, querySelector/querySelectorAll, className assignment, and any JS string literal exactly equal to the bare name, e.g. an id passed to a project's own helper like onClick("btn-save", …), labeled "string literal"). Hits in generated output (WEBNAV_MCP_EXCLUDE) are labeled [generated]; edit their source instead. This is something the single-file CSS/HTML language servers can't do. name must include the leading # or .. Grouped by file with line numbers, separately per configured root (see WEBNAV_MCP_ROOTS). A JS hit built from string concatenation (e.g. getElementById("view-" + x)) is reported against only its static prefix and labeled "dynamic partial match"; a query whose name starts with such a prefix (e.g. #view-components against a stored #view-) also surfaces that hit, labeled "dynamic partial match via ''", instead of being silently dropped or guessed. query is accepted as an alias for name.
Inputs: name, query.
symbol_infoA
What is X and where is it used? Example: symbol_info(name="renderSidebar").
One-call summary for a JS/TS name: header, hover text, definition, and references grouped by file, the usual first lookup instead of chaining search_symbol → hover → definition → references by hand. Pass file_path to disambiguate; query is accepted as an alias for name. For CSS/HTML cross-file lookups use css_var / selector instead.
Inputs: name, query, file_path, include_references.
workspaceA
Which directory is webnav navigating, and why? Use when results look like they come from the wrong checkout/worktree.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools map to distinct navigation operations, and descriptions explicitly delineate boundaries (e.g. callers is 'narrower than references', symbol_info is a one-call bundle). The main risk is overlap between symbol_info and the chained search_symbol/hover/definition/references set, plus references vs callers vs implementations, but the descriptions steer selection clearly.
Names are uniformly lowercase, mostly bare LSP-style nouns (hover, definition, references, diagnostics, outline) with a few snake_case compound names (search_symbol, symbol_info, css_var). The style is predictable and readable despite not being a strict single verb_noun pattern.
Twelve tools is well within the ideal 3-15 range and each tool earns its place (a distinct LSP capability or a deliberate cross-file index feature). No obvious redundancy or padding.
Covers the core navigation lifecycle: diagnostics, hover, definition, references, outline, symbol search, callers, implementations, plus CSS custom-property and selector cross-referencing. Missing rename/refactor, code actions, and workspace symbol search for non-JS/TS languages (a limitation the descriptions acknowledge), which are minor workaroundable gaps.
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceExposes type-aware code navigation and fast file search to AI agents via language servers, enabling definitions, references, symbols, and file lookup without reading entire codebases.MIT
- AlicenseAqualityFmaintenanceEnables 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
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to navigate and refactor a codebase through an AST index, offering project overviews, symbol and usage search, module dependency exploration, and LSP-backed operations such as rename, go-to-definition, diagnostics, and extract-method. Supports TypeScript/JavaScript and C# with automatic reindexing and watch mode.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to obtain real-time language-server diagnostics, type information, symbol definitions, references, and workspace-wide renames directly from open editor instances, avoiding slow external type and lint checks.-