Skip to main content
Glama
rajnaveen344

LSP Tools MCP Server

by rajnaveen344
README.md
# LSP Tools MCP Server

A Model Context Protocol (MCP) server providing Language Server Protocol-like functionality for text analysis.

## Features

- **Find Regex Position**: Find the 0-indexed line and column positions of regex pattern matches in a file
- **List Allowed Directories**: Get a list of directories the server is allowed to access

## Installation

```bash
npm install
npm run build
```

## Usage

```bash
# Start the server allowing access to a specific directory
node dist/index.js /path/to/allowed/directory

# Start the server with multiple allowed directories
node dist/index.js /path/to/dir1 /path/to/dir2 /path/to/dir3
```

## Development

### Running Tests

The project uses Jest for testing. Run the tests with:

```bash
npm test
```

To run tests in watch mode during development:

```bash
npm run test:watch
```

### Linting

Lint the code with ESLint:

```bash
npm run lint
```

## Tool Documentation

### find_regex_position

This tool finds the 0-indexed line and column positions of regex pattern matches in a file.

**Parameters:**
- `path`: The path to the file to search in
- `regex`: The regular expression pattern to search for

**Returns:**
- An array of matches with the following properties:
  - `match`: The matched text
  - `line`: The starting line (0-indexed)
  - `column`: The starting column (0-indexed)
  - `endLine`: The ending line (0-indexed)
  - `endColumn`: The ending column (0-indexed, exclusive)

### list_allowed_directories

This tool lists all directories that this server is allowed to access.

**Parameters:**
- None

**Returns:**
- An array of absolute paths to allowed directories

## License

MIT

TDQS

A4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have completely distinct purposes with no overlap. find_regex_position performs a specific text search operation on files, while list_allowed_directories provides metadata about server permissions. An agent would never confuse these tools as they serve fundamentally different functions in the workflow.

Naming Consistency4/5

Both tools follow a clear verb_noun naming pattern (find_regex_position, list_allowed_directories) with consistent snake_case formatting. The naming is logical and predictable, though with only two tools it's difficult to assess full consistency across a larger set.

Tool Count2/5

With only 2 tools, this server feels severely underpowered for an LSP (Language Server Protocol) context. LSP servers typically handle numerous language operations like diagnostics, completions, definitions, and references. This minimal toolset suggests either an incomplete implementation or a very narrow specialization that doesn't match typical LSP expectations.

Completeness2/5

For an LSP server, this toolset is severely incomplete. While the two provided tools are useful (file search and directory listing), they represent only a tiny fraction of expected LSP functionality. Missing are core language features like code completion, hover information, go-to-definition, references, diagnostics, formatting, and other standard LSP capabilities that agents would expect from such a server.

Maintenance

ActivityInactive
ResponsivenessNo issues