# Periscope [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/qompassai/periscope  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/periscope-2

## Description
MCP broker into your live Neovim/diver config: LSP, formatters, linters, DAP, MATE attention.

## Tools
Capabilities this server exposes over MCP:

- **attention_alignment** — Alignment between your published focus and a partner agent's, measured only inside one saliency snapshot frame (Jaccard overlap, shared targets, shared top); refused across frames
- **attention_decide** — Coordination decision against a partner agent's focus: parallel (no contention), serialize (same top target — the named holder proceeds, you defer), or reject (stale frame or invalid focus — re-snapshot, never guess)
- **attention_focus** — A partner agent's currently advertised focus (ordered salient targets + the snapshot hash it was computed from) from the coordination board
- **attention_publish** — Publish your focus to the coordination board: a focus document `{agent_id, snapshot_hash, seq, targets[]}` (at most 8 targets); the agent_id must equal your client identity and sequences must strictly advance
- **broker_status** — mode, Neovim version, cwd, config root
- **get_definition** — merged definition locations across attached clients
- **get_diagnostics** — buffer diagnostics from `vim.diagnostic` (LSP + linter pipelines), with the producing `source` named on every entry
- **get_document_symbols** — flattened symbol outline with containers
- **get_hover** — hover text at a position
- **get_references** — merged reference locations across attached clients
- **list_dap** — DAP modules in the config tree plus adapters/configurations registered in the session
- **list_formatters** — formatter modules in the config tree
- **list_linters** — linter modules in the config tree (underscore-prefixed modules reported as internal)
- **list_servers** — LSP servers configured in the tree, plus servers attached to any open buffer
- **run_format** — Format a file with the config's formatter pipeline (`require('formatters')`); optional explicit formatter names and LSP mode (`fallback` / `never` / `only`); returns status, `changed`, the steps that ran, and the formatted text
- **run_lint** — Lint a file with the config's linter runner (`require('linters')`); optional explicit linter names, otherwise the filetype's configured set; returns per-linter status, exit code, and diagnostics (each naming its linter in `source`)

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What Periscope does

Periscope connects an MCP client to a real Neovim process and exposes information from the configuration loaded by that editor. The broker can report Neovim state, configured and attached language servers, formatter and linter modules, DAP modules, diagnostics, symbols, hover text, definitions, and references.

Its execution capabilities are deliberately limited to the editor's existing pipelines. `run_format` invokes the configuration's formatter pipeline and returns the formatting result as text. `run_lint` invokes the configured linter runner and returns per-linter status, exit codes, and diagnostics. Formatting changes the brokered buffer but does not write the file to disk.

Four attention tools provide a separate coordination board for agents. Agents can publish an ordered focus, inspect another agent's focus, compare focus documents from the same saliency snapshot, and request a parallel, serialize, or reject decision.

## How it works

Periscope is a single Rust executable. MCP traffic uses stdio with NDJSON JSON-RPC, while communication with Neovim uses msgpack-RPC. In managed mode, the default, it starts `nvim --headless` with a temporary listening socket and the selected workspace as its working directory. The configuration loads in that process, with project-local config execution disabled through `noexrc`.

Attach mode uses `--attach <socket>` to connect to an existing Neovim process started with `--listen`. Periscope does not signal or close an editor it did not start. Its tools execute small Lua programs inside Neovim through `nvim_exec_lua` and use native APIs such as `vim.lsp` and `vim.diagnostic`.

LSP calls poll while servers report progress. Positions use zero-based lines and UTF-16 character offsets, following LSP conventions. Attention state remains in the server process and is discarded when that process exits.

## Setup and configuration

Run the binary with the following options:

- `--workspace <dir>` selects the directory where managed Neovim starts; it defaults to the current directory.
- `--attach <socket>` connects to an already running listening Neovim instance instead of starting one.
- `--nvim-bin <path>` selects the Neovim executable.

Register Periscope as a stdio MCP server in the client that manages MCP connections. A configuration can provide the executable path and arguments, including a workspace or attach socket. The example integration uses a `declared_servers` entry in `lua/ai/mcp/declared_servers.lua`; its `cmd`, arguments, and timeout should be adapted to the local installation.

## Tools and capabilities

Read-oriented tools include `broker_status`, `get_diagnostics`, `get_definition`, `get_document_symbols`, `get_hover`, `get_references`, `list_dap`, `list_formatters`, `list_linters`, and `list_servers`. Diagnostics identify their producing source, while symbol results include containers and server listings combine configured servers with those attached to open buffers.

`run_format` accepts optional formatter names and an LSP mode of `fallback`, `never`, or `only`. `run_lint` can use named linters or the filetype's configured set. The attention tools enforce client identity and advancing sequence numbers when agents publish focus documents, which contain an agent ID, snapshot hash, sequence, and up to eight targets.

## Limitations and notes

The transport is stdio-only; Periscope does not listen on a network port. Managed Neovim uses a private temporary socket that is removed during shutdown, and the broker reaps the child it created. No tool writes files, renames symbols, starts a debug session, or persists attention state.

Calls have bounded waits and result sizes: editor attachment is limited to 20 seconds, LSP request processing to 30 seconds, diagnostic settling to 5 seconds, connection setup to 10 seconds, and editor readiness to 20 seconds. Results are capped at 500 diagnostics locations, 1,000 document symbols with depth six, and 500 definition or reference locations. MCP input lines are capped at 4 MiB, and forwarded editor errors at 512 characters. Tool failures are returned as in-band MCP `isError` results.

_Full upstream README: https://allmcps.com/mcp/periscope-2/readme_

