AsItIs

io.github.Katta041由 GitHub 账号 Katta041 发布v0.3.0更新于 Oct 27, 2026

Read-only MCP server for markdown and agent steering files: read, outline, lint, context budget.

概览

AI 生成的概览

只读 MCP 服务器,让助手读取、生成大纲、检查并估算 markdown 与 AI 代理引导文件(如 CLAUDE.md、AGENTS.md、SKILL.md)的上下文预算。

可以做什么
  • 按原始字节读取 markdown 文件,给出编码、换行、空白与哈希信息,大文件可分页
  • 提取标题大纲并标注行号,跳过 frontmatter 与代码块
  • 检查引导文件:frontmatter、长度上限、失效链接、不可见字符、隐藏指令、重复与跨文件漂移
  • 估算各代理每次会话加载的上下文 token 数,按文件与按工具统计
  • 按加载时机列出引导文件,并以 diff 形式给出机械性修复建议,标注安全或需复核
适用场景
适合维护代理指令文件的人,让助手在不改动文件的前提下检查臃肿、矛盾、隐藏或不可见文本以及厂商长度限制。也适合通过附带的命令行工具在 CI 或 pre-commit 中检查同类文件。
运行要求
以 npx 从 npm 包启动的本地进程,需要 Node 22.13 或更高版本。启动时须给出可读取的绝对路径 --root(可重复,或用 ASITIS_MCP_ROOT)。无需账号、API 密钥或网络。建议固定版本号,不要使用 latest。
安装前请注意
设计上只读:没有写入、补丁或删除工具,修复以 diff 返回,由你或助手决定是否应用。可选的 include skills 或 config 扫描会读取技能脚本与代理设置文件,结果中形似密钥的值会被遮蔽。工具结果会进入模型上下文,并传到你助手所用的 AI 服务商。--footer 选项会在首个结果末尾加一行推广链接。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@asitis/mcp

Read-only MCP server for markdown and AI agent steering files. From AsItIs, the markdown editor that never rewrites your file. MIT licensed. Source, issues and the Claude Code plugin: github.com/Katta041/asitis-agent-tools.

It gives your coding agent six tools to read, outline, lint, budget and suggest fixes for CLAUDE.md, AGENTS.md, GEMINI.md, SKILL.md, subagents, commands, rules, Cursor .mdc rules, Copilot instructions and memory files, without being able to change any of them. The same package has an asitis command for CI and pre-commit.

  • No writes. There is no write, patch or delete tool, and no write code in the package.
  • No network. No telemetry, no update check, no remote calls. It speaks MCP over stdio only.
  • Your folder only. It reads only markdown files under the folder (or folders) you start it with, plus its own .asitisrc.json and the root .gitmodules, unless a call asks for the opt-in skill or config scan.

Install

Requires Node 22.13 or later. Always pin the version; never use @latest in an agent config. MCP clients start servers outside your project, so give --root as an absolute path.

Check that it runs:

bash
npx -y @asitis/[email protected] --version

Claude Code

Run this in your project folder:

bash
claude mcp add asitis -- npx -y @asitis/[email protected] --root "$PWD"

Or install the Claude Code plugin, which adds a byte-clean editing skill, /asitis:md-lint, /asitis:md-budget and an optional guard hook, and runs this server under Node's permission model:

bash
claude plugin marketplace add Katta041/asitis-agent-toolsclaude plugin install asitis@asitis

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows:

json
{  "mcpServers": {    "asitis": {      "command": "npx",      "args": ["-y", "@asitis/[email protected]", "--root", "/absolute/path/to/project"]    }  }}

Cursor

.cursor/mcp.json in the project (or ~/.cursor/mcp.json):

json
{  "mcpServers": {    "asitis": {      "command": "npx",      "args": ["-y", "@asitis/[email protected]", "--root", "${workspaceFolder}"]    }  }}

If your Cursor version does not expand ${workspaceFolder}, use an absolute path. The server refuses a root that still contains ${...} rather than guessing.

VS Code

.vscode/mcp.json in the project (Copilot agent mode). VS Code uses the servers key, not mcpServers:

json
{  "servers": {    "asitis": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@asitis/[email protected]", "--root", "${workspaceFolder}"]    }  }}

Codex (CLI, IDE and desktop)

~/.codex/config.toml:

toml
[mcp_servers.asitis]command = "npx"args = ["-y", "@asitis/[email protected]", "--root", "/absolute/path/to/project"]

Gemini CLI

.gemini/settings.json in the project (or ~/.gemini/settings.json):

json
{  "mcpServers": {    "asitis": {      "command": "npx",      "args": ["-y", "@asitis/[email protected]", "--root", "/absolute/path/to/project"]    }  }}

Hardened: Node's permission model

Run the file directly under Node's permission model so Node itself denies writes and child processes (and network access on Node 25 and later):

bash
npm install -g @asitis/[email protected]node --permission \  --allow-fs-read="$(npm root -g)/@asitis/mcp" \  --allow-fs-read=/absolute/path/to/project \  "$(npm root -g)/@asitis/mcp/dist/asitis-mcp.mjs" --root /absolute/path/to/project

In a client config, command is node and every other word goes in args, in the same order. Replace $(npm root -g) with the folder that command prints, because configs do not run shell commands.

If a desktop app cannot find npx or node, use its full path (run which npx, or where npx on Windows) as the command.

CLI and CI

The package also has an asitis command for scripts, CI and pre-commit. It lints the same way as lint_steering and exits 0 (clean), 1 (findings at or above --fail-on, default error), 2 (something you can fix, one line on stderr) or 3 (a bug in asitis).

bash
npx -y -p @asitis/[email protected] asitis lint                      # every steering file under the current foldernpx -y -p @asitis/[email protected] asitis lint CLAUDE.md AGENTS.md  # only these filesnpx -y -p @asitis/[email protected] asitis lint --format sarif > asitis.sarifnpx -y -p @asitis/[email protected] asitis lint --fix-preview=safe | git apply   # apply the safe fixes yourselfnpx -y -p @asitis/[email protected] asitis budget                    # tokens each agent loads every session

Formats: text, json, sarif (the standard report format GitHub code scanning reads) and github (pull request annotations). With github, only errors and warnings become annotations; add --annotate-notes to annotate notes as well. It never writes a file; --fix-preview prints a diff and you decide whether to apply it. asitis lint --help and asitis budget --help list each command's options.

text
$ npx -y -p @asitis/[email protected] asitis lint --include skills.claude/skills/release/SKILL.md:4:1 warning sec-skill-allowed-tools allowed-tools pre-approves "Bash" (any shell command), so during the turn that invokes this skill those calls go ahead without asking you; scope each entry to the commands it needs, for example Bash(git status *) or WebFetch(domain:docs.example.com)
CLAUDE.md:7:1 warning duplicate-rule Same rule as line 5: "Run `pnpm test` before every commit". Duplicates cost context and drift apart when one is edited; keep oneCLAUDE.md:9:1 warning broken-link Relative link target not found: "docs/api.md". Fix the path or remove the linkCLAUDE.md:11:1 note hidden-comment 1 comment (HTML or [//]: # style) is hidden in rendered views on line 11: "maintainer note: keep this short". It does not read like an instruction to an agent; Claude Code strips it from CLAUDE.md at session start, though its Read tool and other agents still see it, so check that it says what you expect
Linted 2 files: 0 errors, 3 warnings, 1 note.Skill scan: 1 skill folder, 0 scripts and 0 markdown files read, 0 other files checked for executable headers (0 files in all).

That run exits 0: with the default --fail-on error only errors fail the build. Planted invisible or bidirectional characters, and hidden comments that tell the agent to ignore instructions, hide something, run a command or reach for secrets, are errors, so they fail the build by default. Pass --fail-on warning to fail on warnings too.

GitHub Action. Runs the bundled CLI with no npm install and puts findings on the pull request:

yaml
permissions:  contents: readjobs:  asitis:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1        with:          persist-credentials: false      - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0        with:          node-version: 22      - uses: Katta041/[email protected]

pre-commit. Lints only the staged steering files:

yaml
repos:  - repo: https://github.com/Katta041/asitis-agent-tools    rev: v0.3.0    hooks:      - id: asitis-lint

docs/ci.md covers the Action's inputs and SARIF upload, lefthook, husky and GitLab CI. Every flag and exit code is in docs/cli-contract.md.

Config

Put an .asitisrc.json at the project root. Everything is optional:

json
{  "$schema": "https://raw.githubusercontent.com/Katta041/asitis-agent-tools/main/packages/mcp/schema/asitisrc-1.json",  "extends": "recommended",  "rules": {    "duplicate-rule": "off",    "length": ["warning", { "claudeMdLines": 300 }]  },  "ignore": ["vendor/**", "examples/**"],  "overrides": [{ "files": ["docs/**"], "rules": { "contradiction": "off" } }],  "include": ["skills", "config"]}
KeyWhat it does
ruleserror, warning, note or off per rule id. length also takes claudeMdLines, skillMdLines, cursorRuleLines, codexBytes, windsurfChars and memoryIndexLines.
extendsrecommended (the default) or strict: notes become warnings, two inventory notes appear (plain hooks, subagents with no tools list), and in the CLI and the Action the skill and config scans run.
ignore, overridesGlobs for files to skip, and per-glob rule settings.
includeOpt-in scans: skills, config, config-local. Honoured by the CLI and the Action. The MCP server ignores it and asks you to pass include to lint_steering, so a repo cannot make the server read more than you asked for.

A typo stops the run with the file, line and a suggestion (.asitisrc.json line 2: unknown key "rulez" (did you mean "rules"?)).

To silence one finding, put a comment above it with the rule id: <!-- asitis-disable-next-line duplicate-rule -- the two sections are alternatives -->, or asitis-disable-file for the whole file. The reason after -- is optional; when you give one it is carried into the JSON and SARIF output. The rule id is the word after the severity in each finding, and docs/rules/ lists them all. Security rules (hidden instructions, invisible characters, the sec-* rules) cannot be silenced by a comment, since a comment is exactly what an attacker would add; turn them off in .asitisrc.json or a baseline, where it shows in review. For an existing repo, asitis lint --format json --write-baseline > .asitis-baseline.json and then --baseline .asitis-baseline.json reports only new findings.

Every rule has a page with examples: docs/rules/.

Tools

ToolWhat it returns
read_markdownThe file text exactly as stored, plus a byte profile: encoding, BOM, CRLF/LF/CR counts, final newline, trailing whitespace, invalid UTF-8 byte ranges, sha256. Pages large files (offset_bytes, max_bytes, 256 KB default, 1 MB max). as: "base64" returns the exact bytes. Marks the content as untrusted and summarises hidden characters and comments.
outlineATX and setext headings with line numbers, skipping frontmatter and fenced code.
lint_steeringFrontmatter on line 1 and valid YAML; required name and description for SKILL.md and subagents; unknown keys; length against vendor limits; broken relative links and @path imports; zero-width, bidi and other invisible characters; hidden HTML comments that read like instructions; text hidden with inline styles; duplicate and contradictory-looking rules; across files, an AGENTS.md that Claude Code never reads, mirrored files that drift apart, and Codex's shared 32 KiB budget. With no path, lints every steering file in the folder. Applies .asitisrc.json and suppression comments. include: ["skills"] also scans the scripts in skill folders, and include: ["config"] audits .claude/settings.json and MCP config files.
context_budgetApproximate tokens per file and per tool for what loads every session: Claude Code (CLAUDE.md plus @imports up to 4 hops, or AGENTS.md when there is no CLAUDE.md; rules without paths; MEMORY.md first 200 lines when you add your memory folder as a second root; the skill and subagent listing), Codex (root AGENTS.md, first 32 KiB), Gemini CLI (GEMINI.md plus imports up to 5 levels), Cursor always-applied rules, Copilot repository instructions, Windsurf and Cline rules. Long lists are cut; totals still count every file.
find_steering_filesEvery steering file, grouped by when it loads: every session, on match (paths, globs, applyTo), on invocation (skills, commands, agents, prompts), on demand (nested instruction files), memory.
suggest_fixesFixes for mechanical findings (invisible characters, frontmatter not on line 1, skill name fields, trailing whitespace, a missing final newline, instruction-like HTML comments) as a unified diff, plus the old and new text for each edit. Each fix is marked safe or review. It never writes; your assistant applies the edits you accept.

Every tool is annotated readOnlyHint: true, destructiveHint: false, openWorldHint: false. Tool results carry no link to asitis.app unless you ask for one: with --footer (or ASITIS_MCP_FOOTER=1) the first result of each session ends with one line, Edit these files without rewriting them: https://asitis.app/?ref=mcp, and later results and errors do not repeat it. --no-footer is still accepted and changes nothing. Results are text only. Pass --structured (or set ASITIS_MCP_STRUCTURED=1) to also get each result as JSON in structuredContent, for scripts. It is off by default because Claude Code 2.1 gives the model the JSON instead of the text when both are present, which drops the untrusted-content notice and, for read_markdown, the file text.

Vendor limits checked, with sources in src/limits.ts:

FileLimit
CLAUDE.mdtarget under 200 lines (Claude Code memory docs)
SKILL.mdunder 500 lines; description plus when_to_use truncated at 1,536 characters in the listing (Claude Code skills docs); name up to 64 and description up to 1,024 characters (Agent Skills spec; the Claude API and claude.ai reject longer ones, while Claude Code loads them and truncates the listing)
MEMORY.mdfirst 200 lines or 25 KB load (Claude Code memory docs)
AGENTS.md32 KiB combined across the AGENTS.md files Codex loads, root first (project_doc_max_bytes)
Cursor rulesunder 500 lines
Windsurf rules12,000 characters per workspace rule file (6,000 for global_rules.md)

Privacy

  • The server and the CLI make no network connections and have no network code. They collect nothing and send nothing.
  • They never write, rename or delete a file, and create no temp files. Fixes come back as a diff; applying one is up to you or your assistant.
  • By default only markdown steering files, .asitisrc.json and, when a relative link is missing, the root .gitmodules (to tell a submodule that is not checked out from a broken link) are read. Skill scripts are read only when you pass include: ["skills"] (or --include skills), and .claude/settings.json, .mcp.json, .cursor/mcp.json, .vscode/mcp.json and .gemini/settings.json only with include: ["config"], which also reads the name, homepage and repository of the root package.json and pyproject.toml so the project's own MCP server and install script are recognised. .claude/settings.local.json needs config-local. ~/.claude.json is never read. Values from settings files are never echoed: findings name the key, and anything shaped like a secret is redacted.
  • It logs one start-up line to stderr (version and root folder), never file content.
  • What your assistant does with results is up to your assistant. Tool results go into the model's context, so they reach whichever AI provider your assistant uses. That is your assistant's network traffic, not ours.

Security model

  • Root confinement. Every path is resolved with realpath and must stay inside a root given at start-up. ../ traversal, absolute paths outside the root and symlinks (file or folder) that resolve outside are refused. Symlinks that resolve inside a root are followed, so a CLAUDE.md that links to AGENTS.md or a linked .claude/skills folder is checked where the agent sees it. The filesystem root and your home folder are refused as roots unless you pass --allow-broad-root.
  • Markdown only, unless you opt in. By default only .md, .mdc, .markdown, .mdx, .cursorrules, .windsurfrules and .clinerules are read, plus .asitisrc.json (at most 64 KB). include: ["skills"] adds the scripts inside skill folders (up to 1 MB each; other files there are read for their first 4 bytes only, to spot binaries), and include: ["config"] adds the agent settings and MCP config files listed under Privacy. .env*, anything in .git/ or node_modules/, ~/.claude.json and every other file are always refused, including through a symlink that points at them. A repo's .asitisrc.json cannot turn these scans on in the MCP server; only the call (or the CLI flag) can. @imports of other files are counted from their size, never read. Nothing that is read is ever run.
  • Bounded work. Files over 16 MB are refused (--max-file-mb), results are capped, every tool call has a 20 s budget, and every scanner is linear time. The test suite runs 32 adversarial 10 MB inputs (unclosed comments, bracket and backtick storms, 2,000-character import tokens, invalid UTF-8 and more) through every tool under a 3 s per-call budget.
  • Untrusted content. read_markdown labels file content as data, not instructions, and reports hidden instructions and invisible characters up front. This does not stop a model from obeying text it reads; it makes the text visible.
  • Stronger sandbox, optional. Run the server under Node's permission model so the runtime itself forbids writes and child processes (and network access on Node 25 and later). The Hardened setup under Install shows how; the Claude Code plugin does this by default.

Known limits

  • Token counts are local approximations (about 4 characters per token for English), not any vendor's tokenizer.
  • A hardlink inside the root to a file elsewhere is read like any other file (reads only).
  • A symlink swapped into a parent folder between the check and the open is a narrow race; the final path component is opened with O_NOFOLLOW and checked by inode.
  • On Windows, junctions, case-folded paths, 8.3 short names, \\?\ and \\.\ device prefixes, UNC paths and trailing dots or spaces are judged on the real path and tested. Alternate data streams (notes.md:stream) and reserved device names (CON, NUL.md) are refused outright.

Options

text
asitis-mcp --root <folder> [--root <folder>...] [options]
  --root <folder>      Folder the server may read (repeatable). Default: the current folder.  --footer             Add one line linking to asitis.app to the first result of the session. Off by default.  --structured         Also return each result as JSON (structuredContent), for scripts. Off by default.  --max-file-mb <n>    Largest file to analyse, in MB (default 16, max 64).  --allow-broad-root   Allow your home folder or the filesystem root as the root.  --version            Print the version.  --help               Print this help.

ASITIS_MCP_ROOT (folders separated by :, or ; on Windows) ASITIS_MCP_FOOTER=1 and ASITIS_MCP_STRUCTURED=1 work as environment variables. Add a second --root for a memory folder that lives outside the project, for example ~/.claude/projects/<project>/memory.

Mistakes print one line and exit with code 2, for example:

text
asitis-mcp: Root folder not found: /x. Pass an existing folder with --root.

Package

The package is two files, the server dist/asitis-mcp.mjs and the CLI dist/asitis.mjs (built with esbuild, minified), with zero runtime dependencies and no install scripts. The MCP SDK (pinned to 1.31.0), zod and yaml are bundled in; their licences are in dist/THIRD_PARTY_NOTICES.md. The release workflow in this repository (.github/workflows/release.yml) publishes with npm provenance, so a version it publishes shows a provenance attestation on npmjs.com and can be checked with npm audit signatures. Versions up to 0.2.4 were published by hand, without provenance.

License

MIT. Changes are listed in the changelog. Report vulnerabilities privately through GitHub security advisories.

来源:packages/mcp/README.md,提交 0923dc1

工具

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

版本历史

4
  1. v0.3.0最新Oct 15, 2026
  2. v0.2.5Oct 14, 2026
  3. v0.2.4Oct 14, 2026
  4. v0.2.3Oct 14, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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