Stationeers MCP Neovim插件

一个Neovim插件,用于连接StationeersLua MCP服务器,提供芯片读写、日志流、错误检查和文档搜索功能,无需离开编辑器。

  • by andrew-d-moore
  • Lua
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 andrew-d-moore/stationeers-mcp.nvim

使用说明

stationeers-mcp.nvim 网站

一个连接到 StationeersLua MCP服务器 跑步 在您的游戏客户端中,为您提供完整的芯片读/写、日志流、错误 检查和文档搜索——无需离开编辑器。

需求

  • 氯≥0.9
  • curl 在你的 $PATH
  • StationeersLua mod with Enabled = true 在 [MCP Server] 配置(端口3030)

安装

lazy.nvim

{
  "andrew-d-moore/stationeers-mcp.nvim",
  config = function()
    require("stationeers_mcp").setup({
      host = "127.0.0.1",
      port = 3030,
      auto_connect = false,         -- set true to connect on startup
      keymaps = {
        open_hub    = "<leader>mh",
        push_buffer = "<leader>mp",
        pull_chip   = "<leader>mr",
        chip_list   = "<leader>ml",
        chip_errors = "<leader>me",
        chip_logs   = "<leader>mg",
        game_state  = "<leader>ms",
        search_docs = "<leader>md",
        patch_chip  = "<leader>mk",
      },
    })
  end,
}

包装商nvim

use {
  "andrew-d-moore/stationeers-mcp.nvim",
  config = function()
    require("stationeers_mcp").setup()
  end,
}

vim插件/手册

Plug 'andrew-d-moore/stationeers-mcp.nvim'

然后在 init.lua:

require("stationeers_mcp").setup()

命令

命令 描述
:McpConnect 与游戏MCP服务器握手
:McpDisconnect 断开连接状态
:McpHub 打开仪表板窗口
:McpChipList 列出当前网络上的芯片
:McpChipSelect 交互式拾取活动芯片
:McpPullChip 将活动芯片源插入新的缓冲区
:McpPushBuffer 推送电流缓冲器→ 有源芯片(编译)
:McpPatchChip Diff推送电流缓冲器(使用 patch_chip_code)
:McpPushEditor IC编辑器草稿中的阶段缓冲区(无编译)
:McpChipErrors 将芯片错误加载到快速修复列表中
:McpChipLogs 流媒体 print() 在浮动窗口中输出
:McpEditorState 显示当前游戏内编辑器选择
:McpGameState 显示世界名称、时间、勾选
:McpDevices 列出当前数据网络上的设备
:McpAllDevices 列出所有网络和设备
:McpReadDevice <ref> <LogicType> 从设备读取逻辑值
:McpSearchDocs [query] 在嵌入式文档中进行全文搜索
:McpDebugSession 显示VS代码调试器会话状态
:McpDebugStack 显示暂停芯片的堆栈轨迹

典型工作流程

:McpConnect          → handshake
:McpChipSelect       → pick PressureCtrl
:McpPullChip         → opens stationeers://chip_abc.lua in a buffer
[edit the file]
:McpPushBuffer       → compiles and exports to chip immediately
:McpChipErrors       → any errors → quickfix
:McpChipLogs         → floating live log window (polls every 2s)

保存a stationeers://... 缓冲器(:w)自动呼叫 :McpPushBuffer.

状态 / 值

-- lualine
require("lualine").setup({
  sections = {
    lualine_x = {
      require("stationeers_mcp.statusline").lualine,
    },
  },
})

节目 MCP ● (绿色,带芯片名称)连接时, MCP ○ (灰色)当不是。

配置

require("stationeers_mcp").setup({
  host         = "127.0.0.1",
  port         = 3030,
  auto_connect = false,
  keymaps = {
    open_hub    = "<leader>mh",   -- set to false to disable
    push_buffer = "<leader>mp",
    pull_chip   = "<leader>mr",
    chip_list   = "<leader>ml",
    chip_errors = "<leader>me",
    chip_logs   = "<leader>mg",
    game_state  = "<leader>ms",
    search_docs = "<leader>md",
    patch_chip  = "<leader>mk",
  },
  log = {
    max_lines = 500,
  },
  log_poll_ms = 500, -- chip log polling interval in milliseconds
})

多人游戏笔记

HTTP侦听器仅在非专用游戏客户端中运行。在多人游戏中 调试代理使用游戏内mod网络消息的会话——此插件的 HTTP调用仍然是目标 localhost 在本地客户端。