Borrowing it
Nothing to install: this file belongs to SiroSuzume/mcp-ts-morph. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/SiroSuzume/mcp-ts-morph/main/.claude/skills/new-mcp-tool/SKILL.mdgit clone --depth 1 https://github.com/SiroSuzume/mcp-ts-morphWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/sirosuzume/mcp-ts-morph/new-mcp-tool)<a href="https://agentmods.dev/skills/sirosuzume/mcp-ts-morph/new-mcp-tool"><img src="https://agentmods.dev/badge/skills/sirosuzume/mcp-ts-morph/new-mcp-tool/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sirosuzume/mcp-ts-morph/new-mcp-tool"><img src="https://agentmods.dev/badge/skills/sirosuzume/mcp-ts-morph/new-mcp-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00116 | $0.01654 |
| Opus 5 | $0.00058 | $0.00827 |
| Sonnet 5 | $0.00023 | $0.00331 |
| Haiku 4.5 | $0.00012 | $0.00165 |
Grade A, and why
new-mcp-tool scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.
新しい MCP ツールを追加する
@sirosuzume/mcp-tsmorph-refactor に新ツールを 1 つ追加するときの定型手順。過去に README のツール表と CLAUDE.md のモジュール一覧が実態とドリフトしたため、ドキュメント追記まで含めて 1 つの作業として扱う。
t-wada 式 TDD で進める(テストファースト → レッド → グリーン → リファクタ)。ロジックは ts-morph レイヤーに置き、MCP レイヤーは薄い登録だけにする。
作成・更新するファイル一覧
新ツール名を仮に do_something_by_tsmorph、ロジックを src/ts-morph/do-something/ に置く場合:
- ts-morph ロジック:
src/ts-morph/do-something/do-something.ts- 純粋関数として実装。
initializeProject(tsconfigPath)で受け取ったProjectを引数に取り、結果オブジェクトを返す(または Result 型を検討)。 - 例外は握りつぶさず、呼び出し側でメッセージ化できるよう投げる。
- 純粋関数として実装。
- コロケートテスト:
src/ts-morph/do-something/do-something.test.ts- Vitest。仕様としてのテストを先に書く。Mock は極力使わず、使うときはコメントで理由を補足。
src/ts-morph/_test-utils/のヘルパーで一時プロジェクトを組み立てる(既存テストを参照)。- 既知の落とし穴を必ずケース化: default export / 再エクスポート / パスエイリアス / node_modules 越し参照のうち、該当するもの。
- MCP 登録ファイル:
src/mcp/tools/register-do-something-tool.ts- 既存の
register-get-type-at-position-tool.tsを雛形にする(下記テンプレ)。
- 既存の
- aggregator へ登録:
src/mcp/tools/ts-morph-tools.ts- import を 1 行追加し、
registerTsMorphTools内でregisterDoSomethingTool(server);を呼ぶ。
- import を 1 行追加し、
- README.md:
- 「提供されるツール」のツール表に 1 行追加(
[\do_something_by_tsmorph`](#do_something_by_tsmorph)`)。 - 対応する詳細セクション(機能・ユースケース・必要な情報・注意)を追加。
- 「提供されるツール」のツール表に 1 行追加(
- CLAUDE.md:
- 「ts-morphレイヤー」のモジュール一覧に
do-something/を追加。 - 「主要な機能と実装ファイル」に 1 行追加。
- 「ts-morphレイヤー」のモジュール一覧に
register-*.ts テンプレート
既存ツールに合わせた骨格。server.tool(name, description, zodSchema, handler) の 4 引数。
import { performance } from "node:perf_hooks";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import { initializeProject } from "../../ts-morph/_utils/ts-morph-project";
import { doSomething } from "../../ts-morph/do-something/do-something";
import logger from "../../utils/logger";
// logger 自体が投げても MCP レスポンス生成を阻まないようにラップする
function safeLogError(error: unknown, toolArgs: Record<string, unknown>): void {
try {
logger.error({ err: error, toolArgs }, "Error executing do_something_by_tsmorph");
} catch (loggerErr) {
console.error("Failed to write error log:", loggerErr);
}
}
function safeLogInfo(fields: Record<string, unknown>): void {
try {
logger.info(fields, "do_something_by_tsmorph tool finished");
} catch (loggerErr) {
console.error("Failed to write info log:", loggerErr);
}
}
export function registerDoSomethingTool(server: McpServer): void {
server.tool(
"do_something_by_tsmorph",
`[ts-morph] <一行サマリ>
## When to use
- ...
## When NOT to use
- ...
## Critical constraints
- All paths (\`tsconfigPath\`, ...) MUST be absolute.
- position は 1-based(line/column)。`,
{
tsconfigPath: z.string().describe("Path to the project's tsconfig.json file."),
// ... 他パラメータ
},
async (args) => {
const startTime = performance.now();
let message = "";
let isError = false;
let duration = "0.00";
const logArgs = { /* 主要 args */ };
try {
const project = initializeProject(args.tsconfigPath);
const result = doSomething(project /*, ...args */);
message = /* result を文字列化 */ "";
} catch (error) {
safeLogError(error, logArgs);
message = `Error: ${error instanceof Error ? error.message : String(error)}`;
isError = true;
} finally {
const endTime = performance.now();
duration = ((endTime - startTime) / 1000).toFixed(2);
safeLogInfo({
status: isError ? "Failure" : "Success",
durationMs: Number.parseFloat((endTime - startTime).toFixed(2)),
...logArgs,
});
try {
logger.flush();
} catch (flushErr) {
console.error("Failed to flush logs:", flushErr);
}
}
return {
content: [
{
type: "text",
text: `${message}\nStatus: ${isError ? "Failure" : "Success"}\nProcessing time: ${duration} seconds`,
},
],
isError,
};
},
);
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 141 lines · 116 tokens per session scan A 9314a4a1a0f0
new-mcp-tool is a skill published in the GitHub repository SiroSuzume/mcp-ts-morph (16 stars, last pushed 3mo ago), licensed MIT. It adds 116 tokens to every session and 1,654 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
no-bare-casts
Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.
aws-sst-development
SST v4 (Ion) expert for managing AWS resources as code with the Pulumi-backed framework.
league-akari-shard-development
Use when creating, extending, refactoring, splitting, or reviewing League Akari main or renderer shards, including shard file organization, controller/loader/executor/handler boundaries, naming conventions, renderer TSX usage, platform guards, and public contract compatibility.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
fast-typescript-check
Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…
migrate-better-result-3
Migrate a TypeScript codebase from better-result 2.x to 3.0. Use when upgrading better-result across the TaggedError syntax, removed Result serialization helpers, recovery inference, matching, or retry APIs.