AI-Powered Python Function Analysis and Control
Gnosis Mystic gives AI assistants direct access to your Python functions through runtime hijacking and intelligent analysis. Add minimal decorators, and Claude can inspect, optimize, and control your code in real-time.
Mystic was inspired by Giantswarm's mcp-debug.
Code by fairly stock Claude Code. Prompts, code sketches, and planning by Claude Desktop using Gnosis Evolve tools.
AI assistants are blind to your running code:
- They can't see function performance in real-time
- No direct access to runtime behavior and state
- Can't dynamically test optimizations
- Limited to static code analysis
- No way to experiment with function modifications safely
Gnosis Mystic creates a direct AI-to-code interface:
- AI sees everything: Real-time function calls, performance, and behavior
- Safe experimentation: Test caching, mocking, and optimizations instantly
- Runtime control: AI can modify function behavior without code changes
- Intelligent analysis: AI discovers bottlenecks and suggests improvements
- Live debugging: AI can inspect function state during execution
- Runtime Strategies: AI can apply caching, mocking, blocking without restarts
- A/B Testing: Compare function implementations in real-time
- Environment Adaptation: Different behaviors for dev/test/prod
- Performance Experiments: Test optimizations safely
-
Initialize your project:
cd /your/project mystic init -
Start the server:
-
Add to Claude Desktop config:
{ "mcpServers": { "gnosis-mystic": { "command": "python", "args": [ "C:\\path\\to\\gnosis-mystic\\mystic_mcp_standalone.py", "--project-root", "C:\\your\\project" ] } } } -
AI-Powered Development:
- "Find my slowest functions" - Claude analyzes performance data
- "Add caching to expensive calls" - Claude applies optimizations
- "Check for security issues" - Claude scans for vulnerabilities
- "Show me error patterns" - Claude analyzes failure modes
- "Optimize this function" - Claude experiments with improvements
Once integrated, Claude can:
- Automatically find all decorated functions
- Analyze call patterns and performance
- Identify bottlenecks and optimization opportunities
- Generate performance reports
- Apply caching strategies dynamically
- Test different implementations
- A/B test performance improvements
- Rollback changes instantly
- Detect sensitive data exposure
- Track function call flows
- Identify error patterns
- Debug production issues safely
- Suggest function improvements
- Recommend architectural changes
- Predict performance impacts
- Generate optimization plans
- Function Hijacking: Runtime interception with multiple strategies
- AI Integration: Claude can discover and control functions via MCP
- Performance Tracking: Real-time metrics with minimal overhead
- Security Analysis: Automatic sensitive data detection
- CLI Tools: Function discovery and server management
- Enhanced AI analysis capabilities
- Web dashboard for monitoring
- IDE extensions for VS Code/Cursor
- Distributed debugging support
Gnosis Mystic creates a bridge between your code and AI:
- Minimal Decoration: Add simple decorators to functions you want monitored
- Runtime Interception: Captures all function calls and behavior
- AI Communication: Streams data to AI assistants via MCP protocol
- Dynamic Control: AI can modify function behavior in real-time
- Safe Experimentation: Test changes without affecting core logic
- Performance Profiling: AI identifies slow functions automatically
- Error Analysis: AI patterns in failures and suggests fixes
- Code Quality: AI reviews function behavior and suggests improvements
- Real-time Optimization: AI applies performance improvements live
- Security Monitoring: AI detects suspicious patterns or data leaks
- Capacity Planning: AI predicts scaling needs from usage patterns
- Intelligent Mocking: AI creates realistic test data
- Behavior Verification: AI ensures functions work as expected
- Regression Detection: AI spots when function behavior changes
We welcome contributions! See CONTRIBUTING.md for guidelines.
Apache 2.0 License - see LICENSE for details.
- gnosis-evolve: Original function hijacking foundation
- mcp-debug: MCP debugging reference implementation (inspiration)
- Claude Desktop: Primary AI assistant integration target
The future of Python development: Your code, enhanced by AI. 🔮✨
Imagine Claude knowing exactly how your functions behave, optimizing them in real-time, and debugging issues before you even notice them. That's Gnosis Mystic.