Skip to main content
Glama
krystofbe

rope-mcp-server

by krystofbe

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{
  "tasks": {
    "list": {},
    "cancel": {},
    "requests": {
      "tools": {
        "call": {}
      },
      "prompts": {
        "get": {}
      },
      "resources": {
        "read": {}
      }
    }
  }
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_symbolsA

List all top-level symbols in a Python file.

Args: project_path: Root directory of the Python project file_path: File path relative to project_path

Returns: JSON with symbols: [{"name": "Foo", "type": "class", "line": 5, "byte_offset": 42}, ...]

move_symbolA

Move a class or function to another file.

Updates all imports across the project automatically.

Args: project_path: Root directory of the Python project source_file: Source file path relative to project_path symbol_name: Name of the class or function to move dest_file: Destination file path (created if doesn't exist)

Returns: JSON with success status and list of changed files

move_moduleB

Move a module or package to another folder.

Updates all imports across the project automatically.

Args: project_path: Root directory of the Python project module_path: Path to module file or package folder (relative to project_path) dest_folder: Destination folder path (relative to project_path)

Returns: JSON with success status and list of changed files

move_and_rename_moduleA

Move a module to a folder and optionally rename it.

This is a two-step operation:

  1. Move module to destination folder

  2. Rename the module (if new_name provided or auto-detected)

Auto-detection: If module is foo_bar.py and dest is foo/, it will automatically strip the foo_ prefix → foo/bar.py

Includes workaround for Rope bug: Files that import from BOTH the destination package AND the module being moved are temporarily hidden during the move, then their imports are fixed manually.

Example: move_and_rename_module( "views/service_contractor_extra.py", "views/service_contractor/", new_name="extra" # or None for auto-detect ) Result: views/service_contractor/extra.py

Args: project_path: Root directory of the Python project module_path: Path to module file (relative to project_path) dest_folder: Destination folder path (relative to project_path) new_name: New name for the module (without .py), or None to auto-detect

Returns: JSON with success status and list of changed files

convert_module_to_initA

Convert a module file into a package by moving it to init.py.

Transforms foo.py into foo/__init__.py. No import changes needed since the import path stays the same!

Example: views/customer_order.py becomes views/customer_order/__init__.py Import from views.customer_order import X stays unchanged.

This is the recommended way to convert a module to a package when you want to later split it into multiple files.

Args: project_path: Root directory of the Python project module_path: Path to module file (relative to project_path), e.g. "app/views/foo.py"

Returns: JSON with success status and new path

convert_module_to_packageA

Convert a module file into a package with the same name.

Transforms foo.py into foo/foo.py while updating all imports project-wide.

Example: views/service_contractor.py becomes views/service_contractor/service_contractor.py All imports like from views.service_contractor import X become from views.service_contractor.service_contractor import X

This is a two-step process using Rope:

  1. Move module to a temporary package (different name to trigger import updates)

  2. Rename the temporary package to the original module name

Args: project_path: Root directory of the Python project module_path: Path to module file (relative to project_path), e.g. "app/views/foo.py"

Returns: JSON with success status and list of changed files

rename_symbolA

Rename a symbol including all references and imports across the project.

Args: project_path: Root directory of the Python project file_path: File containing the symbol (relative to project_path) symbol_name: Current name of the symbol new_name: New name for the symbol

Returns: JSON with success status and list of changed files

extract_methodA

Extract a code region as a new method.

Args: project_path: Root directory of the Python project file_path: File path relative to project_path start_line: Start line (1-based) start_col: Start column (0-based) end_line: End line (1-based) end_col: End column (0-based) new_name: Name for the extracted method

Returns: JSON with success status and list of changed files

inline_variableA

Inline a variable at all usage sites.

Args: project_path: Root directory of the Python project file_path: File path relative to project_path variable_name: Name of the variable to inline line: Line number where variable is defined (1-based)

Returns: JSON with success status and list of changed files

close_rope_projectA

Close a Rope project and release resources.

Call this when done with refactoring to free memory.

Args: project_path: Root directory of the Python project

Returns: JSON with success status

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/krystofbe/rope-mcp-server'

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