Locus

Locus

MCP server that gives AI coding agents codebase navigation intelligence, enabling symbol lookup, reference finding, type inspection, and diagnostics through tools like locate, refs, hover, diagnostics, status, and rename.

Category
访问服务器

README

Locus

npm version License: MIT Node.js CI Website

Locus gives your AI coding agent a map of your codebase. Whether you write code yourself or work through Cursor, Codex, or Claude Code, Locus connects your agent to the same go-to-definition and find-references intelligence your IDE uses — through MCP (Model Context Protocol), a standard plug-in layer for AI tools. Configure it once; your agent uses six small tools to find symbols, trace callers, read types, and catch errors before you run tests.

Why you might want this

  • Find the real definition — Your agent can locate UserService.authenticate even when it is re-exported, overloaded, or buried in a large file — not just wherever the name appears as text.
  • See who calls what — Before a refactor, list every reference to a function or class so nothing breaks silently.
  • Read types and docs — Ask what a variable or parameter actually is, without guessing from variable names.
  • Catch errors early — Surface compiler and linter problems right after an edit, instead of waiting for a full test run.

Who this is for

Locus is for AI-first builders: developers, indie hackers, and PMs who work through an agent and want it to understand code structure, not just search strings.

It fits when your agent already edits files well (Cursor's Edit tool, Claude Code, Codex) and you want to add semantic navigation on top — without turning your setup into a second IDE inside MCP.

It is not for people who want symbolic editing, agent memory, or a full refactoring toolkit inside MCP. For that, look at Serena — a broader option that does more inside the protocol. Locus stays intentionally small: six tools, npx install, complements your host.

Get started in 5 minutes

  1. Install a language server (if you do not have one yet) — for TypeScript/JavaScript: npm install -g typescript-language-server typescript. See Installing language servers for Python, Go, and Rust.
  2. Run one-time setup in your project folder:
    npx @paladini/locus-mcp init
    npx @paladini/locus-mcp check
    
  3. Add Locus to your agent's MCP config — MCP is how AI hosts call helper tools like Locus; copy a block from Copy-paste configs below and set cwd to your project's absolute path.
  4. Reload MCP — restart Cursor, reload Codex, or reopen Claude Code so the new server appears.
  5. Try a prompt — ask your agent: "Use Locus to find where UserService is defined and list all references." If it calls the locate and refs tools, you are set.

Requirements: Node.js 22+. Language servers on your PATH for the languages you use.

Copy-paste configs

Your agent host spawns Locus automatically — you never run serve by hand during normal use.

Cursor

Create or edit .cursor/mcp.json in your project (or global Cursor MCP settings):

{
  "mcpServers": {
    "locus": {
      "command": "npx",
      "args": ["-y", "@paladini/locus-mcp", "serve"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}

Codex

Add to ~/.codex/config.toml (global) or .codex/config.toml (project):

[mcp_servers.locus]
command = "npx"
args = ["-y", "@paladini/locus-mcp", "serve"]
cwd = "/absolute/path/to/your/project"

For a project-scoped config, you can use cwd = "." instead.

Claude Code

Add to Claude Code MCP settings:

{
  "mcpServers": {
    "locus": {
      "command": "npx",
      "args": ["-y", "@paladini/locus-mcp", "serve"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}

More detail (local dev, troubleshooting): docs/usage.md

Example prompts to try

Paste these into your agent after Locus is configured:

  • "Find where UserService is defined. Use Locus locate, not grep."
  • "Before we rename parseConfig, use Locus to list every file that calls it."
  • "What type does response.data have in src/api/handler.ts? Use Locus hover."
  • "After your edits, run Locus diagnostics on the files you changed and fix any errors."
  • "Check Locus status — are the language servers ready?"

What Locus does NOT do

  • Edit your code — Your agent's Edit/Write tools still apply changes. Locus only reads structure and diagnostics.
  • Replace grep — Grep is still best for log lines, config keys, comments, and plain text search.
  • Remember things between sessions — No agent memory store; each session starts fresh.
  • Run refactors for you — rename previews impact; your agent applies the actual edits.
  • Expose every LSP feature — Six focused tools only, not a full IDE protocol passthrough.
  • Compete with large toolkits — If you need symbolic body replacement, memory, and 40+ languages in one MCP stack, consider Serena instead.

Tools at a glance

Tool What it does
locate Find a symbol by name or list symbols in a file
refs All references or implementations at a position
hover Type information and documentation
diagnostics File or workspace errors and warnings
status Language-server readiness and missing binaries
rename Preview a rename (dry-run; apply via your agent)

Learn more

Guide Description
Usage guide Step-by-step setup, workflows, troubleshooting
Getting started First-time setup — no LSP knowledge required
FAQ Do I need to be a programmer? What's MCP?
Who is Locus for? Fit, scope, and when to pick alternatives
Comparison Locus vs Serena, bridges, and grep
Tools reference All six MCP tools with examples
Configuration locus.toml, locus.json, language servers
Website Lightweight positioning and quick overview

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选