Skip to content

MCP Tools Reference

The Renamify MCP Server provides 7 specialized tools for AI agents to perform intelligent renaming operations.

Creates a comprehensive renaming plan that identifies all case variations of your identifiers.

ParameterTypeRequiredDefaultDescription
oldstring✅ Yes-The identifier to replace
newstring✅ Yes-The new identifier
pathsstring[]NoCurrent dirPaths to search (files or directories)
includesstring[]NoAll filesGlob patterns to include
excludesstring[]NoNoneGlob patterns to exclude
stylesstring[]NoAll stylesCase styles to detect
previewstringNosummaryOutput format
dryRunbooleanNofalsePreview without saving
renameFilesbooleanNotrueRename matching files
renameDirsbooleanNotrueRename matching directories

Available case style options:

  • snake - snake_case
  • camel - camelCase
  • pascal - PascalCase
  • kebab - kebab-case
  • screaming-snake - SCREAMING_SNAKE_CASE
  • title - Title Case
  • train - Train-Case
  • dot - dot.case
  • summary - AI-optimized concise format
  • table - Human-readable table
  • diff - Unified diff format
  • json - Full structured data
Tool: renamify_plan
Arguments: {
"old": "UserAccount",
"new": "CustomerAccount",
"includes": ["src/**/*.ts", "tests/**/*.ts"],
"excludes": ["node_modules/**", "dist/**"],
"styles": ["camel", "pascal", "snake"],
"preview": "summary",
"dryRun": false
}
Created plan: a3b7c9d4e8f2a6b1
Summary:
Files to modify: 12
Total replacements: 47
Variants found:
UserAccount (15)
userAccount (18)
user_account (8)
USER_ACCOUNT (6)
Files to rename: 3
src/UserAccount.ts → src/CustomerAccount.ts
tests/userAccount.test.ts → tests/customerAccount.test.ts
docs/user-account.md → docs/customer-account.md

Applies a renaming plan to make the actual changes to your codebase.

ParameterTypeRequiredDefaultDescription
planIdstringNoLatestSpecific plan ID to apply
planPathstringNoAutoPath to plan file
atomicbooleanNotrueAll-or-nothing execution
commitbooleanNofalseCreate git commit after
Tool: renamify_apply
Arguments: {
"atomic": true,
"commit": true
}
Successfully applied plan a3b7c9d4e8f2a6b1
✓ Modified 12 files
✓ Applied 47 replacements
✓ Renamed 3 files
✓ Created git commit: "renamify: rename UserAccount to CustomerAccount"
All changes applied successfully.

If conflicts are detected:

Error: Conflicts detected in 2 files:
- src/api/handlers.ts: Content changed since plan creation
- lib/database.ts: File no longer exists
Run 'renamify_plan' again to create a fresh plan with current file state.

Reverts a previously applied renaming operation.

ParameterTypeRequiredDefaultDescription
idstringNolatestHistory ID to undo (use “latest” for most recent non-revert entry)
Tool: renamify_undo
Arguments: {
"id": "a3b7c9d4e8f2a6b1"
}
Successfully undone renaming a3b7c9d4e8f2a6b1
✓ Reverted 47 replacements in 12 files
✓ Restored 3 renamed files
All changes have been reverted.

Re-applies a previously undone renaming.

ParameterTypeRequiredDefaultDescription
idstringNolatestHistory ID to redo (use “latest” for most recent reverted entry)
Tool: renamify_redo
Arguments: {
"id": "a3b7c9d4e8f2a6b1"
}
Successfully redone renaming a3b7c9d4e8f2a6b1
✓ Re-applied 47 replacements in 12 files
✓ Re-renamed 3 files
All changes have been re-applied.

Shows the history of renaming operations.

ParameterTypeRequiredDefaultDescription
limitnumberNo10Number of entries to show
Tool: renamify_history
Arguments: {
"limit": 5
}
Renaming History (last 5 operations):
1. 4e8f2a6b1d3c7a9b [APPLIED]
getUserData → fetchUserData
12 files, 38 replacements
Applied: 1734567890
2. a3b7c9d4e8f2a6b1 [UNDONE]
UserAccount → CustomerAccount
12 files, 47 replacements
Applied: 1734567800
Undone: 1734567900
3. 6b1d3a7c9e4f8a2b [APPLIED]
snake_case → camelCase (config migration)
8 files, 156 replacements
Applied: 1734567600

Shows the current status of Renamify, including pending plans and system state.

This tool takes no parameters.

Tool: renamify_status
Arguments: {}
Renamify Status:
Current Directory: /home/user/project
Git Branch: feature/renaming
Git Status: Clean (no uncommitted changes)
Pending Plans:
1d3a7c9e4f8b2a6c - oldFunction → newFunction
Created: 5 minutes ago
Status: Not applied
Files: 8, Replacements: 23
Last Applied:
4e8f2a6b1d3c7a9b - getUserData → fetchUserData
Applied: 1 hour ago
Status: Success
System:
Renamify Version: 1.2.0
Config: .renamify/config.json found
History Entries: 47

Preview a plan in different formats without applying changes.

ParameterTypeRequiredDefaultDescription
planIdstringNoLatestPlan ID to preview
planPathstringNoAutoPath to plan file
formatstringNosummaryPreview format
  • summary - Concise AI-friendly format
  • table - Detailed table view
  • diff - Unified diff format
  • json - Raw JSON data
Tool: renamify_preview
Arguments: {
"format": "diff"
}
--- a/src/components/UserAccount.tsx
+++ b/src/components/CustomerAccount.tsx
@@ -1,8 +1,8 @@
-import { UserAccount } from '../types';
+import { CustomerAccount } from '../types';
-interface UserAccountProps {
- account: UserAccount;
+interface CustomerAccountProps {
+ account: CustomerAccount;
}
-export function UserAccountComponent({ account }: UserAccountProps) {
+export function CustomerAccountComponent({ account }: CustomerAccountProps) {
graph LR
A[renamify_plan] --> B[renamify_preview]
B --> C{Review OK?}
C -->|Yes| D[renamify_apply]
C -->|No| E[Adjust & re-plan]
D --> F{Success?}
F -->|No| G[renamify_undo]
F -->|Yes| H[Complete]
  1. Always plan before applying

    • Use renamify_plan first
    • Review with renamify_preview if needed
    • Only then use renamify_apply
  2. Use specific includes when possible

    • Target specific directories: ["src/**/*.ts"]
    • Exclude test files if not needed: ["!**/*.test.ts"]
  3. Check status before operations

    • Use renamify_status to verify clean state
    • Ensure no pending uncommitted changes
  4. Handle errors gracefully

    • Check for “conflicts detected” messages
    • Use renamify_undo if something goes wrong
    • Re-plan if files have changed
ErrorCauseSolution
”Renamify CLI not available”Binary not in PATHCheck installation
”No matches found”Pattern too restrictiveBroaden search criteria
”Conflicts detected”Files changed since planCreate new plan
”Plan not found”Invalid plan IDCheck with renamify_history
”Permission denied”File permissionsCheck file ownership

When apply fails:

  1. Note the error message
  2. Use renamify_status to check state
  3. If partially applied, use renamify_undo
  4. Fix the issue and create a new plan

When patterns don’t match:

  1. Start with broader patterns
  2. Use dryRun: true to test
  3. Adjust styles array if needed
  4. Check file extensions in includes

For repositories with >10,000 files:

  • Use specific includes patterns
  • Exclude build/dist directories
  • Consider breaking into multiple operations

The MCP Server loads plans into memory:

  • Plans typically < 1MB for most renames
  • Very large plans (>10MB) may need chunking
  • Use format: "summary" for efficiency

Usage Examples

See real-world renaming scenarios

AI Agent Guide

Best practices for AI-assisted renaming