
Sublime Text MCP
io.github.dpc00由 GitHub 账号 dpc00 发布v1.7.5更新于 Nov 10, 2026
MCP server for Sublime Text 4. Lets AI coding agents read and control a running ST instance.
发布方自己的服务:Sublime
概览
把 AI 代理连接到正在运行的 Sublime Text 4,使其能执行编辑器命令、读写视图、查看标签与项目并操作界面。
- 可以做什么
- 执行 Sublime 命令,检索完整的类型化能力目录并批量调用
- 读写视图与选区、保存文件,并进行基于字符串替换的编辑
- 查看标签页、项目状态、快捷面板、菜单、视图区域与 phantom
- 截取 Sublime 窗口画面,并在面板和对话框中按键、输入、点击或悬停
- 在 Sublime 插件宿主中执行 Python,以覆盖类型化工具未涉及的操作
- 通过资源占用声明让多个代理轮流使用同一个编辑器
- 适用场景
- 适合需要代理直接在运行中的 Sublime Text 4 里工作,而不只是处理文件的场景:浏览和编辑缓冲区、运行编辑器或插件命令、检查界面。也适合驱动已安装的调试器或语言服务器等插件,而无需为其单独配置 MCP 服务器。
- 运行要求
- 本机安装 Sublime Text 4,将 sublime-mcp 插件链接到其 Packages 目录并保持编辑器运行,服务器随插件启动。客户端连接本机回环的 streamable-HTTP 地址(Windows 默认端口 9502,macOS/Linux 为 9503),也可选用 Node 或 Python 代理。端口在插件设置文件中修改,无需环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Sublime Text MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Sublime-MCP: Universal AI Agent Connector for Sublime Text
Gives any MCP-speaking AI agent real control over a running Sublime Text 4
instance: run registered ST commands, read/write views and selections, inspect
tabs and project state, and eval_python in Sublime's plugin host for anything
the typed tools don't cover.
Controlling another installed Sublime package (a debugger, a language server,
anything else) doesn't need its own dedicated MCP server — get_package_mcp_info
plus eval_python/run_command covers it directly. See skills/package-skill-generator
to turn a one-time investigation into a small, reusable skill file instead.
Toolset
Eight workflow tools are advertised by default (discover_tools, batch,
get_help, get_active_file, project_search, save_file,
str_replace_based_edit_tool, ui_screenshot). discover_tools lists a tree of
categories (category=) or searches (query=) the
complete internal catalog of 379 typed Sublime capabilities, and batch invokes
discovered capabilities without flooding the model's initial tool context.
Since 1.9.0, 160 of those tools are generated wrappers named after Sublime Text's
own commands (tools/generate_st_command_tools.py, data in
tools/st_commands_metadata.json); what each was observed to do on a bare
Sublime Text 4215 is in tools/st_commands_behavior.json, and the hand-written
tools' behaviour is in tools/st_hand_written_behavior.json. Since 1.10.0,
list_native_windows and dismiss_native_window (Windows) list and dismiss a
native dialog or menu while it blocks Sublime's main thread. See
AGENT_GUIDE.md.
What it can do now (1.10 to 1.13)
- See and operate Sublime's own windows (Windows only, 1.13).
ui_screenshotreturns a real image of any Sublime window, also one behind others, an open dialog or menu (kind,window_title), a not-front tab (tab), cropped or zoomed (region,scale,max_width); it is one of the eight default tools, and the image reaches the client as an image, also throughbatchand the proxies.ui_press_key,ui_type_text,ui_clickandui_hover(with a picture of the popup, including language-server hovers) operate palettes, quick panels and menus. Real mouse and keys wait until the person at the computer has been idle (wait_idle_s), so they never type over them. - Work through native dialogs (1.10, 1.12.4).
list_native_windowsanddismiss_native_windowlist and dismiss a dialog or menu that has blocked Sublime's main thread;close_filewithdiscardcloses a tab with unsaved edits without the Save Changes dialog. - Drive quick panels and menus (1.12).
get_quick_panel,pick_quick_panel(withwait_msfor a list that is still loading) andclick_menu_item;get_view_regionsandget_view_phantoms(withlast,html,max_chars) inspect what a plugin drew. Panels of older Python 3.3 packages are visible with"install_py33_helper": true(1.16, off by default); a pick whose callback opens a dialog answerspending(1.16.1) and the dialog is answered withdismiss_native_window. - Dialogs and tabs (1.18).
list_native_windowsreads the message of a Windows task dialog (Package Control's "needs to be restarted" text) and answers while a dialog blocks Sublime;dismiss_native_windowclicks again if the first click is dropped and can cancel the Windows file-operation progress window.close_fileneeds apath,nameorindexand never closes the active tab. Theinstall_packageandsearch_packagestools are gone: installing and searching are Package Control's job, so drive its own picker withrun_commandandpick_quick_panel. - Share one Sublime between agents (1.12.0).
claim_resource,release_resourceandlist_claimslet agents take turns on the input and control panels. - Safer by default. Browser-origin requests are refused (1.12.2), the
visible-console read only touches Sublime's own window and restores focus and
clipboard (1.12.1),
eval_pythoncannot take down the plugin host withsys.exit()(1.12.3), and Windows-only tools are hidden on other platforms (1.11.2). - A tool tree (1.11).
discover_toolswith no arguments walks 12 categories instead of dumping a catalog.
Agent how-to: AGENT_GUIDE.md (also served live by
get_help). Release history: CHANGELOG.md.
Ports
sublime-mcp serves MCP streamable HTTP at /mcp, legacy MCP SSE at
/sse, and a plain HTTP bridge.
The bundled Node/Python proxies use sublime-mcp's HTTP bridge only. Defaults:
The settings file takes "mcp_port" and "http_port" keys; edit your copy
under Packages/User/ (Preferences > Package Settings) to override the
defaults above — no env vars needed.
SSE URL form: http://127.0.0.1:<sse-port>/sse. The bundled Node/Python
proxies talk to sublime-mcp's HTTP bridge, not SSE; override with
SUBLIME_MCP_BASE (e.g. http://127.0.0.1:9500).
Security
Both servers are loopback-only (127.0.0.1) by default and have no
authentication — one of the tools they expose (eval_python) is
arbitrary code execution in Sublime's own process, so treat this server
as equivalent in trust level to your own login session. All of the
following are keys in MCP Commander.sublime-settings:
allow_lan_access(defaultfalse) — binds0.0.0.0instead of127.0.0.1, making both servers reachable from every other device on your network, still with no authentication. Only turn this on for a specific reason a client can't reach127.0.0.1directly (e.g. a WSL client when WSL's networking mode doesn't forward localhost to the Windows host).auth_token(default unset) — requires a matchingAuthorization: Bearer <token>header on every request. This is the one control that works regardless of bind address, since loopback-only doesn't protect against another process, or another user on a shared/multi-user machine, reaching127.0.0.1on the same host. Generate a real random value yourself; don't use a short or guessable string. Not every MCP client UI exposes custom headers — check yours supports one before relying on this. If you connect through the bundled Node/Python proxy instead of a direct SSE/HTTP URL, set the same value asSUBLIME_MCP_TOKENin the proxy process's environment.disabled_tools(default[]) — a list of tool names to refuse and hide from discovery entirely, e.g.["eval_python", "run_command"]to remove the two tools with the broadest reach while keeping the rest of the server usable.
Browsers are kept out in two ways. The real tool-call endpoints send no
Access-Control-Allow-Origin header, and, because a missing CORS header does
not stop a request from being sent, with no auth_token and the default
loopback bind they also refuse any request whose Origin or Host header
names something other than loopback (including Origin: null). Command-line and desktop MCP clients send no Origin and are
not affected. This does not protect against another process on the same
machine: set auth_token for that.
Installation
1. Install the Sublime Text plugin
Manual (also the path for developing sublime-mcp itself):
The repo root is the package. Symlink it into ST's Packages/ directory as sublime-mcp.
Windows (Command Prompt):
macOS:
Linux:
Restart Sublime Text after linking so the plugin loads.
2. Configure your agent
Point your agent straight at the server the plugin starts inside Sublime Text.
No helper program is needed. Use the streamable-HTTP URL if your client
supports it (Codex example; no mcp-remote wrapper is required):
Optional proxies. Only for clients that cannot connect to a URL directly, a small Node or Python proxy can sit in between:
Restart or open a new Codex session after changing MCP configuration. Verify the entire path before debugging agent behavior:
The report checks the HTTP bridge, MCP handshake, and focused tool catalog.
From Sublime's Command Palette, MCP Commander: Connection Doctor shows the
main server-side state. (Controlling a debugger or language server doesn't
need its own MCP server or doctor check — see "Toolset" above and
skills/package-skill-generator.)
Other MCP clients that take a JSON config (oh-my-pi, Claude Code, Cursor) use the same streamable-HTTP URL (Windows example):
Only a client that cannot do streamable HTTP needs the deprecated SSE URL,
"type": "sse" with http://127.0.0.1:9502/sse.
The MCP server starts automatically when ST loads the plugin. To stop or restart it, run "MCP Commander: Server Status" from the Command Palette. Check View > Show Console for startup confirmation.
Agent skill
Two skills ship with sublime-mcp: skills/sublime-mcp (how an agent uses the
tools) and skills/package-skill-generator (how to generate a small skill for
any Sublime package you use, such as a language server or a debugger). Copy the
directories to your agent's skills directory or install them through your normal
skill workflow. Skills for individual packages are not shipped: generate your own
with the generator.
来源:README.md,提交 6471566
工具
0版本历史
1- v1.7.5最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
