Cover image
Try Now
2025-04-04

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

MCP Server (Language Server Protocol)

A TypeScript-based Language Server Protocol implementation for code reference searching with support for multiple search strategies.

Features

  • 🔍 Fast code reference search using ripgrep
  • 🌐 Web interface for easy searching
  • 💻 Terminal interface for command-line usage
  • 📊 Grouped results by file type
  • 🔄 Fallback search mechanisms
  • 🔥 Hot reload support for development

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or higher)
  • npm (comes with Node.js)
  • Homebrew (for macOS users)
  • ripgrep (recommended for faster searches)

Installation

1. Clone the Repository

git clone <your-repository-url>
cd <repository-name>/src/mcp-server/v1

2. Install Homebrew (macOS only)

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Add Homebrew to PATH (follow the instructions shown after installation)
# Usually these commands:
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# Restart your terminal or run
source ~/.zprofile

3. Install ripgrep

# macOS (using Homebrew)
brew install ripgrep

# Ubuntu/Debian
sudo apt-get update && sudo apt-get install ripgrep

# Fedora
sudo dnf install ripgrep

# Windows (using Chocolatey)
choco install ripgrep

4. Install Dependencies

npm install

Usage

Building the Project

npm run build

Starting the Server

Production Mode

npm run start

Development Mode (with hot reload)

npm run dev

Accessing the Interfaces

  1. Web Interface

    • Open your browser and navigate to: http://localhost:3000
    • Enter your search term and directory
    • View results grouped by file type
  2. Terminal Interface

    • The terminal interface starts automatically with the server
    • Follow the prompts to enter search terms
    • Results will be displayed in the terminal

Search Strategies

The server uses multiple search strategies in the following order:

  1. ripgrep (fastest)

    • Uses regular expressions for exact and partial matches
    • Excludes common directories (node_modules, .git, etc.)
    • Provides line numbers and context
  2. grep (fallback)

    • Used if ripgrep is not available
    • Similar functionality but slower
  3. Node.js (final fallback)

    • Pure JavaScript implementation
    • Used if neither ripgrep nor grep is available

Configuration

Environment Requirements

  • The server automatically checks for required software
  • Provides installation instructions if anything is missing
  • Verifies correct working directory

TypeScript Configuration

  • Target: ES2020
  • Module: CommonJS
  • Strict type checking enabled
  • Source maps generated for debugging

Troubleshooting

Common Issues

  1. Wrong Directory

    • Ensure you're in the src/mcp-server/v1 directory
    • Check the path shown in the environment check
  2. Homebrew Installation

    • If Homebrew commands fail, ensure PATH is configured
    • Check ~/.zprofile for Homebrew configuration
  3. ripgrep Not Found

    • Verify Homebrew is installed and in PATH
    • Try reinstalling: brew reinstall ripgrep
  4. Port Already in Use

    • The server will automatically find an available port
    • Default port is 3000

Error Messages

If you see these errors, try the following:

  1. command not found: brew

    • Reinstall Homebrew
    • Reconfigure PATH
  2. command not found: rg

    • Install ripgrep: brew install ripgrep
    • Verify PATH configuration
  3. EADDRINUSE

    • Port is in use
    • Server will automatically try another port

Development

Available Scripts

  • npm run build: Build the project
  • npm run start: Start in production mode
  • npm run dev: Start with hot reload
  • npm run clean: Clean build output

Adding New Features

  1. Modify server.ts for core functionality
  2. Update index.html for web interface changes
  3. Run in dev mode to test changes
  4. Build and restart to apply

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • HiveNexus
  • 一个适用于中小型团队的AI聊天机器人,支持DeepSeek,Open AI,Claude和Gemini等车型。 专为中小团队设计的ai聊天应用,支持deepSeek,打开ai,claude,双子座等模型。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • JackKuo666
  • 🔍使AI助手可以通过简单的MCP接口搜索和访问PYPI软件包信息。

    Reviews

    5 (1)
    Avatar
    user_vf3EoJmw
    2025-04-17

    I am thoroughly impressed with mcp-server. Created by the talented Meeneshsolanki, this tool is an indispensable addition to my software stack. Its robust functionality and ease of use streamline my server management like never before. The clear documentation and active community support make it even better. Highly recommended to anyone in need of a reliable server solution!