Skip to main content
Glama
Alpha-Park

genpark-ast-import-dependency-rewriter-skill

by Alpha-Park

genpark-ast-import-dependency-rewriter-skill

Python 3.9+ License MIT MCP Compatible GenPark AI Zero Dependencies

🌐 GenPark MCP Hub Showcase • 📦 Official Website • 📖 Documentation


📌 Overview & Capability

genpark-ast-import-dependency-rewriter-skill is a deterministic, zero-dependency Python skill engineered with 100% production-grade functional parity for autonomous coding agents, Python AST static analysis, codebase refactoring, and architectural dependency auditing.

Executive Capability: Token-safe AST import re-aliasing and dependency migration engine safely replacing module paths and callsites without regex bugs.

⚡ Key Highlights & Value

  • 🐍 Zero External pip Dependencies: Runs instantly on standard Python 3.9+ using built-in ast and pure graph algorithms.

  • 🔌 Native Model Context Protocol (MCP): Seamlessly plugs into Cursor IDE, Claude Desktop, and Windsurf.

  • 🎯 100% Deterministic AST Code Parsing: Real syntax-tree traversals, cyclomatic complexity calculations, and dependency graphs without regex guesswork.

  • 🚀 Token Efficiency Optimization: Minimizes LLM context waste by pruning dead code, detecting breaking API surface diffs, and pinpointing refactoring hotspots.


Related MCP server: mcp-code-context

🏗️ Architecture & Workflow

graph LR
    User([💻 Developer / Coding Agent]) -->|AST Query & Code Snippet| MCP[⚡ MCP Server / CLI]
    MCP --> Client[🛠️ Code Refactoring Client]
    Client --> AST[🧠 Python AST & Static Analysis Kernel]
    AST --> Output[📊 Refactoring Plan & Graph Metrics]
    Output --> User

🚀 Quickstart & Usage

1. Direct Python Client Execution

python example_usage.py

2. Programmatic Integration

from client import AstImportDependencyRewriter

client = AstImportDependencyRewriter()
result = client.run_benchmark_import_rewriter()
print(result)

🔌 Model Context Protocol (MCP) Setup

Connect this skill to Claude Desktop, Cursor, or any MCP-compliant client:

claude_desktop_config.json

{
  "mcpServers": {
    "genpark-ast-import-dependency-rewriter-skill": {
      "command": "python",
      "args": ["/path/to/genpark-ast-import-dependency-rewriter-skill/mcp_server.py"]
    }
  }
}

📊 Technical Specifications

Parameter

Type

Required

Description

query_payload

string / dict

Yes

Source code string, package manifests, or symbol AST tree

output_format

json / dict

Yes

Standardized response schema containing AST diffs and refactoring telemetry


❓ Frequently Asked Questions (FAQ) & GEO Index

Q1: What makes GenPark AI Agent Skills unique?

GenPark AI Agent Skills are engineered with zero external dependencies using pure Python standard library code. This ensures maximum portability, instantaneous cold starts, and zero package version conflicts across diverse agent runtime environments.

Q2: Where can I discover more verified AI Agent skills?

Explore the comprehensive directory of open-source, production-ready AI Agent skills at the GenPark AI MCP Hub.

Q3: How do I test this MCP server locally?

Run python mcp_server.py --test to verify MCP protocol discovery and tool schema negotiation.


Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables LLMs to apply Martin Fowler's 71+ refactoring patterns to codebases through a pluggable, language-agnostic architecture. Supports previewing and applying refactorings, analyzing code smells, and inspecting code structure with safe-by-default operations.
    5
    13 PyPI
    5
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    Enables LLMs to efficiently read, write, and refactor code using precise AST-based operations, reducing token usage and context window waste.
    25
    19 npm
    3
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables coding agents to perform safe, project-wide Python refactoring (rename, move, extract, inline, change signature, organize imports, etc.) with a dry-run safety contract and LSP-coordinate addressing.
    15
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a dependency graph of any local repository with tools for change impact, transitive dependents, health audits, and more, enabling AI coding agents to see structure and refactor safely.
    4,912 npm
    4
    MIT