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¶
- Installation Issues
- Configuration Problems
- Performance Issues
- Common Errors
- Debugging Guide
- FAQ
- 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: runuv 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-mcporpipx 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
uvorpyenvto 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:
- Verify server is properly configured:
claude mcp list
- 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
- Reinstall MCP configuration:
claude mcp remove pyeye
claude mcp add pyeye -s user -- uvx pyeye-mcp
- Every pyeye tool appears twice (
mcp__plugin_pyeye_pyeye__…andmcp__pyeye__…)? pyeye is installed both as the Claude Code plugin and withclaude 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:
-
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).
-
Validate JSON syntax:
python -m json.tool .pyeye.json
Invalid Configuration¶
Problem: Configuration errors on startup.
Solution:
- Check configuration format:
{
"packages": ["../my-lib", "~/repos/utils"],
"namespaces": {
"company": ["~/repos/auth", "~/repos/api"]
}
}
- 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:
-
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.jsonorconfigure_packagesinstead. -
Set them where the server starts. The MCP client launches the server, so
env | grep PYEYEin 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:
- Use
configure_packagestool:
configure_packages(
packages=["../project1", "../project2"],
save=True # Persist configuration
)
- Check the project limit,
PYEYE_MAX_PROJECTS(default 10) - Verify paths are accessible
Namespace Package Configuration¶
Problem: Distributed packages not resolving correctly.
Solution:
- Configure namespace properly:
{
"namespaces": {
"mycompany": [
"~/repos/mycompany-auth",
"~/repos/mycompany-api",
"~/repos/mycompany-utils"
]
}
}
- Make sure the shared namespace directory (
mycompany/) in each repo has no__init__.py(PEP 420); the subpackages under it (mycompany/auth/) may. - Test resolution with
resolve("mycompany"), thenexpand(<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:
- Include only the packages and namespaces you need. There is no file-exclusion
setting:
exclude_patternsis deprecated and has no effect (#581). - Limit project scope to relevant code
High Memory Usage¶
Problem: Server consumes excessive memory.
Solution:
- 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
- Cached results expire after
PYEYE_CACHE_TTLseconds (default
300). Restart the MCP client to start the server with empty caches.
-
Lower the per-file cache caps,
PYEYE_ARTIFACT_CACHE_MAX_ENTRIES,PYEYE_SCRIPT_CACHE_MAX_ENTRIESandPYEYE_PARSO_CACHE_MAX_ENTRIES; see Environment variables. -
Monitor memory usage:
ps aux | grep pyeye
Cache Optimization¶
Problem: Stale cache causing incorrect results.
Solution:
- File watchers auto-update on changes (using watchdog)
- Force cache refresh by modifying a file
- 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:
- Watchers already ignore
.git,__pycache__, virtualenvs and other non-source directories (watch_excludeis deprecated and has no effect, #581). - 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:
- Verify path exists:
ls -la /path/to/project - Check permissions:
ls -la /path/to/project/*.py - Use absolute paths in configuration
- 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:
- Add package locations to configuration
- 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
- Check virtual environment is activated
- Verify
__init__.pyfiles exist for packages
Plugin Activation Issues¶
Problem: Framework-specific tools not appearing.
Solution:
- Plugins auto-activate based on detection:
- Django:
djangoimports (a generatedmanage.pyhas them) ordjangoin requirements - Flask:
flaskin imports or requirements - Pydantic:
pydanticin imports or requirements - Check plugin loaded in debug logs
- 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:
- Check file permissions:
ls -la /path/to/file
chmod 644 /path/to/file # If you own it
- Run server with appropriate user
- 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 --debugto 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¶
- Test each project individually
- Remove projects one by one to find problematic code
- Check for:
- Circular imports
- Syntax errors
- Very large files, such as generated code
- 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
djangoimports ordjangoin requirements; amanage.pyalone isn't enough - Flask: Needs
flaskimports or in requirements - Pydantic: Needs
pydanticimports 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:
- Configure only the packages and namespaces you need
- Lower
PYEYE_MAX_PROJECTSor thePYEYE_*_CACHE_MAX_ENTRIEScaps if memory is tight (Environment variables) - Split into multiple smaller projects
- Pass a narrower
scopeto 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¶
- ✅ Configure only the packages and namespaces you need
- ✅ Tune cache TTL based on development patterns
- ✅ Configure debounce for your file system speed
- ✅ Limit cached projects based on available RAM
- ✅ Use namespace packages for related projects
- ✅ Enable debug logging only when troubleshooting
Getting Additional Help¶
If you're still experiencing issues:
- Check existing issues: GitHub Issues
- Enable debug mode and collect logs
- Create a minimal reproduction of the problem
- Open a new issue with:
- Python version
- OS and version
- Configuration file
- Debug logs
- 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")