Skip to content

PyEye - Troubleshooting Guide

This guide helps resolve common issues and optimize performance for the PyEye Server.

The claude mcp add examples run uvx pyeye-mcp. Use the command you registered pyeye with instead, if it's different (see the README's Installation).

Table of Contents

  1. Installation Issues
  2. Configuration Problems
  3. Performance Issues
  4. Common Errors
  5. Debugging Guide
  6. FAQ
  7. Performance Tuning

Installation Issues

Python Version Compatibility

Problem: Server fails to start with Python version errors.

Solution: pyeye needs Python >=3.11. uvx and the plugin pick a suitable Python for you. With pip or pipx, check the Python you installed into: python --version.

Import Errors When the Server Starts

Problem: The server fails with import errors or missing dependencies.

Solution: reinstall with the route you used (see the README's Installation):

  • uvx: run uv cache clean pyeye-mcp, then start the client again;
  • uv tool: uv tool install --reinstall pyeye-mcp;
  • pip or pipx: pip install --force-reinstall pyeye-mcp or pipx reinstall pyeye-mcp;
  • a pyeye source checkout: uv sync --frozen.

Platform-Specific Issues

Windows

Problem: Path separator issues or file access errors.

Solution:

  • Use forward slashes in config files: "packages": ["C:/Users/name/project"]
  • Run terminal as Administrator if permission errors occur
  • Use WSL2 for better compatibility

macOS

Problem: SSL certificate errors or system Python conflicts.

Solution:

  • Install certificates: /Applications/Python 3.x/Install Certificates.command
  • Use uv or pyenv to avoid system Python
  • Check Gatekeeper settings for unsigned binaries

Linux

Problem: Missing system dependencies.

Solution:

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install python3-dev python3-venv

# Fedora/RHEL
sudo dnf install python3-devel

MCP Server Connection Problems

Problem: Claude Code can't connect to the server.

Solution:

  1. Verify server is properly configured:
claude mcp list
  1. Check server logs. Your MCP client starts the server, so set the logging variables on the server entry, restart the client, reproduce the problem, and read the log:
claude mcp remove pyeye
claude mcp add pyeye -s user \
  -e PYEYE_LOG_LEVEL=DEBUG -e PYEYE_LOG_FILE=/tmp/pyeye.log \
  -- uvx pyeye-mcp
tail -f /tmp/pyeye.log
  1. Reinstall MCP configuration:
claude mcp remove pyeye
claude mcp add pyeye -s user -- uvx pyeye-mcp
  1. Every pyeye tool appears twice (mcp__plugin_pyeye_pyeye__… and mcp__pyeye__…)? pyeye is installed both as the Claude Code plugin and with claude mcp add. Keep one: claude mcp remove pyeye, or uninstall the plugin with /plugin.

Configuration Problems

Config File Not Found

Problem: Server doesn't load configuration.

Solution:

  1. Check the configuration locations and their precedence in the README's Configuration Methods. Environment variables carry no configuration; they only tune performance and logging (see Performance Settings).

  2. Validate JSON syntax:

python -m json.tool .pyeye.json

Invalid Configuration

Problem: Configuration errors on startup.

Solution:

  1. Check configuration format:
{
  "packages": ["../my-lib", "~/repos/utils"],
  "namespaces": {
    "company": ["~/repos/auth", "~/repos/api"]
  }
}
  1. Use absolute paths, ~/ paths, or paths relative to the project directory (pyeye expands ~ and resolves relative entries against the project root).

Environment Variable Issues

Problem: Environment variables seem to have no effect.

Solution:

  1. Check the name. Only the variables in the README's Performance Settings table exist. Packages and namespaces can't be set through the environment; use .pyeye.json or configure_packages instead.

  2. Set them where the server starts. The MCP client launches the server, so env | grep PYEYE in your shell doesn't show what the server sees. Put them on the client's server entry and restart the client:

claude mcp remove pyeye
claude mcp add pyeye -s user -e PYEYE_MAX_PROJECTS=20 -- uvx pyeye-mcp

Multi-Project Setup Problems

Problem: Can't analyze multiple projects simultaneously.

Solution:

  1. Use configure_packages tool:
configure_packages(
    packages=["../project1", "../project2"],
    save=True  # Persist configuration
)
  1. Check the project limit, PYEYE_MAX_PROJECTS (default 10)
  2. Verify paths are accessible

Namespace Package Configuration

Problem: Distributed packages not resolving correctly.

Solution:

  1. Configure namespace properly:
{
  "namespaces": {
    "mycompany": [
      "~/repos/mycompany-auth",
      "~/repos/mycompany-api",
      "~/repos/mycompany-utils"
    ]
  }
}
  1. Make sure the shared namespace directory (mycompany/) in each repo has no __init__.py (PEP 420); the subpackages under it (mycompany/auth/) may.
  2. Test resolution with resolve("mycompany"), then expand(<handle>, edge="submodules") to list the subpackages contributed by each repo

Performance Issues

Slow Analysis on Large Codebases

Problem: Analysis takes too long or times out.

Solution:

  1. Include only the packages and namespaces you need. There is no file-exclusion setting: exclude_patterns is deprecated and has no effect (#581).
  2. Limit project scope to relevant code

High Memory Usage

Problem: Server consumes excessive memory.

Solution:

  1. Reduce cached projects, PYEYE_MAX_PROJECTS (default 10):
claude mcp remove pyeye
claude mcp add pyeye -s user -e PYEYE_MAX_PROJECTS=5 -- uvx pyeye-mcp
  1. Cached results expire after PYEYE_CACHE_TTL seconds (default

300). Restart the MCP client to start the server with empty caches.

  1. Lower the per-file cache caps, PYEYE_ARTIFACT_CACHE_MAX_ENTRIES, PYEYE_SCRIPT_CACHE_MAX_ENTRIES and PYEYE_PARSO_CACHE_MAX_ENTRIES; see Environment variables.

  2. Monitor memory usage:

ps aux | grep pyeye

Cache Optimization

Problem: Stale cache causing incorrect results.

Solution:

  1. File watchers auto-update on changes (using watchdog)
  2. Force cache refresh by modifying a file
  3. Restart the MCP client to start the server with empty caches, or lower PYEYE_CACHE_TTL (seconds, default 300).

File Watcher Performance

Problem: Too many file change events slow down server.

Solution:

  1. Watchers already ignore .git, __pycache__, virtualenvs and other non-source directories (watch_exclude is deprecated and has no effect, #581).
  2. Increase debounce time (default: 0.5 s):
claude mcp remove pyeye
claude mcp add pyeye -s user -e PYEYE_WATCHER_DEBOUNCE=2 -- uvx pyeye-mcp

Common Errors

"Project not found" Errors

Problem: Project not found: /path/to/project

Solution:

  1. Verify path exists: ls -la /path/to/project
  2. Check permissions: ls -la /path/to/project/*.py
  3. Use absolute paths in configuration
  4. Ensure Python files exist in the project

Import Resolution Failures

Problem: an import doesn't resolve (for example, it appears under unresolved_imports in trace(..., follow=["imports"])).

Solution:

  1. Add package locations to configuration
  2. Or put the directory on the server's PYTHONPATH, which pyeye's analysis reads. Like every server variable, it goes on the client's server entry:
claude mcp remove pyeye
claude mcp add pyeye -s user -e PYTHONPATH=/path/to/lib -- uvx pyeye-mcp
  1. Check virtual environment is activated
  2. Verify __init__.py files exist for packages

Plugin Activation Issues

Problem: Framework-specific tools not appearing.

Solution:

  1. Plugins auto-activate based on detection:
  2. Django: django imports (a generated manage.py has them) or django in requirements
  3. Flask: flask in imports or requirements
  4. Pydantic: pydantic in imports or requirements
  5. Check plugin loaded in debug logs
  6. Manually verify framework detection:
# In project root
grep -l "django" *.py requirements.txt  # For Django
grep -r "from flask" . # For Flask

File Access Permissions

Problem: PermissionError: [Errno 13] Permission denied

Solution:

  1. Check file permissions:
ls -la /path/to/file
chmod 644 /path/to/file  # If you own it
  1. Run server with appropriate user
  2. Avoid analyzing system directories

Debugging Guide

Enable Debug Logging

pyeye reads two logging variables: PYEYE_LOG_LEVEL (DEBUG, INFO, WARNING, ERROR; default INFO) and PYEYE_LOG_FILE (append logs to this file; otherwise they go to stderr only).

Step 1: The MCP client starts the server, so set the variables on its server entry (Claude Code shown; other clients take an env map in their config):

claude mcp remove pyeye
claude mcp add pyeye -s user \
  -e PYEYE_LOG_LEVEL=DEBUG -e PYEYE_LOG_FILE=/tmp/pyeye.log \
  -- uvx pyeye-mcp

Step 2: Restart the client and reproduce the problem.

Step 3: Read /tmp/pyeye.log for detailed information about:

  • Project loading
  • Cache hits/misses
  • Analysis operations
  • Plugin activation
  • File watcher events

Check Server Logs

Log locations:

  • The file named by PYEYE_LOG_FILE, if set. Every process appends to it, and each line carries the PID, so several servers can share one file.
  • Otherwise stderr, which your MCP client captures (for Claude Code, run claude --debug to see MCP server output).

Each line looks like this:

2026-11-07 14:02:11 [PID 4242] pyeye.project_manager INFO: <message>

Filter by [PID n] when several servers write to the same file. Look for WARNING and ERROR lines first.

Verify Jedi Installation

Test Jedi directly:

import jedi

# Test basic completion
script = jedi.Script("import os\nos.")
completions = script.complete(2, 3)
print([c.name for c in completions])  # Should show os methods

# Test project analysis
project = jedi.Project("/path/to/your/project")
print(project.path)

Test with Minimal Config

Create minimal test configuration:

{
  "packages": ["/path/to/single/package"]
}

Test basic operations:

# Using MCP tools
resolve("TestClass", project_path="/path/to/project")

Isolate Problem Projects

  1. Test each project individually
  2. Remove projects one by one to find problematic code
  3. Check for:
  4. Circular imports
  5. Syntax errors
  6. Very large files, such as generated code
  7. Binary files mistaken for Python

Frequently Asked Questions (FAQ)

How to analyze multiple projects?

Answer: Use the configuration system to add multiple projects:

{
  "packages": [
    "../project1",
    "../project2",
    "~/repos/shared-lib"
  ]
}

Or use the configure_packages tool to add them dynamically.

Why isn't my plugin activating?

Answer: Plugins activate automatically based on framework detection:

  • Django: Needs django imports or django in requirements; a manage.py alone isn't enough
  • Flask: Needs flask imports or in requirements
  • Pydantic: Needs pydantic imports or in requirements

Check debug logs to see detection results.

How to exclude certain files?

Answer: You can't yet. pyeye analyses every .py file in the configured packages, namespaces and standalone directories. The exclude_patterns and exclude keys are deprecated and have no effect: pyeye never read them, and it logs a warning when they are set (#581).

Can I use with monorepos?

Answer: Yes! Monorepos work well with namespace configuration:

{
  "namespaces": {
    "monorepo": [
      "./packages/auth",
      "./packages/api",
      "./packages/shared"
    ]
  }
}

How to handle large codebases?

Answer:

  1. Configure only the packages and namespaces you need
  2. Lower PYEYE_MAX_PROJECTS or the PYEYE_*_CACHE_MAX_ENTRIES caps if memory is tight (Environment variables)
  3. Split into multiple smaller projects
  4. Pass a narrower scope to plugin tools

Memory usage expectations

Answer: Memory grows with the number of cached projects (PYEYE_MAX_PROJECTS) and with the cache entry caps (PYEYE_*_CACHE_MAX_ENTRIES). Measure your own usage with ps, as High Memory Usage shows.

Supported Python versions

Answer:

  • Server requires: Python 3.11+
  • Analyzed code: the Python 3 versions Jedi's parser (parso) has grammars for; Python 2-only syntax isn't supported

Framework detection logic

Answer: Each plugin looks for framework imports in Python files, framework entry points (Flask's app.py), and requirement files (requirements.txt, Pipfile, and for Flask and Pydantic pyproject.toml), in the project root and every configured package and namespace path. Detection runs at server startup and again after configure_packages changes the layout.


Performance Tuning

Optimal Cache Settings

Default settings: PYEYE_CACHE_TTL is

300 seconds, PYEYE_MAX_PROJECTS is

10 and PYEYE_WATCHER_DEBOUNCE is

0.5 seconds; see Environment variables for every setting.

Set these on the MCP client's server entry, not with a shell export; see the README's Performance Settings. With Claude Code, remove the entry (claude mcp remove pyeye) and add it again with an -e for each variable, as below; other clients take the same variables in their config's env map. Restart the client afterwards.

For large codebases (a 10-minute cache, fewer but larger projects, less file-watch overhead):

claude mcp add pyeye -s user \
  -e PYEYE_CACHE_TTL=600 -e PYEYE_MAX_PROJECTS=5 -e PYEYE_WATCHER_DEBOUNCE=2.0 \
  -- uvx pyeye-mcp

For rapid development (a 1-minute cache, faster updates):

claude mcp add pyeye -s user \
  -e PYEYE_CACHE_TTL=60 -e PYEYE_WATCHER_DEBOUNCE=0.2 \
  -- uvx pyeye-mcp

Debounce Settings

Control how quickly the server responds to file changes. The default is

0.5 seconds.

For slower systems or network drives, raise it; for local SSDs with small projects, lower it. On the client's server entry:

claude mcp add pyeye -s user -e PYEYE_WATCHER_DEBOUNCE=3.0 -- uvx pyeye-mcp  # slower systems
claude mcp add pyeye -s user -e PYEYE_WATCHER_DEBOUNCE=0.2 -- uvx pyeye-mcp  # local SSDs

Project Limit Tuning

Balance memory usage vs cache effectiveness:

# Small memory system (<8GB RAM)
PYEYE_MAX_PROJECTS=3
PYEYE_ARTIFACT_CACHE_MAX_ENTRIES=500

# Standard system (16GB RAM)
PYEYE_MAX_PROJECTS=10  # Default

# High memory system (32GB+ RAM)
PYEYE_MAX_PROJECTS=20

Optimization Checklist

  1. ✅ Configure only the packages and namespaces you need
  2. ✅ Tune cache TTL based on development patterns
  3. ✅ Configure debounce for your file system speed
  4. ✅ Limit cached projects based on available RAM
  5. ✅ Use namespace packages for related projects
  6. ✅ Enable debug logging only when troubleshooting

Getting Additional Help

If you're still experiencing issues:

  1. Check existing issues: GitHub Issues
  2. Enable debug mode and collect logs
  3. Create a minimal reproduction of the problem
  4. Open a new issue with:
  5. Python version
  6. OS and version
  7. Configuration file
  8. Debug logs
  9. Steps to reproduce

Quick Diagnostics Script

Save and run this script to collect diagnostic information:

#!/usr/bin/env python3
"""Diagnostic script for PyEye"""

import sys
import os
import json
import subprocess
from pathlib import Path

print("PyEye - Diagnostics")
print("=" * 50)

# Python version
print(f"Python version: {sys.version}")

# Check required packages
packages = ["jedi", "parso", "mcp", "watchdog", "aiofiles", "filelock", "psutil"]
for pkg in packages:
    try:
        module = __import__(pkg)
        version = getattr(module, "__version__", "unknown")
        print(f"✅ {pkg}: {version}")
    except ImportError:
        print(f"❌ {pkg}: not installed")

# Check configuration
config_locations = [
    Path.cwd() / ".pyeye.json",
    Path.home() / ".config/pyeye/config.json",
]

print("\nConfiguration files:")
for config_path in config_locations:
    if config_path.exists():
        print(f"✅ Found: {config_path}")
        try:
            with open(config_path) as f:
                json.load(f)
            print("  Valid JSON")
        except json.JSONDecodeError as e:
            print(f"  ❌ Invalid JSON: {e}")
    else:
        print(f"  Not found: {config_path}")

# Environment variables
print("\nEnvironment variables:")
for key, value in os.environ.items():
    if key.startswith("PYEYE"):
        print(f"  {key}={value}")

# MCP server status
print("\nMCP server status:")
try:
    result = subprocess.run(
        ["claude", "mcp", "list"],
        capture_output=True,
        text=True,
        timeout=5
    )
    if "pyeye" in result.stdout:
        print("✅ Server configured in Claude Code")
    else:
        print("❌ Server not found in Claude Code")
except Exception as e:
    print(f"❌ Could not check MCP status: {e}")

print("\n" + "=" * 50)
print("Include this output when reporting issues")