β¨ Core Capabilities
ποΈ Architecture
- God Object Detection
- SOLID Violation Analysis
- Design Pattern Suggestions
- Dependency Injection Refactoring
π§ Code Quality
- AST Extract Method (100% accurate)
- Dead Code Elimination
- Import Refactoring
- Symbol Renaming (project-wide)
- Duplication Detection
|
π Type Safety
- Type Coverage Analysis
- Type Stub Generation
- Auto Test Generation
β‘ Performance
- O(nΒ²) Pattern Detection
- Hotspot Analysis
- Coverage-Driven Prioritization
π€ Automation
- Auto-Apply with Rollback
- Operation History
- Quality Dashboard
|
π Quick Start
Installation
π¦ Recommended: NPM Method (Auto-installs dependencies)
No installation required! Use NPX to run the latest version automatically:
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
π Alternative: PyPI Method (For local development)
Use this method when you need to:
- Develop locally with the Python package
- Use a specific Python virtual environment
- Install from source for customization
Install from PyPI:
Install from source (for development):
IDE Configuration
π¦ Option 1: NPX (Recommended - Auto-installs dependencies)
π΅ GitHub Copilot (VS Code) with NPX
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:
- Open Copilot Chat
- Type
# and select ohm-mcp tools
- Ask: "Analyze this file and suggest refactorings"
π£ Cursor IDE with NPX
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:
- Open Cursor Chat (Cmd+L / Ctrl+L)
- Tools are automatically available
- Ask: "Use ohm-mcp to detect dead code"
π’ Cline (VS Code Extension) with NPX
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:
- Open Cline panel
- Tools are available in agent context
- Ask: "Analyze type coverage and suggest improvements"
π Antigravity with NPX
Global (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}
Usage:
- Tools are automatically available in Antigravity
- Ask: "Use ohm-mcp to analyze architecture"
π΄ Roo Code with NPX
Global (After publishing to npm):
{
"mcpServers": {
"ohm-mcp": {
"command": "npx",
"args": ["-y", "ohm-mcp@latest"]
}
}
}
Usage:
- Open Roo Code panel
- Tools are available in agent context
- Ask: "Use ohm-mcp to detect duplicates"
β« Codex VS Code with NPX
Configuration (config.toml):
[mcp_servers.ohm-mcp]
args = ["-y", "ohm-mcp@latest"]
command = "npx"
Usage:
- Open Codex panel
- Tools are automatically available
- Ask: "Use ohm-mcp to suggest design patterns"
π‘ Kilo Code with NPX (Local/Global)
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:
- Open Kilo Code panel
- Tools are available in agent context
- Ask: "Use ohm-mcp for refactoring"
π Option 2: Direct Python (Manual setup)
π΅ GitHub Copilot (VS Code) with Python
First install: pip install ohm-mcp
Then add to .vscode/mcp.json:
{
"servers": {
"ohm-mcp": {
"command": "python",
"args": ["-m", "ohm_mcp.server"]
}
},
"inputs": []
}
Usage:
- Open Copilot Chat
- Type
# and select ohm-mcp tools
- Ask: "Analyze this file and suggest refactorings"
π£ Cursor IDE with Python
First 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:
- Open Cursor Chat (Cmd+L / Ctrl+L)
- Tools are automatically available
- Ask: "Use ohm-mcp to detect dead code"
π’ Cline (VS Code Extension) with Python
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:
- Open Cline panel
- Tools are available in agent context
- Ask: "Analyze type coverage and suggest improvements"
π§ Other MCP-Compatible Clients
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
π‘ Quick Usage Examples
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
ποΈ Find Dead Code
Use #ohm-mcp.detect_dead_code on @utils.py
This will detect:
- β
Unused imports (import statements never referenced)
- β
Unused variables (assigned but never read)
- β
Unreachable code (after return/raise/break/continue)
- β
Unused functions (defined but never called)
- β
Shadowed variables (inner scope hides outer scope variable)
π Code Duplication Detection
Use #ohm-mcp.detect_code_duplicates to find duplicates in /path/to/project
Finds:
- β
Exact duplicates (100% identical code blocks)
- β
Near duplicates (90%+ similarity)
- β
Duplicate functions (same structure, different names)
- β
Provides refactoring suggestions to eliminate duplication
ποΈ Architecture Analysis
Analyze architecture of @my_module.py using #ohm-mcp.analyze_architecture
Detects:
- β
God Objects (classes doing too much)
- β
SOLID principle violations
- β
Circular dependencies
- β
High coupling issues
βοΈ Extract Method Refactoring
Use #ohm-mcp.extract_method_ast to extract lines 45-60 from @handler.py into a new function called "process_request"
Automatically:
- β
Detects required parameters
- β
Identifies return values
- β
Generates refactored code
- β
Creates unified diff patch
π Safe Symbol Renaming
Use #ohm-mcp.rename_symbol to rename "old_function_name" to "new_function_name" in /path/to/project
Features:
- β
AST-based (100% accurate)
- β
Detects naming conflicts
- β
Shows all occurrences before applying
- β
Updates docstrings and comments