MCPcopy Index your code
hub / github.com/agentic-labs/lsproxy

github.com/agentic-labs/lsproxy @0.4.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.4 ↗ · + Follow
523 symbols 1,257 edges 107 files 25 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Agentic Labs

lsproxy - Precise code navigation via an API

discord license pypi

What is lsproxy?

lsproxy offers IDE-like code analysis and navigation functionality in a docker container with a REST API.

It supports multiple languages and resolves relationships between code symbols (functions, classes, variables) anywhere in the project - which can be used to help AI assistants navigate a codebase or build custom code RAG systems.

lsproxy runs Language Servers and ast-grep under the hood, giving you precise search results without the headache of configuring and integrating language-specific tooling.

For more info, please refer to our API Reference.

Key Features

  • 🎯 Precise Cross-File Code Navigation: Find symbol definitions and references across your entire project.
  • 🌐 Unified API: Access multiple language servers through a single API.
  • 🛠️ Auto-Configuration: Automatically detect and configure language servers based on your project files.
  • 📊 Code Diagnostics: (Coming Soon) Get language-specific lint output from an endpoint.
  • 🌳 Call & Type Hierarchies: (Coming Soon) Query multi-hop code relationships computed by the language servers.
  • 🔄 Procedural Refactoring: (Coming Soon) Perform symbol operations like rename, extract, auto import through the API.
  • 🧩 SDKs: Libraries to get started calling lsproxy in popular languages.

Getting started

The easiest way to get started is to run our tutorial! Check it out at demo.lsproxy.dev It's also super easy to run lsproxy on your code! We keep the latest version up to date on Docker Hub, and we have a Python SDK available via pip.

Install the sdk

pip install lsproxy-sdk

You can find the source for the SDK here

Run a container or add to compose

:warning: Version 0.2.0 and newer: JWT authentication is enabled by default for endpoints. So you MUST provide a secret or turn it off as described below

Authentication enabled

docker run -p 4444:4444 -v $WORKSPACE_PATH:/mnt/workspace -e JWT_SECRET=shared_secret agenticlabs/lsproxy
services:
  lsproxy:
    image: agenticlabs/lsproxy
    ports:
      - "4444:4444"
    environment:
      - JWT_SECRET=shared_secret
    volumes:
      - ${WORKSPACE_PATH}:/mnt/workspace

Authentication disabled

docker run -p 4444:4444 -v $WORKSPACE_PATH:/mnt/workspace -e USE_AUTH=false agenticlabs/lsproxy
services:
  lsproxy:
    image: agenticlabs/lsproxy
    ports:
      - "4444:4444"
    environment:
      - USE_AUTH=false
    volumes:
      - ${WORKSPACE_PATH}:/mnt/workspace

Configure an existing system

You can also configure an existing system to run lsproxy. Add the following line in your dockerfile or run it as part of a startup script

curl -sSL https://github.com/agentic-labs/lsproxy/releases/latest/download/install-lsproxy.sh | sh

Explore your workspace!

from lsproxy import Lsproxy

client = Lsproxy()
file_path = "relative/path/from/project/root.cpp"
symbols = client.definitions_in_file(file_path)
for symbol in symbols:
    print(f"{symbol.name} is defined in {file_path}")

Building products with lsproxy

If you're building AI coding agents or code RAG, or would like to use lsproxy in a commercial product, please reach out!

Contributing

We appreciate all contributions! You don't need to be an expert to help out. Please see CONTRIBUTING.md for more details on how to get started.

Questions? Reach out to us on Discord.

Community

We're building a community. Come hang out with us!

Supported languages

We're looking to add new language support or better language servers so let us know what you need! |Language|Server|URL| |:-|:-|:-| |C/C++|clangd|https://clangd.llvm.org/| |Golang|gopls|https://github.com/golang/tools/tree/master/gopls| |Java|jdtls|https://github.com/eclipse-jdtls/eclipse.jdt.ls| |Javascript|typescript-language-server|https://github.com/typescript-language-server/typescript-language-server| |PHP|phpactor|https://github.com/phpactor/phpactor| |Python|jedi-language-server|https://github.com/pappasam/jedi-language-server| |Rust|rust-analyzer|https://github.com/rust-lang/rust-analyzer| |Typescript|typescript-language-server|https://github.com/typescript-language-server/typescript-language-server| |Your Favorite Language | Awesome Language Server | https://github.com/agentic-labs/lsproxy/issues/new |

Extension points exported contracts — how you extend this code

LspClient (Interface)
(no doc) [9 implementers]
lsproxy/src/lsp/client.rs
IAStarPathfinder (Interface)
(no doc) [3 implementers]
sample_project/typescript/src/astar.ts
Comparable (Interface)
(no doc)
sample_project/php/Comparable.php
Process (Interface)
(no doc) [1 implementers]
lsproxy/src/lsp/process.rs
InfoPanelProps (Interface)
(no doc)
sample_project/typescript/src/InfoPanel.tsx
JsonRpc (Interface)
(no doc) [1 implementers]
lsproxy/src/lsp/json_rpc.rs
GridDisplayProps (Interface)
(no doc)
sample_project/typescript/src/GridDisplay.tsx
WorkspaceDocuments (Interface)
(no doc) [1 implementers]
lsproxy/src/utils/workspace_documents.rs

Core symbols most depended-on inside this repo

map
called by 94
sample_project/cpp/cpp_classes/map.cpp
contains
called by 34
lsproxy/src/ast_grep/types.rs
path
called by 30
sample_project/rust/src/astar.rs
get
called by 24
sample_project/rust/src/map.rs
initialize_app_state
called by 22
lsproxy/src/lib.rs
send
called by 21
lsproxy/src/lsp/process.rs
get_context_range
called by 18
lsproxy/src/ast_grep/types.rs
definitions_in_file_ast_grep
called by 15
lsproxy/src/lsp/manager/manager.rs

Shape

Method 232
Function 165
Class 101
Interface 12
Enum 5
Struct 5
TypeAlias 3

Languages

Rust66%
TypeScript8%
Go6%
Ruby4%
C++4%
Python4%

Modules by API surface

lsproxy/src/api_types.rs32 symbols
lsproxy/src/utils/workspace_documents.rs19 symbols
lsproxy/src/lsp/json_rpc.rs17 symbols
lsproxy/src/lib.rs16 symbols
lsproxy/src/lsp/manager/manager.rs15 symbols
lsproxy/src/lsp/languages/clang.rs15 symbols
lsproxy/src/ast_grep/types.rs15 symbols
lsproxy/src/test_utils.rs14 symbols
lsproxy/src/lsp/client.rs13 symbols
sample_project/python/graph.py11 symbols
sample_project/ruby/graph.rb10 symbols
lsproxy/src/lsp/languages/rust.rs10 symbols

For agents

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

⬇ download graph artifact