Skip to main content

Python Code Intelligence Engine — static analysis knowledge graph exposed via MCP for AI agents

Project description

Pyxus

Python Code Intelligence Engine

Give your AI agents a complete understanding of any Python codebase — in seconds.

CI Python 3.12+ License: MIT Code style: ruff MCP


Pyxus builds a knowledge graph of your Python codebase — every class, function, method call, import, and inheritance chain — and exposes it to AI agents via MCP. Your LLM stops guessing and starts knowing how the code connects.

100 files in ~1.2s | 70-85% call resolution without type hints | 279 tests

The Problem

AI agents read files one at a time. They grep, they guess. But they don't see how code connects — so they miss callers, break dependencies, and write incomplete refactors.

The Solution

pyxus analyze /path/to/project   # Build the graph once
pyxus serve                       # Expose it to your AI agent

Now your agent has instant answers:

You: "What breaks if I change UserService?"

Agent → context("UserService")
  Called by: auth.views.register(), signals.on_user_created(), admin.bulk_create()
  Methods: create(), update(), delete()
  Extends: BaseService
  Risk: HIGH — used in auth pipeline

Installation

git clone https://github.com/RayverAimar/pyxus.git
cd pyxus && uv sync

MCP Tools

Tool What it does
context(name) Everything about a symbol: callers, callees, imports, inheritance
impact(target) Blast radius: what depends on this and what breaks
search(query) Find symbols by name with relevance ranking
imports() Module dependency graph and circular import detection

Add to Claude Code (~/.claude/mcp_servers.json):

{
  "pyxus": {
    "command": "pyxus",
    "args": ["serve"]
  }
}

CLI

pyxus analyze <path>    # Full analysis: symbols, imports, hierarchy, calls
pyxus imports <path>    # Fast: import dependencies + circular detection
pyxus status <path>     # Index metadata
pyxus clean <path>      # Delete .pyxus/ index
pyxus serve             # Start MCP server

Import Analysis

A fast mode that maps module dependencies and catches circular imports — useful for understanding coupling and untangling dependency chains before refactoring:

pyxus imports /path/to/project
  Modules: 47
  Dependencies: 128

  Circular imports detected: 1
    config → utils → helpers → config

Know which modules are tightly coupled, which are isolated, and where the dependency cycles live — before your agent touches a single line.

What It Resolves

Pyxus tracks what objects each variable points to across function boundaries — no type hints needed:

def get_service():
    return Service()

s = get_service()   # Pyxus knows s is a Service
s.process()         # Resolves to Service.process

Constructor returns, parameter bridging, return type chains, MRO inheritance, callable attributes, super() resolution, and closure propagation — all resolved statically.

Development

uv sync                              # Install
uv run pytest -x -q                  # 279 tests, ~1.5s
uv run ruff check . && uv run ruff format .

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxus-0.1.0.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxus-0.1.0-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file pyxus-0.1.0.tar.gz.

File metadata

  • Download URL: pyxus-0.1.0.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for pyxus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 13a5c09135c4f950fde4e93595009ab769feaf6e54a21794db983617ad29f2a8
MD5 28fc51824e10bc78ed35b6a368062a1c
BLAKE2b-256 f2113d3eea18444742b82388ac1130b081fd98e6bba862d6dffd51dba8290f8d

See more details on using hashes here.

File details

Details for the file pyxus-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyxus-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for pyxus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 823853b04422699e9085c6b1520dc1452a5fc7b4c5b2229dd21290719e870dc7
MD5 6e5bfdd2f487fed756969133ead9f46c
BLAKE2b-256 cc5b333176591c2fa5aa6307a31cc487cfec0699fbbfadf730033c37d0215226

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page