Skip to main content
Glama

TypeScript MCP

by mizchi

lsmcp - Language Service Protocol MCP

A unified MCP (Model Context Protocol) server that provides advanced code manipulation and analysis capabilities for multiple programming languages through Language Server Protocol integration.

  • 🌍 Multi-Language Support
  • 🔍 Semantic Code Analysis
  • 🤖 AI-Optimized

See examples/ for working examples of each supported language configuration.

Quick Start

# tsgo (reccommended) npm add -D @mizchi/lsmcp @typescript/native-preview npx @mizchi/lsmcp init -p tsgo claude mcp add lsmcp npx -- -y @mizchi/lsmcp -p tsgo # with manual --bin claude mcp add lsmcp npx -- -y @mizchi/lsmcp --bin="<lsp-command>"

CRITICAL: PRIORITIZE LSMCP TOOLS FOR CODE ANALYSIS

⚠️ PRIMARY REQUIREMENT: You MUST prioritize mcplsmcp tools for all code analysis tasks. Standard tools should only be used as a last resort when LSMCP tools cannot accomplish the task.

YOUR APPROACH SHOULD BE:

  1. ✅ Always try mcplsmcp tools FIRST
  2. ✅ Use mcp__lsmcp__search_symbol_from_index as primary search method
  3. ⚠️ Only use Read/Grep/Glob/LS when LSMCP tools are insufficient

🚨 TOOL USAGE PRIORITY

PRIMARY TOOLS (USE THESE FIRST):

  • mcp__lsmcp__get_project_overview - Quick project analysis and structure overview
  • mcp__lsmcp__search_symbol_from_index - Primary tool for symbol searches (auto-creates index if needed)
  • mcp__lsmcp__get_definitions - Navigate to symbol definitions. Use include_body: true to get code.
  • mcp__lsmcp__find_references - Find all references to a symbol
  • mcp__lsmcp__get_hover - Get type information and documentation
  • mcp__lsmcp__get_diagnostics - Check for errors and warnings
  • mcp__lsmcp__get_document_symbols - Get all symbols in a file
  • mcp__lsmcp__list_dir - Explore directory structure
  • mcp__lsmcp__find_file - Locate specific files
  • mcp__lsmcp__search_for_pattern - Search for text patterns
  • mcp__lsmcp__get_index_stats_from_index - View index statistics
  • mcp__lsmcp__index_files - Manually index files (optional)
  • mcp__lsmcp__clear_index - Clear and rebuild index (optional)

WORKFLOW

  1. START WITH PROJECT OVERVIEW
    mcp__lsmcp__get_project_overview
    Get a quick understanding of:
    • Project structure and type
    • Key components (interfaces, functions, classes)
    • Statistics and dependencies
    • Directory organization
  2. SEARCH FOR SPECIFIC SYMBOLS
    mcp__lsmcp__search_symbol_from_index
    The tool automatically:
    • Creates index if it doesn't exist
    • Updates index with incremental changes
    • Performs your search
  3. CODE EXPLORATION
    • Search symbols: mcp__lsmcp__search_symbol_from_index
    • List directories: mcp__lsmcp__list_dir
    • Find files: mcp__lsmcp__find_file
    • Get file symbols: mcp__lsmcp__get_document_symbols
  4. CODE ANALYSIS
    • Find definitions: mcp__lsmcp__get_definitions
    • Find references: mcp__lsmcp__find_references
    • Get type info: mcp__lsmcp__get_hover
    • Check errors: mcp__lsmcp__get_diagnostics

FALLBACK TOOLS (USE ONLY WHEN NECESSARY):

  • ⚠️ Read - Only when you need to see non-code files or LSMCP tools fail
  • ⚠️ Grep - Only for quick searches when LSMCP search is insufficient
  • ⚠️ Glob - Only when LSMCP file finding doesn't work
  • ⚠️ LS - Only for basic directory listing when LSMCP fails
  • ⚠️ Bash commands - Only for non-code operations or troubleshooting

WHEN TO USE FALLBACK TOOLS

Use standard tools ONLY in these situations:

  1. Non-code files: README, documentation, configuration files
  2. LSMCP tool failures: When LSMCP tools return errors or no results
  3. Debugging: When troubleshooting why LSMCP tools aren't working
  4. Special file formats: Files that LSMCP doesn't support
  5. Quick verification: Double-checking LSMCP results when needed

Memory System

You have access to project memories stored in .lsmcp/memories/. Use these tools:

  • list_memories - List available memory files
  • read_memory - Read specific memory content
  • write_memory - Create or update memories

Memories contain important project context, conventions, and guidelines that help maintain consistency.

The context and modes of operation are described below. From them you can infer how to interact with your user and which tasks and kinds of interactions are expected of you.

Available Presets

lsmcp includes built-in presets for popular language servers:

  • tsgo - TypeScript (Recommended)
  • typescript - typescript-language-server
  • rust-analyzer - Rust Analyser
  • moonbit - MoonBit
  • fsharp - F# (fsautocomplete)
  • deno - Deno TypeScript/JavaScript
  • gopls - Go (Official Go language server)

Configuration

.lsmcp/config.json

{ "$schema": "../node_modules/@mizchi/lsmcp/lsmcp.schema.json", "preset": "tsgo", "settings": { "autoIndex": true, "indexConcurrency": 10 } }

For a comprehensive configuration example, see examples/full-lsmcp-config.json.

Tools

lsmcp provides comprehensive MCP tools for code analysis and manipulation:

Core LSP Tools

  • get_hover - Get type information and documentation for symbols
  • find_references - Find all references to a symbol across the codebase
  • get_definitions - Navigate to symbol definitions with optional code body
  • get_diagnostics - Check for errors and warnings in files
  • get_all_diagnostics - Get diagnostics for entire project
  • get_document_symbols - List all symbols in a file
  • get_workspace_symbols - Search symbols across the entire workspace
  • get_completion - Get code completion suggestions
  • get_signature_help - Get parameter hints for function calls
  • format_document - Format entire documents using language server
  • check_capabilities - Check supported LSP features

Symbol Index Tools

  • index_symbols - Smart incremental indexing with auto-updates
  • search_symbol_from_index - Fast symbol search using pre-built index
  • get_index_stats_from_index - View index statistics and performance
  • clear_index - Clear and rebuild symbol index
  • get_project_overview - Quick project structure and component analysis

Code Editing Tools

  • replace_symbol_body - Replace entire symbol implementations
  • insert_before_symbol - Insert code before symbols
  • insert_after_symbol - Insert code after symbols
  • replace_regex - Advanced regex-based replacements

File System Tools

  • list_dir - List directories with gitignore support
  • find_file - Find files by pattern
  • search_for_pattern - Search text patterns in codebase
  • get_symbols_overview - High-level symbol overview by file

Memory Management

  • list_memories - List project memories
  • read_memory - Read specific memory content
  • write_memory - Create or update memories
  • delete_memory - Remove memories

Development

See CONTRIBUTING.md for detailed development setup, testing instructions, and contribution guidelines.

# Quick start pnpm install pnpm build pnpm test

License

MIT - See LICENSE file for details.

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

A specialized server that provides advanced TypeScript code manipulation and analysis capabilities, enabling refactoring, navigation, diagnostics, and module analysis through Claude.

  1. Quick Start
    1. CRITICAL: PRIORITIZE LSMCP TOOLS FOR CODE ANALYSIS
      1. 🚨 TOOL USAGE PRIORITY
      2. WORKFLOW
      3. WHEN TO USE FALLBACK TOOLS
    2. Memory System
      1. Available Presets
        1. Configuration
      2. Tools
        1. Core LSP Tools
        2. Symbol Index Tools
        3. Code Editing Tools
        4. File System Tools
        5. Memory Management
      3. Development
        1. License

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            The server facilitates natural language interactions for exploring and understanding codebases, providing insights into data models and system architecture using a cost-effective, simple setup with support for existing Claude Pro subscriptions.
            Last updated -
            4
            18
            Python
            • Apple
          • -
            security
            A
            license
            -
            quality
            A comprehensive code analysis and management tool that integrates with Claude Desktop to analyze code at project and file levels, helping adapt changes to projects intelligently.
            Last updated -
            38
            Python
            MIT License
          • -
            security
            A
            license
            -
            quality
            A server that acts as a bridge between Claude and local Xcode projects, enabling AI-powered code assistance, project management, and automated development tasks without exposing your code to the internet.
            Last updated -
            JavaScript
            MIT License
            • Apple
          • A
            security
            A
            license
            A
            quality
            A multi-language code analysis server that helps LLMs or humans automatically lint, type-check, and improve code with minimal installation friction, currently supporting Python with plans for other languages.
            Last updated -
            1
            3
            Python
            MIT License

          View all related MCP servers

          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/mizchi/typescript-mcp'

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