Skip to main content
Glama

Alpha(0.1.x)— 実際のプロジェクトで動作し、作者が毎日使用しています。粗い部分があることを想定してください。

AIアシスタントは一度に1ファイルずつコードを編集します。依存関係を確認できません。grepや読み取り、推測を行い——3ファイル先のものを壊してしまいます。

LensPRはコードベースの依存関係グラフを構築し、AIが何かを変更する前に構造的な理解を提供します。

クイックスタート

要件: Python 3.11以上macOSまたはLinux。TypeScript/JSプロジェクトの場合は、Node.js 18以上も必要です。

pip install 'lenspr[all]'
lenspr init .
lenspr setup .

IDEを再起動してください。完了です。あなたのAIはlens_*ツールを利用できるようになります。

.lens/.gitignore に追加してください — グラフはローカルに保存され、ソースから再構築されます。


機能

"この関数に依存しているものは?"

1回の呼び出しで、ソースコード、呼び出し元、呼び出し先、関連テストを取得できます:

> lens_context("auth.login_handler")

source: 42 lines
callers: auth_routes.create_routes, test_auth.test_login_success
callees: db.get_user, crypto.verify_password, jwt.create_token
tests: test_login_success, test_login_wrong_password

LensPRがない場合、AIは5〜7回のgrep/read呼び出しを行っても見落としが発生します。LensPRがあれば — 1回の呼び出しで全体像を把握できます。

"これを変更したら何が壊れる?"

変更を加える前に、AIは影響範囲を確認します:

> lens_check_impact("models.User")

severity: CRITICAL
direct_dependents: 15
indirect_dependents: 23
affected_modules: auth, payments, notifications
tests_covering: 3

AIは警告を発し、アプローチを変更するか、確認を求めます。盲目的な編集はもうありません。

"このコードベースの健全性は?"

> lens_vibecheck()

score: 86/100 (B)
  test_coverage:    17/25 — 67% functions tested
  dead_code:        20/20 — 0% dead code
  circular_imports: 15/15 — 0 cycles
  architecture:     12/15 — 1 violation
  documentation:     8/10 — 81% documented
  graph_confidence: 14/15 — 94% edges resolved

コードベースが時間とともに改善しているか、悪化しているかを追跡します。

クロスランゲージの可視性

LensPRはフロントエンドとバックエンドを単一のグラフに接続します:

LoginModal.tsx → fetch("/api/auth/login")
                        ↓ CALLS_API
Backend:  @router.post("/login") → login_handler()
            → db.query(User)        [reads: users]
            → verify_password()
            → create_jwt_token()

さらに、データベーステーブル、Dockerサービス、環境変数、CI/CDワークフロー、SQLマイグレーションも追跡します。


対応環境

IDE

セットアップ

Claude Code

lenspr setup . — 自動

Cursor

.mcp.json.cursor/mcp.json にコピー

任意のMCPクライアント

lenspr serve <path>

対応言語: Python(Jedi/Pyrightによる95%以上の解決率)、TypeScript/JavaScript(tree-sitter + TS Compiler APIによる85〜95%)。

インフラストラクチャ: .sqlファイル、Dockerfile、docker-compose.yml、GitHub Actionsワークフロー、.envファイル — すべて同じグラフに解析されます。

すべてローカルで実行されます。コードがマシンの外に出ることはありません。


主な機能

影響分析

変更前の重大度(LOW → CRITICAL)

ワンコールコンテキスト

1回のリクエストでソース + 呼び出し元 + 呼び出し先 + テスト

クロスランゲージ

フロントエンドHTTP → バックエンドルート、DBテーブル、Docker、環境変数、CI/CD

外科的編集

関数内のターゲットを絞った検索/置換 — ファイル全体の書き換えなし

デッドコード

到達不能な関数を検出(Django、FastAPI、Celeryエントリポイント)

アーキテクチャルール

レイヤー境界を強制 — 違反は変更適用前に警告

関数単位のGit

関数レベルでのblame、履歴、コミット範囲

セッションメモリ

AIはコンテキストリセット後も中断したところから再開

自動同期

ファイルウォッチャーが保存のたびにグラフを更新

ヘルススコア

6つの次元で0〜100のスコア — 品質を経時的に追跡

12グループに編成された60以上のツール — lenspr tools で必要なものだけを有効にできます。

ナビゲーションと検索 (8): lens_context, lens_get_node, lens_search, lens_grep, lens_find_usages, lens_get_structure, lens_list_nodes, lens_get_connections

変更 (6): lens_update_node, lens_patch_node, lens_add_node, lens_delete_node, lens_rename, lens_batch

解析 (6): lens_check_impact, lens_validate_change, lens_health, lens_dead_code, lens_dependencies, lens_diff

品質 (7): lens_vibecheck, lens_nfr_check, lens_test_coverage, lens_security_scan, lens_dep_audit, lens_fix_plan, lens_generate_test_skeleton

アーキテクチャ (9): lens_arch_rule_add, lens_arch_rule_list, lens_arch_rule_delete, lens_arch_check, lens_class_metrics, lens_project_metrics, lens_largest_classes, lens_compare_classes, lens_components

Git (4): lens_blame, lens_node_history, lens_commit_scope, lens_recent_changes

インフラストラクチャ (5): lens_api_map, lens_db_map, lens_env_map, lens_ffi_map, lens_infra_map

テストとトレース (3): lens_run_tests, lens_trace, lens_trace_stats

アノテーション (5): lens_annotate, lens_save_annotation, lens_batch_save_annotations, lens_annotate_batch, lens_annotation_stats

セッション (4): lens_session_write, lens_session_read, lens_session_handoff, lens_resume

時間 (2): lens_hotspots, lens_node_timeline

説明 (1): lens_explain


既知の制限

  • Windows — サポートされていません。macOSとLinuxのみです。

  • self.method() 呼び出し — 静的パーサーはインスタンスメソッドのディスパッチを完全には解決できません。回避策: lens_trace(Python 3.12+)が実行時にこれらを解決します。

  • Go、Rust、Java — まだサポートされていません。パーサーインターフェースはコントリビューター向けに用意されています。

  • 動的コードgetattreval、動的インポートは静的に追跡できません。


コントリビューション

試してみてください。壊れたら教えてください。

  • バグ報告 — 「動かない」でも助けになります

  • 言語パーサー — Go、Rust、Java(BaseParserインターフェースは準備済み)

  • アイデアissueを開く

ライセンス

MIT


AIがコードを壊し続けたから作った。

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
2Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Hosted MCP server for structured code review passes on human- and AI-written code. Free tier.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • An MCP server that gives your AI access to the source code and docs of all public github repos

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kyrylopr/lenspr'

If you have feedback or need assistance with the MCP directory API, please join our Discord server