Skip to main content
Glama

Tree-Hugger-JS MCP Server

by qckfx
MIT License
165
1

transform_code

Apply multiple JavaScript/TypeScript code transformations in one operation, such as renaming, replacing, or inserting code, for efficient refactoring or migration workflows. Preview changes before applying.

Instructions

Apply multiple transformations in a single operation. Most powerful tool for complex refactoring workflows.

Examples: • API refactor: [{type: 'rename', parameters: {oldName: 'getData', newName: 'fetchData'}}, {type: 'removeUnusedImports'}] • Environment update: [{type: 'replaceIn', parameters: {nodeType: 'string', pattern: /localhost/g, replacement: 'api.production.com'}}, {type: 'removeUnusedImports'}] • Add logging: [{type: 'insertAfter', parameters: {pattern: 'function_declaration', text: 'console.log("Function called");'}}, {type: 'removeUnusedImports'}] • Bulk rename: [{type: 'rename', parameters: {oldName: 'user', newName: 'customer'}}, {type: 'rename', parameters: {oldName: 'id', newName: 'customerId'}}] • Legacy migration: [{type: 'replaceIn', parameters: {nodeType: 'call_expression', pattern: /XMLHttpRequest/g, replacement: 'fetch'}}, {type: 'removeUnusedImports'}]

Input Schema

NameRequiredDescriptionDefault
operationsYesArray of transformation operations applied in sequence. Use preview:true first!
previewNoReturn preview only without applying changes (default: false). ALWAYS preview complex transformations first.

Input Schema (JSON Schema)

{ "properties": { "operations": { "description": "Array of transformation operations applied in sequence. Use preview:true first!", "items": { "properties": { "parameters": { "description": "Parameters: rename{oldName,newName}, replaceIn{nodeType,pattern,replacement}, insert{pattern,text}", "type": "object" }, "type": { "enum": [ "rename", "removeUnusedImports", "replaceIn", "insertBefore", "insertAfter" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, "type": "array" }, "preview": { "description": "Return preview only without applying changes (default: false). ALWAYS preview complex transformations first.", "type": "boolean" } }, "required": [ "operations" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qckfx/tree-hugger-js-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server