Agent Core

io.github.kinbinghua-lgtm由 GitHub 账号 kinbinghua-lgtm 发布v0.1.1更新于 Oct 24, 2026

Deterministic computation tools for AI agents. Zero dependencies, no network, read-only.

发布方自己的服务:core.blue

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

一个本地、零依赖的 MCP 服务器,为助手提供精确、确定性的计算工具:文本差异、哈希、JSON 查询、日期运算、正则提取等。

可以做什么
对文本做差异比较与哈希:精确行级差异,sha256/sha512/sha1/md5 与 HMAC,输出十六进制、base64 和字节长度。
适用场景
当助手需要精确、可复现的答案,而语言模型靠猜测容易出错时使用,例如计数、差异比较、哈希、日历运算、CSV 解析、正则提取或单位与进制换算。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 18 或更高版本。无需 API 密钥、环境变量、账号或网络访问。
安装前请注意
只读且每次调用无状态,不联网、不读取凭据、不执行 shell。正则提取受截止时间限制(budgetMs,默认 1000,最大 10000),超时即终止;超大输入会被拒绝而非处理。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agent Core,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agent-core-mcp

Deterministic computation tools for AI agents. Exact diffing, hashing, JSON querying, calendar arithmetic, regex extraction under a hard execution deadline, CSV parsing, similarity scoring and unit/base conversion — as an MCP server.

Zero dependencies. No network. Read-only.


Why this exists

Language models are excellent at generating language and unreliable at exact, reproducible mechanical computation. That is not a capability gap — it is an architectural property. Asking a probabilistic system to count, diff, hash or do calendar math guarantees a certain rate of confident wrong answers.

This server moves those operations out of the model and into a deterministic engine.

The result is not a better guess. It is a different category of answer: one that is exact and reproducible.

There is a second reason, specific to the MCP ecosystem. The most-reported problems with published servers are credential exfiltration, undisclosed shell execution, dependency trees carrying known CVEs, and servers that hang the client. A server with no network, no credentials, no execution surface, and a bounding deadline on every operation cannot exhibit any of them.

Guarantees

GuaranteeMeaning
Zero dependenciesNo node_modules. Nothing to audit, nothing to go stale, nothing to break.
No network accessNothing here calls out. Not one request, ever.
No credentialsReads no tokens, no API keys, no environment variables.
Read-onlyNo file writes, no shell execution, no state. Stateless per call.
DeterministicIdentical input produces byte-identical output.
BoundedEvery loop and result set is capped. Regex execution runs in a worker thread that is terminated on deadline, so no pattern can hang the client.

The server publishes these as a machine-readable contract resource (agent-core://contract), so a client can verify what it is installing rather than trusting this file.

Install

bash
npx agent-core-mcp

No install step is required to run it. Requires Node.js 18 or newer.

Available from:

Configure

Claude Code

This repository ships a .mcp.json, so cloning it is enough:

bash
git clone https://github.com/kinbinghua-lgtm/agent-core-mcpcd agent-core-mcpclaude   # the agent-core server is discovered automatically

Or add it to any project:

json
{  "mcpServers": {    "agent-core": {      "command": "npx",      "args": ["-y", "agent-core-mcp"]    }  }}

Claude Desktop, Cursor, VS Code, Windsurf, Continue, Zed

Same block, in that client's MCP configuration file. No API keys. No environment variables. Nothing to sign up for.

Tools

ToolWhat it doesWhy the model shouldn't do it itself
diff_textExact line diff (LCS) with line numbers and added/removed countsRequires exact sequence alignment; refuses oversized input rather than hanging
hashsha256 / sha512 / sha1 / md5 / HMAC, hex + base64 + UTF-8 byte lengthCannot be computed by inspection
json_validateValidity plus the parser message and computed line/columnPinpointing the error by eye is error-prone
json_queryPath access like a.b[0].c; separates absent from present-but-nullConflating those two silently causes real bugs
json_pickResolve many paths in one callCheaper than N round trips
text_statsCode points, UTF-8 bytes, lines, words, sentences, paragraphs, unique words, top wordsCounting is precisely what probabilistic generation gets wrong
date_calcInterval in days/weeks/months/years/hours/minutes/seconds/businessDaysTrue calendar months, not 30-day approximations
date_addOffset a date, calendar-correctMonth-end and leap-year handling
regex_extractAll matches with indices, numbered and named groups, under a hard deadlineA catastrophic pattern is terminated instead of hanging
regex_analyzeStatic ReDoS risk assessment of a patternNested quantifiers, overlapping alternation, backreferences
fuzzy_matchRank candidates by Sorensen-Dice similarityDeterministic scoring instead of vibes
similaritySingle similarity score, 0..1—
parse_tableRFC 4180 CSV/TSV with quotes, escapes, embedded newlines; delimiter auto-detectionNaive comma-splitting breaks on any real CSV
convertLength, mass, time, data size; rejects cross-family conversionsUnit errors are silent and catastrophic
base_convertBases 2-36 with arbitrary precisionValues above 2^53 lose precision in naive conversion

The ReDoS deadline

regex_extract accepts an optional budgetMs (default 1000, maximum 10000). Execution happens in a worker thread that is terminated when the deadline expires.

This is not a nicety. Node's regex engine cannot be interrupted, so a pattern with catastrophic backtracking blocks the main thread indefinitely. Measured growth for (a+)+$ against 'a'.repeat(n) + '!':

ntime
2018 ms
2270 ms
24276 ms
261108 ms

Roughly 4x per two additional characters. At n=40 it does not return. In an MCP server, which runs on the client's main thread, this freezes the user's editor. Process isolation plus termination is the only real boundary.

On expiry the response says so, and tells the caller how to fix the pattern:

json
{  "timedOut": true,  "budgetMs": 300,  "safety": {    "risk": "high",    "reasons": ["nested quantifier inside a repeated group — classic exponential backtracking"]  },  "advice": "Pattern execution exceeded 300ms and was terminated. ... Rewrite it to remove ambiguity — typically by replacing a nested quantifier such as (a+)+ with an unambiguous form such as a+ ..."}

Argument validation

Every call is validated against the tool's own JSON Schema before dispatch: required fields, primitive types, enum membership, numeric bounds and unknown properties. A malformed call returns a specific error instead of a confident wrong answer.

This matters because clients do not reliably honour schemas. A server that silently proceeds on a malformed call is worse than one that refuses it.

Examples

Exact diff

json
{ "a": "line one\nline two", "b": "line one\nline 2" }

→ { "added": 1, "removed": 1, "lines": [ { "op": "equal", "aLine": 1, "bLine": 1 }, ... ] }

Big-integer conversion that stays exact

json
{ "value": "9007199254740993", "fromBase": 10, "toBase": 16 }

→ { "result": "20000000000001", "decimal": "9007199254740993" }

Business days between two dates

json
{ "from": "2026-01-05", "to": "2026-01-12", "unit": "businessDays" }

→ { "value": 5 }

Check a pattern before running it

json
{ "pattern": "(a+)+$" }

→ { "risk": "high", "reasons": ["nested quantifier inside a repeated group — classic exponential backtracking"] }

Absent versus null

json
{ "json": "{\"a\":null}", "path": "a" }

→ { "resolved": true, "found": false, "value": null, "type": "null" }

Design notes

Why stdio and not HTTP? A stdio server has no listening socket: no attack surface, no port to expose, no auth to get wrong, no data leaving the machine. For pure computation, HTTP would add risk and buy nothing.

Why no caching? Every call is stateless. Caching would introduce state, invalidation bugs and a place for data to persist. The operations are cheap enough that this is not a tradeoff.

Why refuse oversized input? An MCP server that hangs takes the client session with it. Refusing with an actionable message is strictly better than exhausting memory.

Why no dependencies at all? Every dependency is an ongoing obligation: updates, advisories, supply-chain risk, and one more reason the server might stop working. The Node standard library covers everything here.

Development

bash
node server.cjs              # speaks MCP over stdionode selftest.mjs            # engine verification, 35 assertionsnode protocol-test.cjs       # protocol verification, 88 assertionsnpm test                     # both suites

Both suites run on plain Node with no install step.

selftest.mjs checks hashing against published constants, big-integer round trips past 2^53, RFC 4180 quoting edge cases, Unicode word segmentation and calendar arithmetic. protocol-test.cjs drives the real handler through a fake transport and covers the handshake, version negotiation, every tool, argument validation, the ReDoS deadline, malformed frames, split frames, batches, concurrent request correlation and determinism.

Two bugs found by these suites, both retained as regression tests:

  • A ReDoS in the word-segmentation regex. The original textStats pattern was [\p{L}\p{N}][\p{L}\p{N}'’-]* — two adjacent, overlapping character classes. On a long letter run followed by a non-match it backtracked exponentially and hung the process. The analyzer shipped in this package did not catch it, because it statically inspects the pattern it is given and cannot see patterns written by hand in the source. The execution deadline above exists because of this.
  • Schema validation was absent. Missing required arguments were silently treated as absent values, so a caller that forgot path received missing-key instead of an error. Client-side schemas are not enforcement.

License

MIT — see LICENSE.

来源:README.md,提交 3c84e3c

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Core 集成