The repository or configuration that created this release differ from a previous release. View details.
OpenTrace
Index any codebase into a knowledge graph — then query it with AI via MCP.
OpenTrace parses source code with tree-sitter, extracts classes, functions, imports, and call relationships, and stores the result in an embedded graph database. The graph is queryable through a built-in MCP server, so tools like Claude Code can search, traverse, and understand your codebase structure.
Install
pip install opentraceai
Or run directly with uv:
uvx opentraceai index .
Requires Python 3.12+.
Quick Start
1. Index a codebase
opentraceai index /path/to/repo
This parses every supported file, extracts symbols and relationships, and writes the graph to .opentrace/index.db.
$ opentraceai index ~/projects/myapp
Opening database at .opentrace/index.db ...
Indexing /home/user/projects/myapp ...
1284 nodes, 3421 relationships, 187 files, 95 classes, 412 functions
Done in 4.2s.
2. Query via MCP
Start a stdio MCP server against the indexed database:
opentraceai mcp
The database is auto-discovered by walking up from the current directory to the git root, looking for .opentrace/index.db. You can override with --db <path>.
Claude Code
Add OpenTrace to Claude Code as a plugin, or configure it manually in your project's .mcp.json:
{
"mcpServers": {
"opentrace": {
"type": "stdio",
"command": "uvx",
"args": ["opentraceai", "mcp"]
}
}
}
MCP Tools
| Tool | Description |
|---|---|
search_graph |
Full-text search across nodes by name or properties |
list_nodes |
List nodes by type (Class, Function, File, etc.) |
get_node |
Get a node's full details and immediate neighbors |
traverse_graph |
Walk relationships from a node (outgoing, incoming, or both) |
get_stats |
Graph statistics — node/edge counts broken down by type |
Supported Languages
| Full extraction (symbols + calls + imports) | Structural extraction (symbols only) |
|---|---|
| Python, TypeScript/JavaScript, Go | Rust, Java, Kotlin, C#, C/C++, Ruby, Swift |
Config and data files (JSON, YAML, TOML, Protobuf, SQL, GraphQL, Bash) are indexed as file nodes.
CLI Reference
opentraceai index [PATH]
Index a local codebase into a LadybugDB knowledge graph.
| Option | Default | Description |
|---|---|---|
PATH |
. |
Directory to index |
--db |
.opentrace/index.db |
Database path |
--repo-id |
directory name | Repository identifier |
--batch-size |
200 |
Items per write batch |
-v, --verbose |
off | Debug logging |
opentraceai mcp
Start a stdio MCP server exposing graph query tools.
| Option | Default | Description |
|---|---|---|
--db |
auto-discovered | Database path |
-v, --verbose |
off | Debug logging |
opentraceai stats
Display graph statistics (node/edge counts by type).
| Option | Default | Description |
|---|---|---|
--db |
auto-discovered | Database path |
--output |
text |
Output format (text or json) |
opentraceai serve
Start an HTTP server exposing the graph database as a REST API.
| Option | Default | Description |
|---|---|---|
--db |
auto-discovered | Database path |
--host |
127.0.0.1 |
Bind address |
--port |
8787 |
Bind port |
-v, --verbose |
off | Debug logging |
opentraceai query QUERY_STRING
Run a Cypher or full-text search query against the graph database.
| Option | Default | Description |
|---|---|---|
--db |
auto-discovered | Database path |
-t, --type |
cypher |
Query language (cypher or fts) |
--limit |
100 |
Max rows (FTS only) |
--output |
table |
Output format (table, json, or jsonl) |
opentraceai export [OUTPUT]
Export the graph database as a .parquet.zip archive.
opentraceai import ARCHIVE
Import a .parquet.zip archive into the graph database.
opentraceai impact FILE_PATH
Analyze the blast radius of changes to a file.
opentraceai config
Read or write project configuration (.opentrace/config.yaml). Subcommands: set, get, show, path.
opentraceai login / logout / whoami / refresh
Authenticate with api.opentrace.ai.
Development
uv sync # Install dependencies
uv run pytest # Run tests
uv run ruff check src/ tests/ # Lint
uv run ruff format src/ tests/ # Format
Part of OpenTrace
This package is the CLI/MCP component of OpenTrace, an open-source platform for mapping system architecture into knowledge graphs. The full project also includes a browser-based graph explorer at app.opentrace.ai.
License
Apache License 2.0
Metadata
Release files for opentraceai 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Change of provenance
The repository or configuration that created these release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opentraceai-0.4.0.tar.gz | 311.0 kB | With provenance | Details for opentraceai-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opentraceai-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for opentraceai-0.4.0-py3-none-any.whl |
Total release size: 476.1 kB
Release files / opentraceai-0.4.0.tar.gz
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | opentraceai-0.4.0.tar.gz |
|---|---|
| Size | 311.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc4125537deedf61110c382a260cf5b47a3ca7e263ce9eb86cda7db89b74a93c
|
|
BLAKE2b-256 checksum How to use checksums |
702fe25fd753ba086f6a89cfcf623508893d04793b70e6fd80e3c26e7e2dc104
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2026.
Transparency logRelease files / opentraceai-0.4.0-py3-none-any.whl
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | opentraceai-0.4.0-py3-none-any.whl |
|---|---|
| Size | 165.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe6ddc8e83d0e7e11b500a77a0afc318f679a93eda8fca5998c6fcfe300b332f
|
|
BLAKE2b-256 checksum How to use checksums |
464791180333f6a3f8767878dd69d1e1d8167657baacf3965b39ec37d670cb27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2026.
Transparency logSecurity for opentraceai 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Change of provenance
The configuration that created this release differs from a previous release.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Attestation for opentraceai-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.