Skip to main content
Glama
eloquentix
by eloquentix

metals-mcp

MCP wrapper for Metals (Scala language server) that adds file editing and refactoring tools.

Prerequisites

  • Node.js 22+

  • metals-mcp binary on PATH (or set METALS_MCP_PATH)

Related MCP server: ast-editor

Install

npm install

Usage

Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "metals": {
      "command": "npx",
      "args": ["tsx", "src/index.ts", "--workspace", "/path/to/scala/project"]
    }
  }
}

Or globally in ~/.claude.json:

{
  "mcpServers": {
    "metals": {
      "command": "npx",
      "args": ["--prefix", "/path/to/metals-mcp", "tsx", "src/index.ts", "--workspace", "/path/to/scala/project"]
    }
  }
}

Manual

npx tsx src/index.ts --workspace /path/to/scala/project

Tools

File operations: read-file, write-file, edit-file, list-files

Refactoring: rename-symbol, add-import, remove-unused-imports

All Metals tools are also proxied transparently when Metals connects.

Configuration

Option

Description

--workspace <path>

Scala project root (required)

METALS_MCP_PATH

Custom path to metals-mcp binary

ERR_MODULE_NOT_FOUND or "Failed to reconnect to metals"

If the MCP server is configured in .mcp.json with a relative path for the entry point:

{
  "mcpServers": {
    "metals": {
      "command": "npx",
      "args": ["--prefix", "/path/to/metals-lsp", "tsx", "src/index.ts"]
    }
  }
}

The npx --prefix flag sets the package lookup directory, but the working directory remains the project being edited. The relative src/index.ts resolves against the workspace, not the plugin directory, causing the module-not-found error.

Fix: Use an absolute path for the entry point:

{
  "mcpServers": {
    "metals": {
      "command": "npx",
      "args": ["--prefix", "/path/to/metals-lsp", "tsx", "/path/to/metals-lsp/src/index.ts"]
    }
  }
}
F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (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 Servers

  • A
    license
    -
    quality
    D
    maintenance
    Exposes Language Server Protocol (LSP) features as MCP tools, enabling IDE-grade semantic navigation including go-to-definition, find references, hover info, and symbols across multiple programming languages (Python, Rust, C/C++, TypeScript/JavaScript, React, HTML, CSS).
    Last updated
    3
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    AST-targeted code editing MCP server with 28 surgical tools for structural edits across 11 languages. Built on tree-sitter, replaces brittle search/replace with byte-correct edits keyed by symbol names.
    Last updated
    28
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A TypeScript/JavaScript refactoring MCP server that uses the TypeScript compiler to perform safe, type-aware code transformations such as renaming, extracting functions, and organizing imports across your codebase.
    Last updated
    4
    262
    12
    MIT

View all related MCP servers

Related MCP Connectors

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/eloquentix/metals-mcp'

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