Skip to content

Contributing to PyEye Server

First off, thank you for considering contributing to PyEye Server! It's people like you that make this tool better for everyone.

This document provides guidelines for contributing to the project. Most of it is guidance, so use your best judgment. The contribution policy below is the exception: it is a rule.

Contribution Policy

We welcome bug reports, ideas and fixes, but we don't accept unsolicited pull requests.

  1. Start with an issue. Open a new issue, or comment on an existing one, to say what you'd like to work on.
  2. Wait to be assigned. A maintainer will reply and, if the work fits the project, assign the issue to you.
  3. Then open your pull request, linked to that issue with Fixes #<issue-number>.

Pull requests that aren't linked to an issue assigned to their author may be closed without review. This isn't a judgement on the work: it keeps review time for changes we've agreed on together, and makes sure nobody spends effort on something we can't merge.

Table of Contents

Code of Conduct

Everyone participating in this project is expected to be respectful and constructive. Please report unacceptable behavior to the project maintainers.

How Can I Contribute?

Reporting Bugs

Before creating bug reports, please check existing issues as you might find that you don't need to create one. Then open a new issue with the Bug report form, which asks for what we need to reproduce the bug: your pyeye version, the tool call and what it returned. Please include as many details as possible.

Great Bug Reports tend to have:

  • A quick summary and/or background
  • Steps to reproduce
  • Be specific!
  • Give sample code if you can
  • What you expected would happen
  • What actually happens
  • Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

Suggesting Enhancements

Enhancement suggestions are tracked as GitHub issues: open one with the Feature request form. Please include:

  • Use case - Explain why this enhancement would be useful
  • Proposed solution - Describe how you envision it working
  • Alternatives considered - What other solutions did you consider?
  • Additional context - Add any other context or screenshots

Your First Code Contribution

Unsure where to begin contributing? You can start by looking through these issues:

These labels mark issues that are open for help, not work that is pre-approved. Comment on the issue and wait to be assigned before you start (see the contribution policy).

Pull Requests

The process described here has several goals:

  • Maintain the project's quality
  • Fix problems that are important to users
  • Engage the community in working toward the best possible product
  • Enable a sustainable system for maintainers to review contributions

Please follow these steps for your contribution:

  1. Create an issue first and get it assigned - Before starting work, create or find an issue describing what you plan to do, and wait for a maintainer to assign it to you (see the contribution policy)
  2. Fork the repository and create your branch from main
  3. Make your changes - See Development Process below
  4. Add tests - If you've added code, add tests
  5. Ensure tests pass - Run the full test suite
  6. Update documentation - If you've changed APIs, update the relevant documentation
  7. Add a changelog fragment - For a user-facing change, add a fragment instead of editing CHANGELOG.md: changes/README.md explains how.
  8. Record a design decision, if you made one - A contract-significant decision gets its own entry: docs/decisions/DECISIONS.md explains the format and the tooling.
  9. Submit the pull request - Link it to your assigned issue using "Fixes #issue-number"
  10. Address review feedback - Maintainers will review your PR and may request changes

Development Process

Setting Up Your Environment

Prerequisites

  • Python >=3.11
  • uv package manager
  • Git

Quick Start

  1. Fork and clone the repository:
git clone git@github.com:your-username/pyeye-mcp.git
cd pyeye-mcp
  1. Install dependencies (creates a uv-managed .venv; dev is uv's default group):
uv sync --frozen
  1. Install pre-commit and its hooks. pre-commit isn't in the project's dependencies, so install it once for your user (for example with uv tool install pre-commit or pipx install pre-commit), then:
pre-commit install

This installs every hook type the project configures (pre-commit, commit-msg, post-commit, post-merge, and post-checkout). The post-merge/post-checkout hooks keep the local setuptools_scm version file fresh after a pull or branch switch and start a dogfooding metrics session when you check out an issue branch. If you cloned before these hook types were added, re-run pre-commit install to pick them up. If you have a hand-written .git/hooks/post-checkout from an older setup, remove it (and any .git/hooks/post-checkout.legacy pre-commit leaves behind) so the metrics session does not start twice.

  1. To run your checkout in Claude Code, see Running your checkout in Claude Code.

Running your checkout in Claude Code

Every Claude Code session in this repository, in the main checkout or in a worktree, runs that checkout's own pyeye server and skills. There's nothing to pass on the command line:

  • The server comes from the repository's .mcp.json. It runs uv run --project "$CLAUDE_PROJECT_DIR" --frozen python -m pyeye.mcp, so it uses the checkout's .venv (created on first start if missing) and imports the checkout's src/.
  • The skills shipped with the plugin (python-explore, architecture-review, duplication-review, decision-log) live in .claude/skills/, so here they are project skills, without the pyeye: prefix. The repository-internal skills (docs-review, pyeye-scenarios, pyeye-verify) sit beside them, but .claude-plugin/plugin.json lists only the four, so the others never ship.
  • The installed plugin is off here. .claude/settings.json sets "enabledPlugins": {"pyeye@pyeye-marketplace": false} and enables the .mcp.json server, so you don't get a second copy of every tool and skill. The installed plugin stays on in your other projects.

After editing server code, reconnect the server from /mcp or start a new session. Skill edits apply in the running session: Claude Code watches .claude/skills/.

Testing the plugin as shipped. Clone the branch somewhere outside the repository and run Claude Code from a different directory, pointing --plugin-dir at the clone:

git clone -b <branch> https://github.com/okeefeco/pyeye-mcp.git /tmp/pyeye-plugin
cd /path/to/another/python/project
claude --plugin-dir /tmp/pyeye-plugin

That loads the plugin exactly as users get it: plugin.json's server, its four skills (as pyeye:…) and its setup hook, with its environment in the plugin's data directory, one per plugin directory. claude plugin validate /tmp/pyeye-plugin and claude --plugin-dir /tmp/pyeye-plugin plugin details pyeye check its manifest and inventory. Don't use --plugin-dir inside this repository: its .mcp.json server and project skills load as well, so every tool and skill appears twice.

Remote sessions (Remote Control, claude.ai/code) on this repository pick up the same settings, but only when they start: after pulling a change to .mcp.json, .claude/settings.json or the skills, restart the session.

Dependency lockfile policy

uv.lock is authoritative: pre-commit hooks, CI, local dev and release install the exact locked dependency set, and none of them re-resolves it. (CI's wheel check installs the built wheel into a scratch environment with uv pip install, which resolves the wheel's own dependencies; that environment is only imported from, never tested.) Resolution of the project's set happens in exactly one place: a deliberate uv lock / uv add, committed and reviewed.

  • Hooks pin uv run --frozen (use the lock as-is; never block, never rewrite it).
  • Local setup uses uv sync --frozen (install exactly what uv.lock says; never re-resolve). Run uv lock --check if you want the drift check locally — CI enforces it either way.
  • CI pins uv sync --locked (assert uv.lock equals pyproject.toml and fail on drift). A per-step flag, not a UV_LOCKED env var — UV_LOCKED is mutually exclusive with the hooks' --frozen, and CI's pre-commit job runs those hooks.
  • Changing dependencies is the only sanctioned re-resolution: edit pyproject.toml, run uv lock (or uv add), and commit the updated uv.lock in the same change.

If CI fails with "the lockfile needs to be updated, but --locked was provided," you changed pyproject.toml without re-locking — run uv lock and commit the result.

Making Changes

  1. Create a feature branch:
# Use descriptive branch names with issue numbers
git checkout -b feat/42-add-fastapi-plugin
git checkout -b fix/43-cache-memory-leak
git checkout -b docs/44-update-readme
  1. Write your code:
  2. Follow the existing code style
  3. Add docstrings to new functions/classes
  4. Use type hints
  5. Keep changes focused and atomic

  6. Write tests:

  7. All new features must have tests
  8. Bug fixes should include regression tests

  9. Commit your changes:

# Use conventional commit format
git commit -m "feat(plugins): add FastAPI plugin support"
git commit -m "fix(cache): resolve memory leak in file watcher"
git commit -m "docs: update installation instructions"

Running Tests

Run the test suite before submitting:

# Run all tests with coverage
uv run pytest --cov=src/pyeye --cov-report=term-missing

# Run specific test file
uv run pytest tests/test_specific.py

# Run with verbose output
uv run pytest -v

For comprehensive testing guidelines, including performance testing and cross-platform considerations, see the testing strategy.

To call tools by hand in a browser (optional; needs Node.js), start the MCP Inspector on the server:

npx @modelcontextprotocol/inspector uv run --frozen python -m pyeye.mcp

Tests are the main way tools are checked: they call them in-process with mcp.call_tool(...).

Code Style

Pre-commit hooks format your code and run the linters, type checker and security checks; .pre-commit-config.yaml lists them. To run them all manually:

pre-commit run --all-files

Python Style Guidelines

  • Follow PEP 8
  • Use descriptive variable names
  • Write docstrings for all public functions/classes
  • Use type hints wherever possible
  • Keep functions small and focused

Project Structure

The code lives in src/pyeye/. The architecture pages describe how its parts fit together: resolution, caching and the plugin system. To see the current layout, connect pyeye to your MCP client, open its own checkout, and outline the pyeye package.

Community

Getting Help

  • GitHub Issues - For bug reports, feature requests and questions
  • Documentation - Read the docs site, built from the docs folder

Communication Guidelines

  • Be respectful and considerate
  • Be patient - maintainers are volunteers
  • Search existing issues before creating new ones
  • Provide context and be specific in questions
  • Celebrate contributions of all sizes

Recognition

We value all contributions! Contributors are recognized in several ways:

  • Your name in the commit history
  • Mention in release notes for significant contributions

License

By contributing, you agree that your contributions will be licensed under the same MIT License that covers the project.

Questions?

Feel free to open an issue with your question or reach out to the maintainers. We're here to help!


Thank you again for your interest in contributing to PyEye Server! 🎉