Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Limits and Known Constraints

In this chapter you find every boundary mcpls enforces or cannot cross, in one place. Use it to plan a deployment, and to recognize a limit when a result looks cut short.

Prerequisites

Resource limits you can configure

LimitDefaultWhere to change it
Open documents100 (least recently used closed first)workspace.max_documents
Largest file opened10 MiB (at most 1 GiB)workspace.max_file_size
Servers starting at once8workspace.max_concurrent_server_starts
Wait for indexing30 s (above 3, below 60)workspace.indexing_ready_timeout_seconds
Handshake timeout30 s (1 to 900)timeout_seconds
Request timeout30 s (1 to 900)request_timeout_seconds
Project-marker search depth10 (at most 64)workspace.heuristics_max_depth
mcp.title, description, instructions, tool_prefix128, 1024, 4096 and 32 bytes[mcp]

Limits that are fixed

LimitValue
Completion request10 s, whatever request_timeout_seconds says
Retries on “content modified”4 attempts, 3.5 s of total backoff
shutdown request to a server5 s
Child exit grace after shutdown3 s
restart_server cooldown5 s per server
Respawn backoff1 s growing to 30 s
Server ids per restart_server call64
Diagnostics cache1000 files
Server log buffer, server message buffer100 and 50 entries
Subscriptions per session1000
Diagnostics sweepevery 2 s; 64 subscribed files per tick; 256 unsubscribed companion files per server
Server env table128 KiB in total; 128 KiB per entry (32767 characters on Windows)
Concurrent subscriptions/listen streams100
Enclosing-symbol enrichment16 files (or max_documents / 4 when max_documents is below 64), 30 s
Per-response disk read for position conversion4 times max_file_size, at most 256 MiB
symbol_source200 lines and 16 KiB per item; per call 64 KiB of text, 256 distinct spans and 16 MiB of document text examined; the rest is call_budget
Text argumentsnew_name, query 1,000 bytes; symbol_name 256 bytes; trigger 8 bytes; line and character 1 to 1,000,000
workspace/configuration reply to a server256 items and 4 MiB; more items are answered -32602, a larger reply -32603
Result listsCapped per tool; truncated: true marks a cut
Stdio line4 MiB; see Message size limit
LSP frame from a serverUp to 10 MiB is read; 10 to 256 MiB is skipped; above 256 MiB the connection closes

Behavioral constraints

  • mcpls does not write your files. Edits are returned for the client to apply.
  • Routing is by extension. file_patterns cannot confine a server to a directory, and two servers that claim the same extension both receive every file with it unless handles separates them.
  • file_patterns forms. Only *.EXT (with an optional **/ prefix) and bare extensionless names such as Makefile are accepted. Brace expansion, character classes, ?, dotfiles, dotted names, single files and multi-part extensions such as *.tar.gz are rejected at startup.
  • workspace_symbol_search has no document. It asks every server that claims workspace_symbols or is a catch-all, and reports what each one did (see Code Intelligence). It fails only if no server answers.
  • A configuration file replaces the built-in server list. A file with no [[lsp_servers]] starts no servers.
  • Same-size restores are invisible. A file restored with an identical size and modification time is not seen as changed; see Troubleshooting.
  • Position conversion can degrade for non-UTF-16 servers (Positions and Encodings).
  • Not every server supports every tool. Use get_tool_support.
  • Servers see a reduced environment. Restore variables through env.

Stdio replies to requests that cannot be served

A stdio line that mcpls cannot hand to the MCP SDK is answered instead of dropped, when it is a request whose method and id could be read:

LineReply
Larger than 4 MiB-32600 with the request id
Not valid JSON, or nested 125 levels deep or more (the JSON recursion limit; 124 still works)-32700 with the request id
Cut off or broken after its method and a complete id-32700 with the request id
Valid JSON that is not a JSON-RPC message, or a request the SDK skips (a notifications/* method with an id whose full decode fails for another reason, for example a params that is not an object)-32600 with the request id
id and nothing else, or an id that is not an integer or a string-32600 without an id

A notifications/* request with an id and no params or object params decodes normally, so the SDK answers it -32601 (method not found) with the request id. Notifications and responses (result or error) get no reply, and mcpls never echoes the id of a response. A line cut off inside a string id, or whose id or method key uses escapes such as "\u0069d", gets no reply because the id cannot be trusted. The session stays open in every case, and mcpls logs a warning at most once a minute for such lines.

Oversized language server frames

A language server message larger than 10 MiB is not fatal. Up to 256 MiB, mcpls skips the frame in constant memory and fails only the request it answers: a tool call waiting on it returns an error, a request the server sent is answered -32600, and a notification is dropped. A dropped textDocument/publishDiagnostics marks its file evicted until the server publishes it again. When the file cannot be read from the frame, every file the server reported on is marked the same way, and files it never reported on read evicted only until the server’s next write. The connection stays up and later messages are read. A frame announced above 256 MiB closes the connection, so a server that streams without end is still stopped.

While mcpls skips a frame it cannot read anything else from that server. A server that announces a large frame and then stops writing leaves its requests timing out until you call restart_server. The same holds for a stalled frame under 10 MiB, over a window 25 times narrower.

If a result is too large for a single frame, narrow the query (limit, kind_filter, a smaller range) rather than raising any limit; the frame limit is fixed.

Transport constraints

  • HTTP is opt-in at build time (transport-http) and absent from prebuilt binaries and the Docker image.
  • HTTP/1 only. No HTTP/2.
  • No authentication on any transport. Use loopback or an authenticating reverse proxy.
  • No wildcards in the Host and Origin allowlists.

Security constraints

  • mcpls does not sandbox language servers; an allowed server runs workspace code.
  • The tsserver pin does not cover version-manager shims, package runners or relative-script wrappers.
  • Untrusted mode does not check interpreter arguments or launchers that choose the server from workspace files (Untrusted-Workspace Mode).
  • Redaction does not cover URIs, diagnostic data keys, or tool results such as hover text (Diagnostics and Resources).
  • Platform notes: the Windows launch of the native TypeScript server and the Windows USERPROFILE replacement were verified less than the Unix paths. Where a Windows layout is covered only by unit tests, prefer explicit absolute paths.

What’s Next

For a lookup of every flag and key, go to the Command Line and Environment and Configuration Reference pages.