Tree-Hugger-JS

Tree-Hugger-JS is an MCP server that connects AI clients like Claude Code to the tree-hugger-js library for parsing, inspecting, and manipulating JavaScript and TypeScript codebases. Designed for software developers and automated coding assistants, it allows language models to run structural AST analyses rather than relying on brittle text searches. The server enables clients to parse source files or raw strings across JavaScript, TypeScript, JSX, and TSX formats. Agents can locate code constructs using CSS-like pattern selectors, such as querying functions, classes, imports, or specific async methods. Beyond passive analysis, the server provides automated transformation tools to rename identifiers throughout a project, prune unused imports, inject code snippets, and chain multi-step refactoring operations with rollback and preview capabilities. It also exposes internal resources to track active AST states, metadata summaries, and transformation histories.

Category: Developer Tools & Code Intelligence

Tags: ast, code analysis, javascript, refactoring, typescript

Visit Tree-Hugger-JS

How to install and configure Tree-Hugger-JS

  1. Run or test the server instantly using npx: bash npx tree-hugger-js-mcp Alternatively, install it globally: bash npm install -g tree-hugger-js-mcp 2. Open your client configuration file (such as Claude Code or your MCP client's settings). 3. Add the server under the mcpServers object: json { "mcpServers": { "tree-hugger-js": { "command": "npx", "args": ["tree-hugger-js-mcp"] } } } 4. Save your configuration and restart your client to expose the AST tools.

What you can do with Tree-Hugger-JS

• Parse JavaScript and TypeScript files into abstract syntax trees to extract functions, classes, and method signatures. • Locate specific code patterns and async calls using CSS-style selectors like attribute and hierarchy matching. • Automate refactoring tasks by renaming identifiers across files with a safe preview mode before applying changes. • Clean up module imports automatically by identifying and removing unused declarations across the project AST. • Insert code snippets before or after matched structural elements such as constructors or function declarations.

Key facts

  • Open Source
  • https://github.com/qckfx/tree-hugger-js-mcp
  • Developer Tools & Code Intelligence
  • ast, code analysis, javascript, refactoring, typescript

Part of MCP Servers

Related MCP servers

  • MCP LaTeX Server — MCP LaTeX Server is an MCP server that provides tools for creating, editing, validating, and compiling LaTeX documents directly through…
  • MCP JSON — MCP JSON is an MCP server collection that bundles tools for file system operations, Google search, browser-based web automation, and…
  • MCP Jupyter Complete — MCP Jupyter Complete is an MCP server that provides tools for manipulating Jupyter notebook files through position-based cell operations and…
  • MCP LSP Go — MCP LSP Go is an MCP server that connects AI assistants to the official Go Language Server Protocol implementation, gopls,…
  • MCP Manager — MCP Manager is an MCP server management tool that connects directly to your Claude Desktop environment, enabling users to discover,…
  • MCP Lab — MCP Lab is an MCP server development environment designed for building, testing, and debugging custom Model Context Protocol servers integrated…

How do I install Tree-Hugger-JS?

You can run Tree-Hugger-JS immediately using npx by calling npx tree-hugger-js-mcp without prior installation. Alternatively, install it globally on your machine using npm install -g tree-hugger-js-mcp, or clone the GitHub repository and run npm run build to start it locally via Node.js.

What can Tree-Hugger-JS do?

Tree-Hugger-JS provides tools to parse JavaScript, TypeScript, JSX, and TSX code, match patterns via CSS-like queries, and inspect AST nodes. It also supports code transformation tools that rename identifiers, delete unused imports, and insert code segments before or after targeted patterns.

Which MCP clients work with Tree-Hugger-JS?

Tree-Hugger-JS works with Claude Code and any client implementing the Model Context Protocol that supports standard input and output command execution. It can be registered by declaring the npx command inside the client configuration file.

Is Tree-Hugger-JS open source?

Yes, Tree-Hugger-JS is open source software released under the MIT license. You can view the code, build from source, and inspect the project repository on GitHub at https://github.com/qckfx/tree-hugger-js-mcp.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories