MCPcopy
hub / github.com/opentrace/opentrace

github.com/opentrace/opentrace @main sqlite

repository ↗ · DeepWiki ↗
4,171 symbols 12,460 edges 490 files 1,036 documented · 25%
README

OpenTrace

Deploy PyPI - Version NPM Version License

A knowledge graph that maps your codebase structure, service architecture, and system relationships — then exposes it all through MCP so AI tools can understand your systems.

Index any repo, any size, in seconds. Build a knowledge graph and watch your LLM fetch true codebase context in realtime.

What It Does

OpenTrace indexes source code and builds a queryable knowledge graph. Point it at a repo and it will:

  1. Parse every file using tree-sitter WASM grammars (12 languages)
  2. Extract classes, functions, imports, and call relationships
  3. Build a knowledge graph stored in LadybugDB (embedded graph database)
  4. Summarize every node using template-based identifier analysis
  5. Expose the graph via MCP tools to any compatible AI client

Get Started

Linux/MacOS

uvx opentraceai index .   # Index a local project for use with MCP etc

Claude Plugin

/plugin marketplace add https://github.com/opentrace/opentrace
/plugin install opentrace-oss@opentrace-oss
/reload-plugins

More info: https://opentrace.github.io/opentrace/getting-started/install-plugin/

OpenCode Plugin

Add to ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@opentrace/opencode"]
}

More info: https://opentrace.github.io/opentrace/getting-started/install-opencode/

Gemini CLI

gemini mcp add opentraceai uvx opentraceai mcp

Run Completely in the Browser

No install: app.opentrace.ai

Run UI Locally

git clone https://github.com/opentrace/opentrace.git && cd opentrace
make install && make ui  # Runs on http://localhost:5173/

More Information

Full documentation: opentrace.github.io/opentrace — install guides, architecture, and reference.

Prerequisites: plugins and CLI need uv; OpenCode plugin runs in Bun (provided by OpenCode itself). Source build also needs Node 22+ and Python 3.12+. See Troubleshooting if anything fails.

Claude Code Plugin

The plugin gives Claude Code 5 agents, 4 slash commands, and MCP graph tools.

Agent Description
@opentrace Default catch-all — any codebase question routed to the knowledge graph
@code-explorer Explore indexed code structure — find classes, functions, files, and relationships
@dependency-analyzer Analyze dependencies and blast radius for code changes
@find-usages Find all callers, references, and usages of a component
@explain-service Top-down walkthrough of how a service or module works
Command Description
/index Index (or re-index) the current project into the knowledge graph
/graph-status Show overview of indexed nodes by type
/explore <name> Quick exploration of a named component in the graph
/interrogate Answer a question about the codebase without making changes

Full details: Claude Code Plugin reference.

OpenCode Plugin

The plugin gives OpenCode 9 native tools and three hooks (system-prompt, tool-execute, auth) — calls the opentraceai CLI directly rather than going through MCP.

Tool Description
opentrace_source_search Symbol-level search across indexed code
opentrace_semantic_search Embedding-based search over node descriptions
opentrace_source_read Read source for a graph node by ID
opentrace_source_grep Grep across indexed source content
opentrace_repo_index Index a local path or remote git URL into the graph
opentrace_find_usages Find all callers and references of a component
opentrace_impact_analysis Blast radius analysis for a proposed change
opentrace_graph_explore BFS traversal with direction and depth controls
opentrace_graph_stats Node and edge counts by type

Full details: OpenCode Plugin reference.

Supported Languages

Full extraction (symbols + calls + imports): Python, TypeScript/JavaScript, Go Structural extraction (symbols only): Rust, Java, Kotlin, C#, C/C++, Ruby, Swift Indexed as file nodes: JSON, YAML, TOML, Protobuf, SQL, GraphQL, Bash

Full language matrix: Supported Languages.

Architecture

┌───────────────────────────────────────────────────────────┐
│                      UI (React/TS)                        │
│            Browser-based indexer + graph explorer         │
│               localhost:5173 / app.opentrace.ai           │
│                                                           │
│  ┌───────────────┐  ┌─────────────────┐  ┌──────────────┐ │
│  │  Web Worker   │  │  LadybugDB WASM │  │  Chat Agent  │ │
│  │  tree-sitter  │  │  (embedded      │  │  LLM-powered │ │
│  │  WASM parsers │  │   graph store)  │  │  graph tools │ │
│  └───────────────┘  └─────────────────┘  └──────────────┘ │
└───────────────────────────────────────────────────────────┘

┌───────────────────────────────────────────────────────────┐
│                 Claude Code Plugin (MCP)                  │
│     Python agent exposes graph tools via MCP protocol     │
│         uvx opentraceai mcp  →  stdio transport           │
└───────────────────────────────────────────────────────────┘

┌───────────────────────────────────────────────────────────┐
│                  OpenCode Plugin (native)                 │
│      TS plugin in OpenCode's Bun runtime — 9 tools +      │
│         system-prompt, tool-execute, auth hooks           │
│           opentraceai CLI  →  spawn (no MCP)              │
└───────────────────────────────────────────────────────────┘

See Architecture Overview for details.

Repository Structure

ui/                   — React/TypeScript frontend (graph explorer + browser indexer)
agent/                — Python agent (CLI + MCP server for Claude Code)
proto/                — Protobuf definitions (shared schema)
plugins/              — Editor / AI integrations
  claude-code/        — Claude Code plugin (agents, commands, skills, hooks)
  opencode/           — OpenCode plugin (native TS, Bun runtime)
docs/                 — Documentation site (mkdocs-material)
tests/                — Cross-validation test fixtures
benchmark/            — Accuracy benchmarks

Development

See Development Setup for prerequisites, commands, and the full dev workflow.

Contributing

See CONTRIBUTING.md for guidelines on how to contribute.

License

Apache License 2.0 — see LICENSE for details.

Extension points exported contracts — how you extend this code

Summarizer (Interface)
(no doc) [8 implementers]
ui/src/components/pipeline/summarizer/types.ts
GetNodePayload (Interface)
* Shape of `opentrace get-node --json`. Mirrors NodeDetail but with * untyped node payloads (the CLI emits store-shaped
plugins/opencode/src/graph-client.ts
User (Interface)
(no doc)
tests/fixtures/typescript/project/db.ts
INodeStage (Interface)
(no doc) [20 implementers]
ui/src/components/pipeline/concurrent/types.ts
TraversePayload (Interface)
* Shape of `opentrace traverse --json`. The CLI envelope also carries * `start`/`direction`/`depth`/`relType`/`totalRes
plugins/opencode/src/graph-client.ts
Logger (Interface)
(no doc)
tests/fixtures/go/extraction/mixed.go
SummarizationStrategy (Interface)
(no doc) [10 implementers]
ui/src/runner/browser/enricher/summarizer/strategy.ts
FakeOpts (Interface)
(no doc)
plugins/opencode/test/_helpers/fake-cli.ts

Core symbols most depended-on inside this repo

get
called by 653
ui/src/chat/chatHistoryStore.ts
push
called by 482
ui/src/job/eventChannel.ts
getWasmTableEntry
called by 163
ui/public/lbug_wasm_worker.js
stackRestore
called by 161
ui/public/lbug_wasm_worker.js
stackSave
called by 161
ui/public/lbug_wasm_worker.js
extractGeneric
called by 146
ui/src/components/pipeline/parser/extractors/generic.ts
assert
called by 123
ui/public/lbug_wasm_worker.js
execute
called by 108
ui/public/lbug_wasm_worker.js

Shape

Function 2,187
Method 1,342
Class 310
Interface 300
Route 22
Struct 9
Enum 1

Languages

TypeScript59%
Python39%
Go1%
Java1%

Modules by API surface

ui/public/lbug_wasm_worker.js821 symbols
agent/tests/opentrace_agent/graph/test_graph_store.py116 symbols
agent/tests/opentrace_agent/pipeline/test_variable_fixtures.py104 symbols
ui/src/components/pixi/PixiRenderer.ts97 symbols
agent/src/opentrace_agent/cli/main.py76 symbols
ui/src/store/ladybugStore.ts72 symbols
ui/src/components/pipeline/concurrent/stages.ts53 symbols
agent/tests/opentrace_agent/graph/test_mcp_integration.py47 symbols
agent/tests/opentrace_agent/cli/test_fetch_and_index.py46 symbols
agent/tests/opentrace_agent/sources/code/extractors/test_python_extractor.py40 symbols
agent/tests/opentrace_agent/cli/test_source_grep.py40 symbols
agent/src/opentrace_agent/store/graph_store.py40 symbols

Dependencies from manifests, versioned

slim/psr71.6 · 1×
slim/slim4.12 · 1×
github.com/mattn/go-sqlite3v1.14.24 · 1×
org.xerial:sqlite-jdbc3.46.0.0 · 1×
@eslint/js9.39.1 · 1×
@ladybugdb/wasm-core0.15.2 · 1×
@langchain/anthropic1.3.23 · 1×
@langchain/core1.1.32 · 1×
@langchain/google-genai2.1.26 · 1×

For agents

$ claude mcp add opentrace \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact