Hoplon

Hoplon

Enables AI coding agents and hosts to enforce deterministic repository boundaries via MCP, providing structured reads, supervised edits, snapshots, audits, and recovery with machine-readable evidence.

Category
访问服务器

README

Hoplon

CI License: MIT Node.js 22+

Deterministic repository boundaries for AI coding agents and the humans who direct them.

Hoplon sits between an agent and a repository. A human or host declares what the agent may inspect and modify; Hoplon supplies structured reads, supervised edits, content-addressed snapshots, deterministic audits, recovery, and machine-readable evidence.

Hoplon began as the repository boundary for Project Phalanx. It is intentionally standalone: any agent, MCP client, CI worker, or custom host can use the same contracts without adopting Phalanx.

Developer preview: the deterministic core and shipped transports are usable today, but the public API is still on the 0.4.x line. Expect additive growth and clearly documented compatibility changes before 1.0.

Why Hoplon

Agentic coding can waste context and reviewer time long before a test fails. Hoplon moves mechanical questions to the repository boundary:

  • What was the agent allowed to read or change?
  • Did the resulting diff stay within that contract?
  • Was a symbol, signature, import, path, or file boundary violated?
  • Can a failed attempt be reverted without contaminating the next one?
  • Which claims are deterministic, and which are only advisory?

The answer is a typed result backed by snapshots and AST checks, not an agent summary that the host must trust.

What ships

Capability Posture
Structured reads and search Shipped through seeCodebase, symbol search, tree-sitter queries, templates, and AST-bounded context packing
Supervised non-binary edits Shipped through ordered edit sessions and MCP/HTTP session tools
Snapshots and deterministic audit Shipped through preflight, createSnapshot, dryRun, auditDiff, and revertUncontracted
Recovery and review evidence Shipped through review payloads, rollback templates, repair context, and snapshot evidence
CLI, MCP, HTTP, and gRPC Shipped over the same engine contracts
Semantic, ML, DLP, and provider-backed references Advisory and host-bound; unavailable is reported honestly when no provider is configured

Hoplon does not choose models, execute arbitrary shell commands, own retry policy, or replace tests and human review.

Quick start

Requirements: Git and Node.js 22 or newer.

git clone https://github.com/justguy/hoplon.git
cd hoplon
npm ci
npm run build
node dist/bin/hoplon.js status \
  --root . \
  --grammars-dir vendor/grammars \
  --format human

Run the executable boundary example:

npm run example:bounded-edit

It creates an isolated temporary repository, accepts an edit inside the declared symbol boundary, blocks an out-of-scope symbol, reverts the workspace, and prints the evidence returned by the real session path.

For development proof:

npm run typecheck
npm run test:arch
npm run test:contracts
npm run test:proof

The contract

A writable manifest is the boundary a human or host gives the agent:

const manifest = {
  manifestSchemaVersion: 2,
  projectId: 'widget',
  runId: 'run-42',
  correlationId: 'change-price-format',
  entries: [
    {
      path: 'src/format.ts',
      intent: 'modify',
      scope: { kind: 'symbols', symbols: ['formatPrice'] },
    },
  ],
};

The normal supervised loop is:

read with provenance
  -> declare manifest
  -> preflight
  -> snapshot
  -> dry-run (optional)
  -> apply or declare edits
  -> audit
       PASS  -> review/evidence -> close
       BLOCK -> revert -> repair context -> host decides what follows

Hoplon owns repository facts. The host owns workflow policy.

Connect an agent over MCP

After building Hoplon, point an MCP client at the launcher. Replace the two absolute paths with the Hoplon checkout and the repository the agent should work in:

{
  "mcpServers": {
    "hoplon": {
      "command": "node",
      "args": [
        "/absolute/path/to/hoplon/dist/bin/hoplon.js",
        "mcp",
        "serve",
        "--root",
        "/absolute/path/to/target-repository",
        "--grammars-dir",
        "/absolute/path/to/hoplon/vendor/grammars"
      ]
    }
  }
}

Use --agent-profile strict-agent when the host has completed project registration and folder-policy onboarding. The default profile remains the compatibility surface.

Use as a library

The public package name is @phalanx/hoplon; the name records the project's origin, not a runtime dependency on Phalanx.

import {
  createDefaultHoplonEngine,
  createHoplonEditSession,
} from '@phalanx/hoplon';

The engine is adapter-first. Filesystems, versioning, snapshot stores, locks, code intelligence, scanners, policy providers, vector stores, and behavior test runners are injected rather than read from ambient state.

See Integration and Host workflow for the supported entry points.

Security model

Hoplon's deterministic verdicts use manifest, path, snapshot, and AST facts. Semantic retrieval, model output, behavior tests, risk scores, and optional provider results cannot silently change structural PASS/BLOCK authority.

Hoplon is not a process sandbox. Read SECURITY.md and the threat model before granting an agent repository access.

Repository map

  • src/hoplon/contracts — versioned DTOs and schemas
  • src/hoplon/operations — deterministic and advisory operations
  • src/hoplon/session — supervised edit state machine
  • src/hoplon/adapters — environment seams and default implementations
  • src/hoplon/transport, src/hoplon/mcp — remote and agent-facing surfaces
  • packages — optional adapter packages
  • tests — contract, flow, transport, self-hosting, and architecture proof

The current implementation truth is in ARCHITECTURE.md. The product intent is in HOPLON_VISION.md.

Contributing

Issues, design feedback, host integrations, language support, and adapter contributions are welcome. Start with CONTRIBUTING.md. Security findings belong in private vulnerability reports, not public issues.

License

Hoplon core is available under the MIT License. Optional packages declare their own licenses; in particular, the Semgrep adapter remains a separate LGPL-licensed package and is never bundled into the MIT core.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选