SH

sycatle/hammer-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

30 stars 4 forks 质量 73 趋势 26MIT

用于源引擎映射工作的MCP服务器:读取并删除VMF,编辑且不重格式化,衡量BSP是否符合格式限制,使用Wine(原生或Hammer++)编译

概览

一个用于源引擎地图工作的MCP服务器。它读取.vmf和.bsp文件,将地图与游戏自身的FGD对比,编辑.vmf而不重排格式,修补已编译地图的实体而不重新编译,编写编译器以Wine驱动——按需或备份——并根据格式限制测量地图。 它能读写文件,运行编译器,除此之外什么都不做。这正是它能不锁、能放在实时服务器旁边而不打扰它的原因。 测量日期为2026年11月8日。工具返回的是JSON;条形图是这个README对它的渲染。上面所有数字都在那个JSON里,docs/measuring.md会说明每个数字的佐证。 上面每个读者都回答了多少。他们都没有回答:这是否足够——所以驱动这个工具链的任何东西都可以无限测量一张地图,而不会知道它已经完成了。read_map_report结束了:它运行读者并根据 。 测量日期为2026年11月8日。

概述(AI 翻译)

一个用于源引擎地图工作的MCP服务器。它读取.vmf和.bsp文件,将地图与之对照 游戏自有的FGD,编辑.vmf而不重格式化,修补已编译地图的实体 无需重新编译,则以 Wine 驱动编译器 — Hammer++ 默认使用,按需存储或 作为备选方案——并测量一张地图 违背了格式的限制。

**它从不和运行中的引擎通信。**它读写文件,运行编译器,什么都不做 否则。这正是它能不锁、能放在在线服务器旁边而不打扰它的原因。

测量日期为2026年11月8日。工具返回JSON;条形图是该README对该文件的渲染。每条 上面的数字在那个JSON里,docs/measuring.md也说明了这些内容 每一个。

它的作用

测量每个块的装填情况、世界范围、道具库存、包装资产、视线
评判 根据预算配置,作为标准的评判——这样来电者才能知道完成时间,而不仅仅是处于什么位置
读取并补充 实体、输出和刷子计数 .vmf;每个与游戏本身声明的FGD对照的发现

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

hammer-mcp

An MCP server for Source-engine map work. It reads .vmf and .bsp files, lints a map against the game’s own FGD, edits a .vmf without reformatting it, patches a compiled map’s entities without recompiling, drives the compilers under Wine — Hammer++ by default, stock on demand or as a fallback — and measures a map against the limits of the format.

It never talks to a running engine. It reads and writes files and runs compilers, and nothing else. That is what lets it hold no lock and sit beside a live server without disturbing it.

> read_map_geometry rp_nycity_day.bsp

  a 1.13 GB map — header and lump directory only, 1 ms

  MODELS       1218 /  1024   119%  ████████████▏  over
  TEXINFO     11841 / 12288    96%  █████████▋
  VERTEXES    62270 / 65536    95%  █████████▌
  BRUSHES      6913 /  8192    84%  ████████▍

  4 lumps at or past 80% of their ceiling.

  MODELS is past it outright — and this map loads every day. That is
  not a broken map: it is evidence that the compilers which built it
  raise that ceiling. The tool reports it in those terms, rather than
  an error it cannot substantiate.

Measured on 11/08/2026. The tool returns JSON; the bars are this README’s rendering of it. Every number above is in that JSON, and docs/measuring.md says what corroborates each one.

What it does

flowchart LR
  VMF[".vmf"] --> LINT["read_vmf_lintagainst the game's FGD"]
  LINT --> EDIT["edit_vmfsplice, never reserialise"]
  EDIT --> VMF
  LINT --> C["vbsp · vvis · vradunder Wine"]
  C --> BSP[".bsp"]
  BSP --> M["measure · pack · patch entities"]
  M -. never .-x ENG["a running engine"]
  style ENG stroke-dasharray: 4 4
Measure how full each lump is, world extents, prop inventory, packed assets, sightlines
Judge the same measurements against a budget profile, as a verdict per criterion — so a caller knows when it is done, not just where it stands
Read and lint entities, outputs and brush counts of a .vmf; every finding checked against the FGD the game itself declares
Edit entities, keyvalues and outputs of a .vmf, by splicing byte ranges — untouched bytes stay untouched
Build brushes from a shape description, wound and textured the way vbsp expects, refused unless they close
Optimise func_detail, hint brushes including diagonal ones, per-face lightmap scale — the decisions a compiled map no longer contains
Compile vbsp/vvis/vrad under Wine, findings per stage, and a leak turned into a named entity
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →