Skip to content

chore: integrate lsmcp for enhanced TypeScript symbol navigation - #472

Merged
ryoppippi merged 4 commits into
mainfrom
lsmcp-update
Aug 10, 2025
Merged

chore: integrate lsmcp for enhanced TypeScript symbol navigation#472
ryoppippi merged 4 commits into
mainfrom
lsmcp-update

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Aug 10, 2025

Copy link
Copy Markdown
Member

Summary

  • Add lsmcp MCP server with symbol indexing and TypeScript navigation capabilities
  • Configure lsmcp with custom index patterns for improved code search performance
  • Add comprehensive Claude Code custom commands for code analysis and refactoring
  • Update documentation with lsmcp usage guidelines and best practices

Changes

lsmcp Integration

  • Add lsmcp v1.8.0 to MCP configuration with stdio transport
  • Configure symbol indexing for TypeScript files with optimized patterns
  • Document symbol navigation tools and workflow in CLAUDE.md

Custom Commands

  • Add `analyze-code.md`: Comprehensive code analysis workflow with lsmcp tools
  • Add `refactor.md`: Systematic refactoring guide using symbol navigation
  • Add `lsmcp-onboarding.md`: Quick reference for lsmcp features

Documentation Updates

  • Add lsmcp usage guidelines to CLAUDE.md
  • Document available symbol navigation tools (index_files, search_symbol_from_index, etc.)
  • Add instructions for intelligent code reading using symbol indexing

Configuration

  • Update .gitignore to exclude lsmcp temporary files and indexes
  • Add .lsmcp/config.json with TypeScript-specific indexing patterns
  • Create symbol index memory file for persistent indexing state

Benefits

  • Faster code navigation using symbol-based search instead of text search
  • More accurate type information and references
  • Reduced context usage by reading only necessary code
  • Better IDE-like experience for TypeScript development

Test Plan

  • Verify lsmcp server starts correctly with MCP
  • Test symbol indexing with TypeScript files
  • Validate custom commands work as expected
  • Ensure no conflicts with existing MCP servers

Summary by CodeRabbit

  • New Features

    • Added comprehensive documentation for semantic code analysis commands, refactoring workflows, and onboarding instructions.
    • Introduced a detailed guide for efficient symbol-based code navigation and analysis.
    • Added project-specific symbol index metadata and configuration files for TypeScript projects.
  • Chores

    • Updated configuration files to streamline tool presets and server settings.
    • Adjusted ignore patterns to better manage cache directories.

Set up lsmcp (Language Server MCP) for fast TypeScript symbol indexing

- Indexed 32 TypeScript files with 197 symbols

- Configured with pattern **/*.ts for comprehensive coverage

- Added symbol_index_info memory with project configuration

- Enables fast symbol search and navigation without repeated file parsing
Document best practices for using lsmcp (Language Server MCP) tools

- Add guide for efficient symbol-based code navigation

- Document available symbol indexing and search tools

- Emphasize using indexed searches over reading entire files

- Include instructions for building and using symbol index

- List all available LSP operations (definitions, references, hover, diagnostics)
Add custom Claude Code command definitions for code analysis and lsmcp onboarding

- Add analyze-code.md command for comprehensive code analysis

- Add lsmcp-onboarding.md command for setting up lsmcp

- Add refactor.md command for refactoring operations

- Remove .claude from gitignore to allow tracking custom commands
@coderabbitai

coderabbitai Bot commented Aug 10, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces comprehensive documentation and configuration for the LSMCP (Language Server MCP) toolset, including semantic code analysis workflows, symbol indexing, and refactoring practices. It adds new markdown guides, updates configuration files for MCP servers and LSMCP presets, and adjusts .gitignore to support the new cache structure.

Changes

Cohort / File(s) Change Summary
LSMCP Documentation
.claude/commands/analyze-code.md, .claude/commands/refactor.md
Adds detailed markdown guides for semantic code analysis and refactoring using LSMCP/MCP tools, including workflows, usage, and best practices.
Onboarding Command
.claude/commands/lsmcp-onboarding.md
Introduces a new "start lsmcp onboarding" command entry.
LSMCP Configuration
.lsmcp/config.json, .lsmcp/memories/symbol_index_info.md
Adds LSMCP preset configuration and detailed symbol index metadata for a TypeScript project.
MCP Server Configuration
.mcp.json
Renames the MCP server key from "typescript" to "lsmcp" and simplifies its argument list.
General Documentation
CLAUDE.md
Adds a guide for using LSMCP/MCP symbol indexing tools for efficient codebase navigation and understanding.
Gitignore Update
.gitignore
Removes .claude from ignore list and adds .lsmcp/cache for LSMCP cache files.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LSMCP Tool
    participant MCP Server
    participant Symbol Index

    User->>LSMCP Tool: Initiate code analysis/refactoring command
    LSMCP Tool->>MCP Server: Perform semantic analysis (diagnostics, references, hover, etc.)
    LSMCP Tool->>Symbol Index: Build/update/search symbol index as needed
    MCP Server-->>LSMCP Tool: Return analysis results
    Symbol Index-->>LSMCP Tool: Return symbol data
    LSMCP Tool-->>User: Present structured report or refactoring result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

In burrows deep where code does dwell,
A rabbit finds new tools to tell—
Of symbols indexed, types revealed,
Refactoring paths now unconcealed.
With guides and configs, caches in tow,
The codebase shines with a clever glow!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea3eb64 and 1599521.

📒 Files selected for processing (8)
  • .claude/commands/analyze-code.md (1 hunks)
  • .claude/commands/lsmcp-onboarding.md (1 hunks)
  • .claude/commands/refactor.md (1 hunks)
  • .gitignore (1 hunks)
  • .lsmcp/config.json (1 hunks)
  • .lsmcp/memories/symbol_index_info.md (1 hunks)
  • .mcp.json (1 hunks)
  • CLAUDE.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lsmcp-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @ryoppippi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've integrated lsmcp (Language Server MCP) into our project to significantly enhance TypeScript symbol navigation and code analysis. This change aims to provide a more IDE-like experience, enabling faster and more accurate semantic understanding of the codebase. By leveraging language server protocols, this update will improve code search, refactoring, and overall development efficiency, allowing for more intelligent and precise interactions with our code.

Highlights

  • LSMCP Integration: I've integrated lsmcp v1.8.0 into our MCP configuration, specifically for TypeScript, to enable advanced symbol indexing and navigation capabilities. This will significantly improve how we interact with the codebase semantically.
  • New Claude Commands: I've introduced new Claude Code custom commands, including analyze-code.md, refactor.md, and lsmcp-onboarding.md. These commands leverage lsmcp to provide powerful semantic code analysis and intelligent refactoring workflows.
  • Enhanced Documentation: I've updated CLAUDE.md with comprehensive guidelines on how to effectively use the new lsmcp tools for intelligent code reading and symbol navigation, emphasizing the benefits of indexed searches over traditional text-based methods.
  • Configuration Updates: I've added .lsmcp/config.json to set the tsgo preset and updated .gitignore to properly manage lsmcp cache files. These configuration changes ensure the new indexing system is set up correctly and maintains a clean repository.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/ryoppippi/ccusage@472

commit: 1599521

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 1599521 Commit Preview URL

Branch Preview URL
Aug 10 2025, 09:24 PM

@ryoppippi ryoppippi changed the title feat: integrate lsmcp for enhanced TypeScript symbol navigation chore: integrate lsmcp for enhanced TypeScript symbol navigation Aug 10, 2025
@ryoppippi
ryoppippi merged commit 6012de5 into main Aug 10, 2025
12 of 13 checks passed
@ryoppippi
ryoppippi deleted the lsmcp-update branch August 10, 2025 21:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates the lsmcp MCP server for enhanced TypeScript symbol navigation, adding new commands and extensive documentation. The changes are well-structured and significantly improve the development experience for TypeScript projects. My review focuses on improving the clarity and correctness of the new documentation and command examples. I've pointed out some incorrect glob patterns that would cause commands to fail, inconsistent command formatting, and a hardcoded absolute path in an example file that affects portability. Addressing these points will make the new documentation more accurate and user-friendly.

mcp**lsmcp-<ADAPTER>**get_all_diagnostics

- root: "<PROJECT_PATH>"
- pattern: "\*_/_.<FILE_EXTENSION>"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The glob pattern \*_/_.<FILE_EXTENSION> is incorrect. The backslash \ escapes the asterisk *, so it will match a literal asterisk character instead of being a wildcard. Also, *_/ is not a standard glob pattern for recursive directory matching. The standard syntax is **/*. This incorrect pattern will cause the command to fail or not find any files.

This issue is also present on lines 134, 154, and 230.

Suggested change
- pattern: "\*_/_.<FILE_EXTENSION>"
- pattern: "**/*.<FILE_EXTENSION>"


## Phase 1: Capability Check

mcp**lsmcp-tsgo-dev**check_capabilities

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The command formatting mcp**lsmcp-tsgo-dev**check_capabilities is confusing. The double asterisks are part of the command string here, which is likely not intended. This formatting is also used inconsistently throughout the file (sometimes with __). For clarity and correctness, please use a plain command format like mcp lsmcp-tsgo-dev check_capabilities and apply it consistently.

Suggested change
mcp**lsmcp-tsgo-dev**check_capabilities
mcp lsmcp-tsgo-dev check_capabilities

## Project Information

- **Language**: TypeScript
- **Root Directory**: /Users/ryoppippi/ghq/github.com/ryoppippi/ccusage

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This file contains a hardcoded, user-specific absolute path: /Users/ryoppippi/ghq/github.com/ryoppippi/ccusage. This makes the documentation non-portable for other developers. Please use a placeholder like <PROJECT_ROOT> or a relative path (.) to ensure it's universally applicable. This also applies to the example commands on lines 38, 39, and 40.

Suggested change
- **Root Directory**: /Users/ryoppippi/ghq/github.com/ryoppippi/ccusage
- **Root Directory**: <PROJECT_ROOT>

Comment thread CLAUDE.md

Symbols are identified by their name, kind, file location, and container. Use these tools:

- `index_files` - Build symbol index for files matching pattern (e.g., '\*_/_.ts')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example glob pattern '\*_/_.ts' is incorrect. The backslash \ escapes the asterisk, and *_/ is not a standard glob pattern for recursive matching. This is misleading for anyone trying to use this guide. It should be '**/*.ts' to correctly match all TypeScript files recursively.

Suggested change
- `index_files` - Build symbol index for files matching pattern (e.g., '\*_/_.ts')
- `index_files` - Build symbol index for files matching pattern (e.g., '**/*.ts')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant