nimlangserver MCP

nimlangserver is an MCP server for Nim: agents find symbols and references, check files and resolve types from compiler data

  • 317 ★ on the repository
  • Last commit
  • MIT
MCP serverOfficial

Extended access

Why this level

  • Diagnostics run the Nim compiler and macros execute at compile time, so open only trusted projects
  • The server reads the project sources and runs `nimsuggest` as a child process
All reasons and checks

nim-lang/langserver

Install

Manual install

nimble install -g nimlangserver

Needs Nim 1.6.8 or newer and nimble 0.16.1 or newer. The binary lands in `$HOME/.nimble/bin`.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Diagnostics run the Nim compiler and macros execute at compile time, so open only trusted projects
  • The server reads the project sources and runs `nimsuggest` as a child process

This is third-party code. Review the repository files before installing.

What it does

nimlangserver is the language server for Nim from the nim-lang team. By default it serves editors over LSP, and with the `--mcp` flag it becomes an MCP server for AI agents. The agent gets six tools: `nimFindSymbols` searches symbols by name, `nimFindReferences` finds every reference to a symbol, `nimFindTypeDefinition` goes to a type definition, `nimListSymbols` lists the symbols of a file, and `nimCheckFile` and `nimCheckProject` return compiler diagnostics. The server parses Nim the way the compiler does, so it finds names spelled differently (`printThing`, `printthing`, `print_thing`) and calls made through templates and macros. Plain text search misses such places. In the documentation example a function has four usages, and without MCP the agent finds one of them. Alongside the server the repository ships the `nim-mcp-tools` skill in a SKILL.md file. It tells the agent to try the MCP tools first and fall back to grep only on error or with the user's consent. Setup is: the server through nimble, `.mcp.json` in the project root, SKILL.md in `.claude/skills/nim-mcp-tools/`.

Who it is for. Nim programmers who edit code with Claude Code, GitHub Copilot CLI, Gemini CLI or OpenCode.

Good fit when

  • The symbol `Foo` has to be renamed everywhere, including calls with other casing and underscores
  • The agent must find where a symbol comes from, what type it has and what fields it holds, private ones included
  • After an edit you need compiler errors, warnings and hints for one file or the whole project
  • The project uses templates and macros, and text search loses part of the calls
  • The editor is VS Code: the vscode-nim extension brings LSP, MCP and the skill together

Not a fit when

  • The code is not written in Nim: the tools target Nim and its compiler
  • You need a server for another language or several at once: general LSP and MCP bridges fit that
  • The environment lacks Nim 1.6.8 or newer, nimble 0.16.1 or newer and a `nimsuggest` with `--v3` support
  • The project is untrusted: diagnostics run the compiler, and Nim macros execute at compile time

Example request

Find all usages of the parseConfig proc, including calls through templates, and rename it to loadConfig

MCP

Transport
stdio
Authentication
not required

Limitations

  • The server builds from source through nimble and needs Nim 1.6.8 or newer, nimble 0.16.1 or newer and a `nimsuggest` with `--v3` support.
  • Setup for Claude Code is manual: copy `.mcp.json` into the project and put SKILL.md into `.claude/skills/nim-mcp-tools/`. In VS Code everything arrives with the extension.
  • Load the skill with `/nim-mcp-tools` before working, otherwise the agent may search with grep.
  • On Windows the author recommends WSL and keeping projects in its file system.

How to disable. Remove the `nim` entry from `.mcp.json` and the `.claude/skills/nim-mcp-tools/` folder. The server itself is removed through nimble with `nimble uninstall nimlangserver`.

FAQ

How do I connect nimlangserver to Claude Code as an MCP server?

Install the server with `nimble install -g nimlangserver`, copy `.mcp.json` from the repository into the project root and put SKILL.md into `.claude/skills/nim-mcp-tools/`. In `.mcp.json` the server starts with the `nimlangserver` command and the `--mcp` argument.

Which tools does the server expose?

Six: `nimFindSymbols`, `nimFindReferences`, `nimFindTypeDefinition`, `nimListSymbols`, `nimCheckFile` and `nimCheckProject`. The first four navigate symbols and types, the last two return compiler diagnostics.

Why is it better than grep for Nim code?

It understands Nim's name resolution rules. One identifier is written `printThing`, `printthing` or `print_thing` and may also be called through a template, and grep misses such places. The server finds them from compiler data.

Does the editor need a separate LSP server?

No, the same binary works in two modes. Without flags it serves editors over LSP, and with `--mcp` it exposes tools to agents.

Does it work with agents other than Claude Code?

Yes, the documentation covers GitHub Copilot CLI, Gemini CLI and OpenCode. The config files differ: `.mcp.json`, `.gemini/settings.json`, `opencode.json`, and SKILL.md goes into that agent's skills folder.

Discussion

No questions or reviews yet.

A bridge from an LSP language server to the agent: definitions, references, diagnostics, hover and symbol rename

MCP serverExtended access1.6KRepository stars

An MCP to LSP bridge: the agent gets types, references, diagnostics and refactoring from rust-analyzer, pyright and gopls.

MCP serverExtended access81Repository stars

MCP server for the Lean 4 language server: an agent reads proof goals and errors and searches for theorems inside your project

MCP serverExtended access550Repository stars

An MCP server giving AI agents access to your running Neovim session through its native msgpack-RPC socket, with no plugins.

MCP serverBroad access67Repository stars

mcpdoc

MCP LLMS-TXT Documentation Server

An MCP server from LangChain that serves docs from the llms.txt files you choose, with auditable tool calls

MCP serverExtended access1KRepository stars
Official

A command-line debugger for MCP servers from Giant Swarm: a REPL for tools, OAuth 2.1 and an MCP server mode for Cursor

CLIExtended access38Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
nimlangserver (this card)yesnot required317
cclspnonot required675a general bridge from LSP to MCP for many languages, while nimlangserver has a built-in MCP mode made for Nim
Serenanonot required31,335semantic IDE tools for many languages, while nimlangserver covers only Nim

README in short

The README briefly presents nimlangserver as a language server with LSP and MCP modes, gives the nimble install command, asciinema demos and a link to the documentation. The details on MCP, the tool list and the rename example sit in the documentation book, in the mcp section.

README badge

Report a problem