npm.io
0.2.4 • Published yesterdayCLI

openvisio

Licence
MIT
Version
0.2.4
Deps
6
Size
238 kB
Vulns
0
Weekly
0
Stars
6
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

openvisio

npm license node

See any codebase as a graph. openvisio is an MCP server + CLI that hands coding agents (Claude Code, Codex, Cursor, …) a token-cheap, ranked, graph-native view of a repository — so the agent queries structure instead of blindly reading and grepping files.

It parses your repo with tree-sitter into a symbol + import graph, ranks it with PageRank, and serves task-focused, token-budgeted slices with exact path:line anchors. Deterministic, local-first, read-only — no LLM in the engine, no network, your code never leaves your machine.

                    ┌──────────────────────────────┐
                    │        your repository        │
                    └───────────────┬──────────────┘
                                    │  tree-sitter parse
                                    ▼
                    ┌──────────────────────────────┐
                    │     @openvisio/core engine    │
                    │  symbols · imports · PageRank  │
                    │   deterministic · local-only   │
                    └───────────────┬──────────────┘
                                    │  one ranked code graph
                   ┌────────────────┴───────────────┐
                   ▼                                 ▼
        ┌─────────────────────┐          ┌─────────────────────┐
        │     MCP server       │          │      the viewer      │
        │   (for your agent)   │          │       (for you)      │
        │ ranked, token-cheap  │          │   Atlas + City 3D    │
        │  path:line anchors   │          │       map views      │
        └─────────────────────┘          └─────────────────────┘

One graph, two faces: the MCP server is for the agent, the viewer is for the human. They share the same index.

OpenVisio viewer — the Atlas view of a large codebase, with files and symbols linked by amber import and call edges
The viewer's Atlas view (openvisio view) — every file and symbol as a constellation linked by imports, definitions, and calls.


Why

A coding agent dropped into an unfamiliar repo burns thousands of tokens crawling files just to learn the shape of things — and still misses how pieces connect. OpenVisio front-loads that with a deterministic graph, then serves the agent only the ranked, elided slices relevant to its task. The agent reads less, and reads the right things, with anchors to jump to the real source when it needs to.

read the repo to start with OpenVisio
Prime the agent on a repo ~90K tokens ~1.5K (get_repo_skeleton)
Per task ~80K tokens ~2.4K (resolve_context)

Estimates on this project's own viewer package; wins concentrate in large, structured repos. See bench/ for the methodology and an A/B protocol.


Install

npm install -g openvisio

Requires Node ≥ 18.17. Tree-sitter grammars and the native cache install with the package.

Quick start

Register OpenVisio with your agent for the current project:

cd your-project
openvisio init            # writes .mcp.json (Claude Code), .cursor/mcp.json, …
openvisio init --global   # or register once for every project

Open your agent in the repo, approve the openvisio server, and it queries the graph before touching files. Run the server by hand any time:

openvisio mcp . --watch

What your agent gets

Every tool returns ranked, elided output with exact path:line anchors, so the agent reads only the slice it needs.

tool what it does
resolve_context task description → task-ranked skeleton + the neighborhoods of the most relevant files. Call this first.
get_repo_skeleton the whole ranked repo map: most import-central files + their public symbols
find_symbol locate a function/class/type by name or pattern → signature + anchor
get_neighborhood local import subgraph around a file/symbol (dependents + dependencies)
get_dependents who imports this — directed impact analysis
get_hotspots load-bearing / risky files: high import centrality (+ git churn)

The tool surface is intentionally tiny — schemas load into the agent's context every turn, so a fat surface re-creates the bloat we're removing.


CLI

openvisio [init] [path] [--global] [--cursor]   # register with agents + first index
openvisio mcp [path] [--watch] [--spotlight]    # MCP server over stdio
openvisio view [path] [--port=7077] [--no-open] # open the local graph viewer in a browser
openvisio transport [path] [--server=https://openvisio.io] [--no-open]  # index locally, ship the graph to a web viewer
openvisio skeleton [path] [--budget=1500] [--task="add oauth"]  # print the ranked map
openvisio export [path] [--out=.openvisio/graph.json]           # emit the graph as JSON
  • --watch re-indexes incrementally as files change (a content-addressed parse cache re-parses only what changed; ids stay stable, so results reflect edits mid-session).
  • --task personalizes the skeleton ranking toward a task description.
  • --spotlight exposes a local SSE channel so an open OpenVisio viewer lights up the files the agent is querying.
  • view indexes the repo and serves the OpenVisio Atlas + City views (the same React/Three.js views from the app, shipped in the openvisio-viewer package) on 127.0.0.1, then opens your browser. City is a 3D treemap (districts = folders, buildings = files, sized by LOC, colored by language); Atlas is a file/symbol constellation linked by imports, definitions, and calls. It opens on the Atlas by default; switch to City with the view toggle. Click Index to browse the filesystem (git repos are flagged) or type a path and index any other local repo, with a staged progress loader while it builds, then click to focus a node. --no-open just prints the URL. It defaults to the spotlight port (7077) and acts as the highlight hub: with view running, start your agent with openvisio mcp . --spotlight and its tool calls focus the graph live.
  • transport is the shareable cousin of view: it indexes the repo locally (your source stays on your machine), writes a cached copy to <repo>/.openvisio/graph.json, then POSTs only the computed graph JSON to <server>/api/import and opens the rendered Atlas/City + AI narrator at <server>/?g=<id>. The destination defaults to https://openvisio.io; override it with --server or the OPENVISIO_SERVER env var. --no-open just prints the URL.

Configure your agent manually

Running openvisio init does this for you. Manual equivalents:

Claude Code

claude mcp add openvisio -- openvisio mcp . --watch

Cursor / VS Code.cursor/mcp.json (or .vscode/mcp.json):

{
  "mcpServers": {
    "openvisio": { "command": "openvisio", "args": ["mcp", ".", "--watch"] }
  }
}

Codex~/.codex/config.toml:

[mcp_servers.openvisio]
command = "openvisio"
args = ["mcp", ".", "--watch"]
Troubleshooting: "MCP server failed to connect" (nvm + GUI editors)

If you installed Node with nvm and your MCP client is a GUI app (Cursor, the Claude desktop app), the client spawns servers with a minimal PATH that doesn't include nvm — so bare openvisio (or even node) isn't found and the connection fails. Terminal clients (Claude Code CLI, Codex CLI) are unaffected.

Fix: point the config at absolute paths:

{
  "mcpServers": {
    "openvisio": {
      "command": "/Users/you/.nvm/versions/node/vXX.Y.Z/bin/node",
      "args": ["/Users/you/.nvm/versions/node/vXX.Y.Z/lib/node_modules/openvisio/dist/cli.js",
               "mcp", ".", "--watch"]
    }
  }
}

Find the paths with which node and npm root -g. (Installing Node from nodejs.org or Homebrew instead of nvm also avoids this entirely.)


How it works

  • Deterministic & LLM-free — same repo bytes → same graph, same ids, every run.
  • Local-first & read-only — reads your code on your machine, never uploads it, never modifies the repo.
  • Incremental--watch keeps the graph fresh as you edit.
  • Broad language support — TypeScript/JavaScript, Python, Go, Rust, Java, C/C++, C#, Ruby, PHP, and many more via tree-sitter.

On shutdown the server prints a one-line savings receipt — tokens returned vs. the estimated cost of having read the touched files whole.

Scope

OpenVisio supplies understanding; your agent harness does the edits. Wins are concentrated in large, existing, structured repos; greenfield or tiny repos see little benefit.

License

MIT OpenVisio contributors · github.com/syntaxpriest/openvisio-oss

Keywords

3d-visualizationabstract-syntax-treeagentagent-memoryagenticagentic-aiagentic-codingagentic-workflowagentsaiai-agentai-agentsai-assistantai-code-completionai-code-reviewai-codingai-coding-agentai-coding-assistantai-coding-toolsai-contextai-costai-cost-reductionai-dev-toolsai-developer-toolsai-engineeringai-memoryai-nativeai-orchestrationai-pair-programmerai-pair-programmingai-poweredai-toolingai-toolsaideraider-code-graphaider-contextaider-extensionaider-integrationaider-mcpaider-mcp-serveraider-pluginaider-tokensaider-toolsamp-codeanchorsandroidangularanthropicanthropic-claudeanthropic-mcpapiarchitecturearchitecture-analysisarchitecture-diagramarchitecture-maparchitecture-visualizationartificial-intelligenceastastroaugmentaugment-codeaugment-code-graphaugment-contextaugment-extensionaugment-integrationaugment-mcpaugment-mcp-serveraugment-pluginaugment-tokensaugment-toolsauto-documentationautomationautonomous-agentautonomous-codingbackendbashblast-radiusblock-gooseboltbolt-newbudgeted-contextbug-findingbuild-toolsbuncc-plus-plusc-sharpcall-graphcallgraphcentralitycheaper-aichurnclaudeclaude-aiclaude-codeclaude-code-code-graphclaude-code-contextclaude-code-extensionclaude-code-graphclaude-code-integrationclaude-code-mcpclaude-code-mcp-serverclaude-code-pluginclaude-code-tokensclaude-code-toolsclaude-contextclaude-desktopclaude-extensionclaude-integrationclaude-mcpclaude-mcp-serverclaude-pluginclaude-tokensclaude-toolsclicli-toolclinecline-code-graphcline-contextcline-extensioncline-integrationcline-mcpcline-mcp-servercline-plugincline-tokenscline-toolsclionclojurecloudlesscode-analysiscode-assistantcode-atlascode-browsercode-citycode-completioncode-complexitycode-comprehensioncode-contextcode-context-protocolcode-diagramcode-discoverycode-documentationcode-editorcode-explorationcode-explorercode-graphcode-graph-ragcode-indexcode-indexingcode-intelcode-intelligencecode-knowledge-graphcode-mapcode-metricscode-migrationcode-navigationcode-qualitycode-ragcode-refactoringcode-reviewcode-reviewscode-searchcode-search-enginecode-skeletoncode-structurecode-summarizationcode-summarycode-understandingcode-viewercode-visualisationcode-visualizationcodebase-analysiscodebase-contextcodebase-documentationcodebase-explorationcodebase-graphcodebase-indexingcodebase-insightscodebase-mapcodebase-navigationcodebase-onboardingcodebase-searchcodebase-understandingcodebase-visualisationcodebase-visualizationcodeiumcodeium-code-graphcodeium-contextcodeium-extensioncodeium-integrationcodeium-mcpcodeium-mcp-servercodeium-plugincodeium-tokenscodeium-toolscodexcodex-clicodex-code-graphcodex-contextcodex-extensioncodex-integrationcodex-mcpcodex-mcp-servercodex-plugincodex-tokenscodex-toolscodingcoding-agentcoding-assistantcoding-toolscodycognition-devincommand-linecommand-line-interfacecommand-line-toolcomplexityconcrete-syntax-treecontextcontext-budgetcontext-compressioncontext-engineeringcontext-managementcontext-optimizationcontext-providercontext-retrievalcontext-windowcontext7-alternativecontinuecontinue-code-graphcontinue-contextcontinue-devcontinue-extensioncontinue-integrationcontinue-mcpcontinue-mcp-servercontinue-plugincontinue-tokenscontinue-toolscontrol-flow-graphcopilotcopilot-chatcopilot-code-graphcopilot-contextcopilot-extensioncopilot-integrationcopilot-mcpcopilot-mcp-servercopilot-plugincopilot-tokenscopilot-toolscost-optimizationcppcpp-astcpp-call-graphcpp-code-analysiscpp-code-graphcpp-codebasecpp-dependency-graphcpp-static-analysiscpp-tree-sittercrystalcsharpcsharp-astcsharp-call-graphcsharp-code-analysiscsharp-code-graphcsharp-codebasecsharp-dependency-graphcsharp-static-analysiscsharp-tree-sittercsscstcursorcursor-aicursor-code-graphcursor-contextcursor-extensioncursor-idecursor-integrationcursor-mcpcursor-mcp-servercursor-plugincursor-tokenscursor-toolscut-tokensdartdata-flowdata-flow-analysisdata-visualizationdatagripdead-codedead-code-detectiondebugdebuggingdefinitionsdenodependenciesdependency-analysisdependency-graphdependency-visualizationdeterministicdeterministic-code-graphdeveloper-experiencedeveloper-onboardingdeveloper-productivitydeveloper-toolsdeveloper-workflowdevindevtooldevtoolsdevxdiagramdirected-graphdjangodocumentationdotnetdotnet-coredxecmascriptedgeseditorefficient-contextelixiremacsembedding-freeengineering-insightsengineering-productivityenterprise-codebaseerlangexpressexpressjsfastfastapifastifyfewer-tokensfind-referencesflaskflutterfoundation-modelframeworkfrontendfsharpfullstackfunction-callinggemini-cligemini-cli-code-graphgemini-cli-contextgemini-cli-extensiongemini-cli-integrationgemini-cli-mcpgemini-cli-mcp-servergemini-cli-plugingemini-cli-tokensgemini-cli-toolsgemini-code-assistgen-aigenaigenerative-aigitgithubgithub-copilotgogo-astgo-call-graphgo-code-analysisgo-code-graphgo-codebasego-dependency-graphgo-static-analysisgo-to-definitiongo-tree-sittergolandgolanggoogle-geminigoosegraphgraph-algorithmsgraph-analysisgraph-databasegraph-nativegraph-querygraph-raggraph-rankinggraph-traversalgraph-viewergraph-visualizationgraphqlgraphraggraphsgroovygroundinghaskellhotspotshtmlideide-integrationimpact-analysisimport-analysisimport-graphin-context-learningincremental-parsingindexingintellijintellij-ideainteractive-visualizationiosjavajava-astjava-call-graphjava-code-analysisjava-code-graphjava-codebasejava-dependency-graphjava-static-analysisjava-tree-sitterjavascriptjavascript-astjavascript-call-graphjavascript-code-analysisjavascript-code-graphjavascript-codebasejavascript-dependency-graphjavascript-static-analysisjavascript-tree-sitterjetbrainsjetbrains-aijetbrains-assistantjsxjuliakilo-codekilo-code-code-graphkilo-code-contextkilo-code-extensionkilo-code-integrationkilo-code-mcpkilo-code-mcp-serverkilo-code-pluginkilo-code-tokenskilo-code-toolskirokiro-code-graphkiro-contextkiro-extensionkiro-integrationkiro-mcpkiro-mcp-serverkiro-pluginkiro-tokenskiro-toolsknowledge-graphkotlinkotlin-astkotlin-call-graphkotlin-code-analysiskotlin-code-graphkotlin-codebasekotlin-dependency-graphkotlin-static-analysiskotlin-tree-sitterlanguage-serverlanguage-server-protocollaravellarge-codebaselarge-codebaseslarge-language-modellarge-language-modelslean-contextlegacy-codelegacy-modernizationlexerlibrarylightweightllmllm-agentllm-agentsllm-appllm-applicationllm-costllm-cost-reductionllm-freellm-orchestrationllm-toolingllm-toolsllmslocallocal-firstlocal-mcplovablelspluamaintainabilitymcpmcp-agentmcp-agentsmcp-aimcp-appmcp-climcp-clientmcp-codemcp-code-graphmcp-codebasemcp-connectormcp-contextmcp-developer-toolsmcp-ecosystemmcp-extensionmcp-for-aidermcp-for-augmentmcp-for-claudemcp-for-claude-codemcp-for-clinemcp-for-codeiummcp-for-codexmcp-for-continuemcp-for-copilotmcp-for-cursormcp-for-gemini-climcp-for-kilo-codemcp-for-kiromcp-for-roo-codemcp-for-sourcegraphmcp-for-tabninemcp-for-traemcp-for-warpmcp-for-windsurfmcp-for-zedmcp-hostmcp-integrationmcp-pluginmcp-promptmcp-registrymcp-resourcemcp-servermcp-static-analysismcp-stdiomcp-toolmcp-toolkitmcp-toolsmcp-transportminimal-contextmodel-context-protocolmodelcontextprotocolmodernizationmodule-graphmonorepomonoreposneighborhoodneovimnestjsnetwork-freenext-jsnextjsnimno-cloudno-embeddingsno-llmno-networknodenode-jsnodejsnodesnpmnpm-packagenvimobjective-cocamlofflineoffline-firston-deviceon-premon-premiseonboardingopen-sourceopenai-codexopendevinopenhandsopenvisioosspage-rankpagerankpair-programmingparserparsingpath-line-anchorspear-aipearaiperlphpphp-astphp-call-graphphp-code-analysisphp-code-graphphp-codebasephp-dependency-graphphp-static-analysisphp-tree-sitterphpstormpolyglotpolyglot-codebasepowershellprivacyprivacy-firstprivateproductivityprogram-analysisprogrammingprogramming-toolspromptprompt-compressionprompt-engineeringpycharmpythonpython-astpython-call-graphpython-code-analysispython-code-graphpython-codebasepython-dependency-graphpython-static-analysispython-tree-sitterqwen-coderr-langragrailsrankedranked-contextrankingreachabilityreactreact-nativereact-three-fiberreactjsread-onlyreduce-tokensrefactorrefactoringreference-graphreferencesremixremote-mcpreplitreplit-agentreplit-airepo-analysisrepo-indexingrepo-maprepository-analysisrepository-mapreproducibleretrievalretrieval-augmented-generationriderroo-clineroo-coderoo-code-code-graphroo-code-contextroo-code-extensionroo-code-integrationroo-code-mcproo-code-mcp-serverroo-code-pluginroo-code-tokensroo-code-toolsrubyruby-astruby-call-graphruby-code-analysisruby-code-graphruby-codebaseruby-dependency-graphruby-on-railsruby-static-analysisruby-tree-sitterrubyminerustrust-astrust-call-graphrust-code-analysisrust-code-graphrust-codebaserust-dependency-graphrust-static-analysisrust-tree-sittersave-tokensscalasdksecureself-hostedselfhostedsemantic-analysissemantic-codesemantic-searchshellsingle-binaryskeletonsoftware-architecturesoftware-developmentsoftware-engineeringsoftware-visualizationsoliditysolidjssource-code-analysissource-graphsourcegraphsourcegraph-code-graphsourcegraph-codysourcegraph-contextsourcegraph-extensionsourcegraph-integrationsourcegraph-mcpsourcegraph-mcp-serversourcegraph-pluginsourcegraph-tokenssourcegraph-toolsspringspring-bootsqlstatic-analysisstatic-code-analysisstructuresubgraphsublime-textsveltesveltekitswiftswift-astswift-call-graphswift-code-analysisswift-code-graphswift-codebaseswift-dependency-graphswift-static-analysisswift-tree-sittersymbol-graphsymbol-indexsymbol-searchsymbol-tablesymbolssyntax-treesystem-designtabninetabnine-code-graphtabnine-contexttabnine-extensiontabnine-integrationtabnine-mcptabnine-mcp-servertabnine-plugintabnine-tokenstabnine-toolstech-debttechnical-debtterminalterminal-tooltext-editorthree-jsthreejstokentoken-awaretoken-budgettoken-budgetingtoken-costtoken-efficiencytoken-efficienttoken-optimizationtoken-optimizedtoken-reductiontoken-savingtoken-savingstoken-usagetokenstool-callingtool-usetoolkittraetrae-aitrae-code-graphtrae-contexttrae-extensiontrae-integrationtrae-mcptrae-mcp-servertrae-plugintrae-tokenstrae-toolstree-sittertsxtypescripttypescript-asttypescript-call-graphtypescript-code-analysistypescript-code-graphtypescript-codebasetypescript-dependency-graphtypescript-static-analysistypescript-tree-sitterunused-codeutilityv0vercel-v0vimvisual-studio-codevisualizationvoid-editorvs-codevscodevscode-extensionvuevue-langvuejswarpwarp-code-graphwarp-contextwarp-extensionwarp-integrationwarp-mcpwarp-mcp-serverwarp-pluginwarp-terminalwarp-tokenswarp-toolswayfindingweb-developmentwebglwebstormwindsurfwindsurf-code-graphwindsurf-contextwindsurf-extensionwindsurf-idewindsurf-integrationwindsurf-mcpwindsurf-mcp-serverwindsurf-pluginwindsurf-tokenswindsurf-toolszedzed-aized-code-graphzed-contextzed-editorzed-extensionzed-integrationzed-mcpzed-mcp-serverzed-pluginzed-tokenszed-toolszero-configzig