AST-based Python refactoring MCP server with safe automated refactorings and rollback
Most developer tooling work still happens through a UI a human drives. Ohm MCP server moves it into the conversation instead. AST-based Python refactoring MCP server with safe automated refactorings and rollback.
Works with GitHub Copilot, Cursor IDE, Cline, and any MCP-compatible AI assistant.
The server publishes 14 tools. What each one is for:
analyze_codebase — Comprehensive code analysispropose_function_refactor — Function-level refactor planningexplain_refactoring — Explain refactoring patternscreate_refactor_patch — Generate unified diff patchesanalyze_architecture — Detect God Objects, SOLID violationssuggest_design_patterns — Recommend patterns (Strategy, Factory, Observer)analyze_tight_coupling — Find coupling issuessuggest_di_refactor — Generate DI codeextract_method_ast — Extract code into functionsuggest_extractable_methods — Find extractable blocksdetect_dead_code — Find unused coderefactor_imports — Update imports project-wideConfiguration is passed through the environment: PYTHONUNBUFFERED. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
The server ships on npm as ohm-mcp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.
This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Ohm's toolset — analyze_codebase, propose_function_refactor, explain_refactoring and 11 more — is a fair guide to whether it matches your workflow. It is maintained by Murugarajr; worth a glance at recent repository activity before you build anything load-bearing on it.
We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.
| Tool | What it does |
|---|---|
| analyze_codebase | Comprehensive code analysis |
| propose_function_refactor | Function-level refactor planning |
| explain_refactoring | Explain refactoring patterns |
| create_refactor_patch | Generate unified diff patches |
| analyze_architecture | Detect God Objects, SOLID violations |
| suggest_design_patterns | Recommend patterns (Strategy, Factory, Observer) |
| analyze_tight_coupling | Find coupling issues |
| suggest_di_refactor | Generate DI code |
| extract_method_ast | Extract code into function |
| suggest_extractable_methods | Find extractable blocks |
| detect_dead_code | Find unused code |
| refactor_imports | Update imports project-wide |
| refactor_single_file_imports | Refactor imports in one file |
| analyze_wildcard_imports | Find wildcard imports |
**For local development:**
```json
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["--package", "/path/to/ohm-mcp-npm", "ohm-mcp"]
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| PYTHONUNBUFFERED | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.