OHM-MCP
AI-Powered Python Refactoring & Code Quality Assistant
Works with GitHub Copilot, Cursor IDE, Cline, and any MCP-compatible AI assistant.
Усильте агента
Собственная команда издателя. Не эндпоинт PlugMCP.
Host a copy with our keys and logs.
npx -y [email protected]У Claude Code нет ссылки для установки локальной команды. Скопируйте команду ниже и выполните её в терминале.
claude mcp add io.github.murugarajr-ohm-mcp -- npx -y ohm-mcp@1.0.1Выполните в терминале.
{ "mcpServers": { "io.github.murugarajr-ohm-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
Удалённый URL или команда на вашем компьютере? Чем различаются два способа установки
Запустить на PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
ЗапускNo installation required! Use NPX to run the latest version automatically:
npx -y ohm-mcp@latest
This is the easiest way to get started. Just add the configuration to your AI assistant (see IDE Configuration below).
MCP Registry: mcp-name: io.github.Murugarajr/ohm-mcp
Use this method when you need to:
Install from PyPI:
pip install ohm-mcp
Install from source (for development):
pip install -e .
After publishing to npm:
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["ohm-mcp@latest"]
}
}
}
For local development:
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["--package", "/path/to/ohm-mcp-npm", "ohm-mcp"]
}
}
}
Usage:
# and select ohm-mcp toolsGlobal (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"]
}
}
}
For local development:
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["--package", "/path/to/ohm-mcp-npm", "ohm-mcp"]
}
}
}
Usage:
Global (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"]
}
}
}
For local development:
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["--package", "/path/to/ohm-mcp-npm", "ohm-mcp"]
}
}
}
Usage:
Global (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}
Usage:
Global (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"]
}
}
}
Usage:
Configuration (config.toml):
[mcp_servers.ohm-mcp]
args = ["-y", "ohm-mcp@latest"]
command = "npx"
Usage:
Local (For local development with virtual environment):
{
"mcpServers": {
"ohm-mcp": {
"command": "/Users/username/project/venv/bin/python",
"args": ["-m", "ohm_mcp.server"],
"disabled": false,
"alwaysAllow": []
}
}
}
Global (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"]
}
}
}
Usage:
First install: pip install ohm-mcp
Then add to .vscode/mcp.json:
{
"servers": {
"ohm-mcp": {
"command": "python",
"args": ["-m", "ohm_mcp.server"]
}
},
"inputs": []
}
Usage:
# and select ohm-mcp toolsFirst install: pip install ohm-mcp
Then add to Cursor's MCP settings file (.cursorrules or MCP config):
{
"mcpServers": {
"ohm-mcp": {
"command": "python",
"args": ["-m", "ohm_mcp.server"]
}
},
"inputs": []
}
Example with virtual environment:
{
"mcpServers": {
"ohm-mcp": {
"command": "/Users/username/projects/venv/bin/python",
"args": ["-m", "ohm_mcp.server"]
}
}
}
Usage:
First install: pip install ohm-mcp
Then add to Cline's MCP settings:
{
"mcpServers": {
"ohm-mcp": {
"command": "python",
"args": ["-m", "ohm_mcp.server"]
}
}
}
Example with virtual environment:
{
"mcpServers": {
"ohm-mcp": {
"command": "/Users/username/projects/venv/bin/python",
"args": ["-m", "ohm_mcp.server"]
}
}
}
Note: Cline requires absolute paths for both command and cwd.
Usage:
Any MCP-compatible client can use this server. General configuration:
{
"mcpServers": {
"ohm-mcp": {
"command": "<python-interpreter-path>",
"args": ["<path-to-mcp_server.py>"],
"cwd": "<project-directory>"
}
}
}
Finding your Python path:
# Unix/Mac
which python
# or
which python3
# Windows
where python
Once configured, simply reference tools in your AI assistant chat using the format: use #ohm-mcp.tool_name on the current file or @file_name.py
Use #ohm-mcp.detect_dead_code on @utils.py
This will detect:
Use #ohm-mcp.detect_code_duplicates to find duplicates in /path/to/project
Finds:
Analyze architecture of @my_module.py using #ohm-mcp.analyze_architecture
Detects:
Use #ohm-mcp.extract_method_ast to extract lines 45-60 from @handler.py into a new function called "process_request"
Automatically:
Use #ohm-mcp.rename_symbol to rename "old_function_name" to "new_function_name" in /path/to/project
Features:
Analyze type hints in @module.py using #ohm-mcp.analyze_type_hints
Provides:
Use #ohm-mcp.analyze_performance on @slow_module.py
Detects:
Generate tests for @calculator.py using #ohm-mcp.generate_characterization_tests
Creates:
Suggest design patterns for @legacy_code.py using #ohm-mcp.suggest_design_patterns
Recommends:
Use #ohm-mcp.refactor_imports to update all files in /path/to/project from "old.module" to "new.module"
Handles:
import old.module)from old.module import X)Example - Extract Method:
# Input: Lines 45-60
result = extract_method_ast(code, 45, 60, "calculate_total")
# Output: Refactored code + patch + auto-detected params/returns
graph LR
A[apply_refactoring] --> B{Dry Run?}
B -->|Yes| C[Show Preview]
B -->|No| D[Create Backup]
D --> E[Apply Changes]
E --> F{Run Tests}
F -->|Pass| G[Success]
F -->|Fail| H[Auto Rollback]
H --> I[rollback_refactoring]
Features:
generate_quality_report - Comprehensive dashboard in HTML/Markdown/JSON
Output Preview:
📊 Health Score: 85/100 (Good)
📁 Files: 47 | Lines: 12,450 | Tech Debt: 23 pts
📊 Type Coverage: 67%
🗑️ Dead Code: 8 imports, 12 variables, 3 functions
⚡ Performance: 4 nested loops, 2 mutable defaults
📋 Duplication: 3 exact, 5 near-duplicates
Visual Dashboard:
generate_characterization_tests → pytest → extract_method_ast → pytest
detect_code_duplicates → review suggestions → extract_method_ast
analyze_type_hints → follow migration plan → generate_type_stub
analyze_performance → prioritize_by_coverage → apply fixes
refactor_imports(old="myapp.old", new="myapp.new") → review patches
rename_symbol(old="calc", new="calculate", preview_only=True) → apply
generate_quality_report(format="html") → open dashboard → track trends
┌─────────────────────────────────────────────┐
│ 🔍 Code Quality Dashboard │
├─────────────────────────────────────────────┤
│ │
│ ╭─────────╮ 📁 Overview │
│ │ 85 │ Files: 47 │
│ │ /100 │ Lines: 12,450 │
│ ╰─────────╯ Tech Debt: 23 │
│ Health Score │
│ │
├─────────────────────────────────────────────┤
│ 📊 Type Coverage ⚡ Performance │
│ ████████░░ 67% 🔴 4 nested loops │
│ 120/180 typed 🟡 2 mutable args │
├─────────────────────────────────────────────┤
│ 🗑️ Dead Code 📋 Duplication │
│ 8 imports 3 exact │
│ 12 variables 5 near │
│ 3 functions │
└─────────────────────────────────────────────┘
# Before
- def calc(x, y):
- return x + y
- result = calc(5, 3)
# After
+ def calculate_sum(x, y):
+ return x + y
+ result = calculate_sum(5, 3)
✅ 1 function renamed
✅ 3 call sites updated
✅ 0 conflicts detected
✅ 30 MCP Tools
✅ 40+ Static Checks
✅ 100% AST Accuracy
✅ Zero Regex Patterns
✅ Automated Execution with Rollback
✅ Beautiful Dashboards (HTML/JSON/MD)
✅ Universal MCP Compatibility
✅ Safe Refactoring with Auto-Backup
Verify Python path:
which python # Unix/Mac
where python # Windows
Test MCP server directly:
python -m ohm_mcp.server
Check logs:
Common issues:
command → Use absolute pathscwd for Cline → Must be absolute pathRun before submitting:
./static_analyser.sh # Runs ruff, mypy, pylint, flake8
pytest # All tests must pass
Built with Model Context Protocol • Python AST • Compatible with GitHub Copilot, Cursor IDE, Cline
Made with ❤️ for better code quality
⭐ Star this repo if it helps you write cleaner code!
AST-based Python refactoring MCP server with safe automated refactorings and rollback
{ "mcpServers": { "io.github.murugarajr-ohm-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}Инструменты
Списка инструментов пока нет. У удалённых серверов он появляется после первой проверки состояния.
FAQ
Скопируйте на этой странице конфигурацию stdio для Cursor, Claude Desktop, Claude Code или VS Code. Она использует установку издателя, а не прокси PlugMCP.
В этой записи не указано обязательных переменных окружения.
Ohm работает локально через stdio.
Последняя проверка: 2026-11-09. AST-based Python refactoring MCP server with safe automated refactorings and rollback