agentkit-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mikiships
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,180 @@
1
+ # agentkit-mcp
2
+
3
+ [![Works with Claude Code](https://img.shields.io/badge/Works%20with-Claude%20Code-blue)](https://claude.ai/code)
4
+ [![npm version](https://img.shields.io/npm/v/agentkit-mcp)](https://www.npmjs.com/package/agentkit-mcp)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+
7
+ MCP server that exposes the **agent quality quartet** — [coderace](https://github.com/mikiships/coderace), [agentmd](https://github.com/mikiships/agentmd-gen), [agentlint](https://github.com/mikiships/ai-agentlint), [agentreflect](https://github.com/mikiships/ai-agentreflect) — as tools inside Claude Code and any MCP-compatible client.
8
+
9
+ No context-switching. Run multi-agent code races, generate CLAUDE.md, lint diffs, and reflect on agent failures — all from within your AI coding session.
10
+
11
+ ## Prerequisites
12
+
13
+ Install the four Python CLIs:
14
+
15
+ ```bash
16
+ pip install coderace agentmd-gen ai-agentlint ai-agentreflect
17
+ ```
18
+
19
+ Or with pipx (recommended):
20
+
21
+ ```bash
22
+ pipx install coderace
23
+ pipx install agentmd-gen
24
+ pipx install ai-agentlint
25
+ pipx install ai-agentreflect
26
+ ```
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ npm install -g agentkit-mcp
32
+ ```
33
+
34
+ Or use directly without installing via `npx agentkit-mcp`.
35
+
36
+ ## Configure
37
+
38
+ ### Claude Code
39
+
40
+ ```bash
41
+ claude mcp add agentkit-mcp npx agentkit-mcp
42
+ ```
43
+
44
+ ### Manual `.mcp.json`
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "agentkit": {
50
+ "command": "npx",
51
+ "args": ["agentkit-mcp"]
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ Place this file in your project root or `~/.claude/`.
58
+
59
+ ## Tools
60
+
61
+ ### `coderace_race`
62
+
63
+ Run a multi-agent coding race on a repository.
64
+
65
+ ```
66
+ repo_path (required) Absolute path to the repository root
67
+ agents (optional) Comma-separated agent names: "codex,claude"
68
+ task (optional) Task description to pass to agents
69
+ ```
70
+
71
+ Example prompt in Claude Code:
72
+ > "Run a coderace race on `/Users/me/myrepo` with agents `codex,claude` to implement a binary search function."
73
+
74
+ ---
75
+
76
+ ### `coderace_review`
77
+
78
+ Multi-lane AI code review on staged changes or a branch diff.
79
+
80
+ ```
81
+ repo_path (required) Absolute path to the repository root
82
+ diff_source (optional) staged | branch | diff
83
+ lanes (optional) Comma-separated lane names
84
+ cross_reviewers (optional) Number of cross-reviewers
85
+ ```
86
+
87
+ Example:
88
+ > "Review the staged changes in `/Users/me/myrepo` using coderace_review."
89
+
90
+ ---
91
+
92
+ ### `agentmd_generate`
93
+
94
+ Generate a `CLAUDE.md` / `AGENTS.md` from a repository. Inspects code structure, dependencies, and conventions.
95
+
96
+ ```
97
+ repo_path (required) Absolute path to the repository root
98
+ output (optional) Output file path (default: CLAUDE.md in repo root)
99
+ minimal (optional) Generate a minimal file
100
+ tiered (optional) Generate a tiered/layered file
101
+ ```
102
+
103
+ Example:
104
+ > "Generate a CLAUDE.md for `/Users/me/myrepo`."
105
+
106
+ ---
107
+
108
+ ### `agentmd_diff`
109
+
110
+ Show a diff between the current `CLAUDE.md` and a freshly generated one. Spot what's gone stale.
111
+
112
+ ```
113
+ repo_path (required) Absolute path to the repository root
114
+ output (optional) Output file path
115
+ ```
116
+
117
+ ---
118
+
119
+ ### `agentlint_check`
120
+
121
+ Lint a git diff for agent-safety issues: missing context, ambiguous instructions, prompt-injection risks.
122
+
123
+ ```
124
+ diff (required) Git diff content (paste text) OR path to a .diff file
125
+ ```
126
+
127
+ Example:
128
+ > "Lint this diff with agentlint_check: <paste git diff output>"
129
+
130
+ ---
131
+
132
+ ### `agentlint_check_context`
133
+
134
+ Lint an `AGENTS.md` or `CLAUDE.md` for freshness, completeness, and structural quality. Returns a freshness score and actionable suggestions.
135
+
136
+ ```
137
+ file (required) Path to AGENTS.md or CLAUDE.md
138
+ ```
139
+
140
+ Example:
141
+ > "Check if my AGENTS.md at `/Users/me/myrepo/AGENTS.md` is up to date."
142
+
143
+ ---
144
+
145
+ ### `agentreflect_generate`
146
+
147
+ Generate agent improvement suggestions from notes, pytest output, or git history. Optionally apply them to `AGENTS.md` / `CLAUDE.md`.
148
+
149
+ ```
150
+ from_notes (optional) Free-form notes to reflect on
151
+ from_pytest (optional) Path to pytest output file
152
+ from_git (optional) Reflect from recent git log
153
+ apply (optional) Path to apply suggestions to
154
+ yes (optional) Auto-accept all suggestions
155
+ ```
156
+
157
+ Example:
158
+ > "Use agentreflect_generate with these notes: 'Tests failed 3 times, agent missed the cwd convention.'"
159
+
160
+ ---
161
+
162
+ ## Development
163
+
164
+ ```bash
165
+ git clone https://github.com/mikiships/agentkit-mcp
166
+ cd agentkit-mcp
167
+ npm install
168
+ npm run build
169
+ npm test
170
+ ```
171
+
172
+ To test locally as an MCP server:
173
+
174
+ ```bash
175
+ node dist/index.js
176
+ ```
177
+
178
+ ## License
179
+
180
+ MIT
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
5
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
6
+ const zod_1 = require("zod");
7
+ const tools_js_1 = require("./tools.js");
8
+ const server = new mcp_js_1.McpServer({
9
+ name: "agentkit-mcp",
10
+ version: "0.1.0",
11
+ });
12
+ // ── coderace_race ──────────────────────────────────────────────────────────
13
+ server.registerTool("coderace_race", {
14
+ title: "Coderace Race",
15
+ description: "Run a multi-agent coding race on a repository. Agents compete to implement a task; best solution wins.",
16
+ inputSchema: {
17
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
18
+ agents: zod_1.z
19
+ .string()
20
+ .optional()
21
+ .describe("Comma-separated agent names to race (e.g. 'codex,claude')"),
22
+ task: zod_1.z.string().optional().describe("Task description to pass to agents"),
23
+ },
24
+ }, async ({ repo_path, agents, task }) => {
25
+ const text = await (0, tools_js_1.coderaceRace)({ repo_path, agents, task });
26
+ return { content: [{ type: "text", text }] };
27
+ });
28
+ // ── coderace_review ────────────────────────────────────────────────────────
29
+ server.registerTool("coderace_review", {
30
+ title: "Coderace Review",
31
+ description: "Run a multi-lane AI code review on staged changes or a branch diff. Returns structured feedback.",
32
+ inputSchema: {
33
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
34
+ diff_source: zod_1.z
35
+ .enum(["staged", "branch", "diff"])
36
+ .optional()
37
+ .describe("Where to get the diff from (staged/branch/diff)"),
38
+ lanes: zod_1.z.string().optional().describe("Comma-separated review lane names"),
39
+ cross_reviewers: zod_1.z
40
+ .string()
41
+ .optional()
42
+ .describe("Number of cross-reviewers"),
43
+ },
44
+ }, async ({ repo_path, diff_source, lanes, cross_reviewers }) => {
45
+ const text = await (0, tools_js_1.coderaceReview)({ repo_path, diff_source, lanes, cross_reviewers });
46
+ return { content: [{ type: "text", text }] };
47
+ });
48
+ // ── agentmd_generate ───────────────────────────────────────────────────────
49
+ server.registerTool("agentmd_generate", {
50
+ title: "AgentMD Generate",
51
+ description: "Generate a CLAUDE.md / AGENTS.md from a repository. Inspects the codebase and produces an agent context document.",
52
+ inputSchema: {
53
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
54
+ output: zod_1.z
55
+ .string()
56
+ .optional()
57
+ .describe("Output file path (defaults to CLAUDE.md in repo root)"),
58
+ minimal: zod_1.z.boolean().optional().describe("Generate a minimal CLAUDE.md"),
59
+ tiered: zod_1.z.boolean().optional().describe("Generate a tiered/layered CLAUDE.md"),
60
+ },
61
+ }, async ({ repo_path, output, minimal, tiered }) => {
62
+ const text = await (0, tools_js_1.agentmdGenerate)({ repo_path, output, minimal, tiered });
63
+ return { content: [{ type: "text", text }] };
64
+ });
65
+ // ── agentmd_diff ───────────────────────────────────────────────────────────
66
+ server.registerTool("agentmd_diff", {
67
+ title: "AgentMD Diff",
68
+ description: "Show a diff between the current CLAUDE.md and a freshly generated one. Useful to spot staleness.",
69
+ inputSchema: {
70
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
71
+ output: zod_1.z.string().optional().describe("Output file path"),
72
+ },
73
+ }, async ({ repo_path, output }) => {
74
+ const text = await (0, tools_js_1.agentmdDiff)({ repo_path, output });
75
+ return { content: [{ type: "text", text }] };
76
+ });
77
+ // ── agentlint_check ────────────────────────────────────────────────────────
78
+ server.registerTool("agentlint_check", {
79
+ title: "Agentlint Check",
80
+ description: "Lint a git diff for agent-safety issues: missing context, ambiguous instructions, prompt-injection risks.",
81
+ inputSchema: {
82
+ diff: zod_1.z
83
+ .string()
84
+ .describe("Git diff content (paste the diff text) OR a file path to a .diff file"),
85
+ },
86
+ }, async ({ diff }) => {
87
+ const text = await (0, tools_js_1.agentlintCheck)({ diff });
88
+ return { content: [{ type: "text", text }] };
89
+ });
90
+ // ── agentlint_check_context ────────────────────────────────────────────────
91
+ server.registerTool("agentlint_check_context", {
92
+ title: "Agentlint Check Context",
93
+ description: "Lint an AGENTS.md or CLAUDE.md for freshness, completeness, and structural issues. Returns a freshness score and actionable suggestions.",
94
+ inputSchema: {
95
+ file: zod_1.z.string().describe("Path to AGENTS.md or CLAUDE.md to lint"),
96
+ },
97
+ }, async ({ file }) => {
98
+ const text = await (0, tools_js_1.agentlintCheckContext)({ file });
99
+ return { content: [{ type: "text", text }] };
100
+ });
101
+ // ── agentreflect_generate ──────────────────────────────────────────────────
102
+ server.registerTool("agentreflect_generate", {
103
+ title: "Agentreflect Generate",
104
+ description: "Generate agent improvement suggestions from notes, pytest output, or git history. Optionally apply them to AGENTS.md / CLAUDE.md.",
105
+ inputSchema: {
106
+ from_notes: zod_1.z.string().optional().describe("Free-form notes to reflect on"),
107
+ from_pytest: zod_1.z.string().optional().describe("Path to pytest output file"),
108
+ from_git: zod_1.z
109
+ .boolean()
110
+ .optional()
111
+ .describe("Reflect from recent git log (runs in cwd)"),
112
+ apply: zod_1.z
113
+ .string()
114
+ .optional()
115
+ .describe("Path to apply suggestions to (AGENTS.md or CLAUDE.md)"),
116
+ yes: zod_1.z
117
+ .boolean()
118
+ .optional()
119
+ .describe("Auto-accept all suggestions without prompting"),
120
+ },
121
+ }, async ({ from_notes, from_pytest, from_git, apply, yes }) => {
122
+ const text = await (0, tools_js_1.agentreflectGenerate)({ from_notes, from_pytest, from_git, apply, yes });
123
+ return { content: [{ type: "text", text }] };
124
+ });
125
+ // ── Start ──────────────────────────────────────────────────────────────────
126
+ async function main() {
127
+ const transport = new stdio_js_1.StdioServerTransport();
128
+ await server.connect(transport);
129
+ // Server is now running; log to stderr so it doesn't pollute stdout (MCP wire format)
130
+ process.stderr.write("agentkit-mcp server started\n");
131
+ }
132
+ main().catch((err) => {
133
+ process.stderr.write(`Fatal: ${err}\n`);
134
+ process.exit(1);
135
+ });
136
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,oEAAoE;AACpE,wEAAiF;AACjF,6BAAwB;AACxB,yCAQoB;AAEpB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IAC3B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;IACE,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,wGAAwG;IAC1G,WAAW,EAAE;QACX,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QACtE,MAAM,EAAE,OAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,2DAA2D,CAAC;QACxE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;KAC3E;CACF,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,MAAM,IAAA,uBAAY,EAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE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Q,CAAC,uDAAuD,CAAC;QACpE,GAAG,EAAE,OAAC;aACH,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,+CAA+C,CAAC;KAC7D;CACF,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,MAAM,IAAA,+BAAoB,EAAC,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC,CACF,CAAC;AAEF,8EAA8E;AAC9E,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,sFAAsF;IACtF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ export interface RunResult {
2
+ stdout: string;
3
+ stderr: string;
4
+ exitCode: number;
5
+ }
6
+ /**
7
+ * Run a CLI command and return its output.
8
+ * If the CLI is not found, returns a structured error.
9
+ */
10
+ export declare function runCLI(cmd: string, args: string[], options?: {
11
+ cwd?: string;
12
+ stdin?: string;
13
+ timeoutMs?: number;
14
+ }): Promise<RunResult>;
15
+ /** Format RunResult as a tool response text */
16
+ export declare function formatResult(result: RunResult): string;
17
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,MAAM,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACjE,OAAO,CAAC,SAAS,CAAC,CA2DpB;AAYD,+CAA+C;AAC/C,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAkBtD"}
package/dist/runner.js ADDED
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCLI = runCLI;
4
+ exports.formatResult = formatResult;
5
+ const child_process_1 = require("child_process");
6
+ /**
7
+ * Run a CLI command and return its output.
8
+ * If the CLI is not found, returns a structured error.
9
+ */
10
+ function runCLI(cmd, args, options = {}) {
11
+ return new Promise((resolve) => {
12
+ const timeoutMs = options.timeoutMs ?? 120_000;
13
+ let timedOut = false;
14
+ const child = (0, child_process_1.spawn)(cmd, args, {
15
+ cwd: options.cwd,
16
+ env: {
17
+ ...process.env,
18
+ // Ensure pipx/local bin is on PATH
19
+ PATH: `/Users/mordecai/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:${process.env.PATH ?? ""}`,
20
+ },
21
+ stdio: ["pipe", "pipe", "pipe"],
22
+ });
23
+ let stdout = "";
24
+ let stderr = "";
25
+ child.stdout.on("data", (d) => {
26
+ stdout += d.toString();
27
+ });
28
+ child.stderr.on("data", (d) => {
29
+ stderr += d.toString();
30
+ });
31
+ if (options.stdin) {
32
+ child.stdin.write(options.stdin);
33
+ child.stdin.end();
34
+ }
35
+ else {
36
+ child.stdin.end();
37
+ }
38
+ const timer = setTimeout(() => {
39
+ timedOut = true;
40
+ child.kill("SIGTERM");
41
+ }, timeoutMs);
42
+ child.on("error", (err) => {
43
+ clearTimeout(timer);
44
+ if (err.code === "ENOENT") {
45
+ resolve({
46
+ stdout: "",
47
+ stderr: `CLI not found: ${cmd}. Install with: pip install ${cliToPackage(cmd)}`,
48
+ exitCode: 127,
49
+ });
50
+ }
51
+ else {
52
+ resolve({ stdout: "", stderr: err.message, exitCode: 1 });
53
+ }
54
+ });
55
+ child.on("close", (code) => {
56
+ clearTimeout(timer);
57
+ resolve({
58
+ stdout,
59
+ stderr: timedOut ? `Process timed out after ${timeoutMs}ms\n${stderr}` : stderr,
60
+ exitCode: code ?? (timedOut ? 124 : 1),
61
+ });
62
+ });
63
+ });
64
+ }
65
+ function cliToPackage(cmd) {
66
+ const map = {
67
+ coderace: "coderace",
68
+ agentmd: "agentmd-gen",
69
+ agentlint: "ai-agentlint",
70
+ agentreflect: "ai-agentreflect",
71
+ };
72
+ return map[cmd] ?? cmd;
73
+ }
74
+ /** Format RunResult as a tool response text */
75
+ function formatResult(result) {
76
+ if (result.exitCode === 127) {
77
+ return `Error: ${result.stderr}`;
78
+ }
79
+ const parts = [];
80
+ if (result.stdout.trim())
81
+ parts.push(result.stdout.trim());
82
+ if (result.stderr.trim()) {
83
+ // Only surface stderr if exit was non-zero (treat as warning/info otherwise)
84
+ if (result.exitCode !== 0) {
85
+ parts.push(`[stderr]\n${result.stderr.trim()}`);
86
+ }
87
+ }
88
+ if (parts.length === 0) {
89
+ return result.exitCode === 0
90
+ ? "(no output)"
91
+ : `Command exited with code ${result.exitCode}`;
92
+ }
93
+ return parts.join("\n\n");
94
+ }
95
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],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,CAAC;IACF,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;AACzB,CAAC;AAED,+CAA+C;AAC/C,SAAgB,YAAY,CAAC,MAAiB;IAC5C,IAAI,MAAM,CAAC,QAAQ,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC;IACnC,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QACzB,6EAA6E;QAC7E,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC;YAC1B,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,4BAA4B,MAAM,CAAC,QAAQ,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+ export declare const CoderaceRaceSchema: z.ZodObject<{
3
+ repo_path: z.ZodString;
4
+ agents: z.ZodOptional<z.ZodString>;
5
+ task: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export declare const CoderaceReviewSchema: z.ZodObject<{
8
+ repo_path: z.ZodString;
9
+ diff_source: z.ZodOptional<z.ZodEnum<{
10
+ staged: "staged";
11
+ branch: "branch";
12
+ diff: "diff";
13
+ }>>;
14
+ lanes: z.ZodOptional<z.ZodString>;
15
+ cross_reviewers: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ export declare const AgentmdGenerateSchema: z.ZodObject<{
18
+ repo_path: z.ZodString;
19
+ output: z.ZodOptional<z.ZodString>;
20
+ minimal: z.ZodOptional<z.ZodBoolean>;
21
+ tiered: z.ZodOptional<z.ZodBoolean>;
22
+ }, z.core.$strip>;
23
+ export declare const AgentmdDiffSchema: z.ZodObject<{
24
+ repo_path: z.ZodString;
25
+ output: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ export declare const AgentlintCheckSchema: z.ZodObject<{
28
+ diff: z.ZodString;
29
+ }, z.core.$strip>;
30
+ export declare const AgentlintCheckContextSchema: z.ZodObject<{
31
+ file: z.ZodString;
32
+ }, z.core.$strip>;
33
+ export declare const AgentreflectGenerateSchema: z.ZodObject<{
34
+ from_notes: z.ZodOptional<z.ZodString>;
35
+ from_pytest: z.ZodOptional<z.ZodString>;
36
+ from_git: z.ZodOptional<z.ZodBoolean>;
37
+ apply: z.ZodOptional<z.ZodString>;
38
+ yes: z.ZodOptional<z.ZodBoolean>;
39
+ }, z.core.$strip>;
40
+ export declare function coderaceRace(args: z.infer<typeof CoderaceRaceSchema>): Promise<string>;
41
+ export declare function coderaceReview(args: z.infer<typeof CoderaceReviewSchema>): Promise<string>;
42
+ export declare function agentmdGenerate(args: z.infer<typeof AgentmdGenerateSchema>): Promise<string>;
43
+ export declare function agentmdDiff(args: z.infer<typeof AgentmdDiffSchema>): Promise<string>;
44
+ export declare function agentlintCheck(args: z.infer<typeof AgentlintCheckSchema>): Promise<string>;
45
+ export declare function agentlintCheckContext(args: z.infer<typeof AgentlintCheckContextSchema>): Promise<string>;
46
+ export declare function agentreflectGenerate(args: z.infer<typeof AgentreflectGenerateSchema>): Promise<string>;
47
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"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.js ADDED
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentreflectGenerateSchema = exports.AgentlintCheckContextSchema = exports.AgentlintCheckSchema = exports.AgentmdDiffSchema = exports.AgentmdGenerateSchema = exports.CoderaceReviewSchema = exports.CoderaceRaceSchema = void 0;
4
+ exports.coderaceRace = coderaceRace;
5
+ exports.coderaceReview = coderaceReview;
6
+ exports.agentmdGenerate = agentmdGenerate;
7
+ exports.agentmdDiff = agentmdDiff;
8
+ exports.agentlintCheck = agentlintCheck;
9
+ exports.agentlintCheckContext = agentlintCheckContext;
10
+ exports.agentreflectGenerate = agentreflectGenerate;
11
+ const zod_1 = require("zod");
12
+ const runner_js_1 = require("./runner.js");
13
+ // ---------------------------------------------------------------------------
14
+ // Zod schemas for each tool's input
15
+ // ---------------------------------------------------------------------------
16
+ exports.CoderaceRaceSchema = zod_1.z.object({
17
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
18
+ agents: zod_1.z.string().optional().describe("Comma-separated agent names to race (e.g. 'codex,claude')"),
19
+ task: zod_1.z.string().optional().describe("Task description to pass to agents"),
20
+ });
21
+ exports.CoderaceReviewSchema = zod_1.z.object({
22
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
23
+ diff_source: zod_1.z
24
+ .enum(["staged", "branch", "diff"])
25
+ .optional()
26
+ .describe("Where to get the diff from (staged/branch/diff)"),
27
+ lanes: zod_1.z.string().optional().describe("Comma-separated review lane names"),
28
+ cross_reviewers: zod_1.z.string().optional().describe("Number of cross-reviewers"),
29
+ });
30
+ exports.AgentmdGenerateSchema = zod_1.z.object({
31
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
32
+ output: zod_1.z.string().optional().describe("Output file path (defaults to CLAUDE.md in repo)"),
33
+ minimal: zod_1.z.boolean().optional().describe("Generate minimal CLAUDE.md"),
34
+ tiered: zod_1.z.boolean().optional().describe("Generate tiered/layered CLAUDE.md"),
35
+ });
36
+ exports.AgentmdDiffSchema = zod_1.z.object({
37
+ repo_path: zod_1.z.string().describe("Absolute path to the repository root"),
38
+ output: zod_1.z.string().optional().describe("Output file path"),
39
+ });
40
+ exports.AgentlintCheckSchema = zod_1.z.object({
41
+ diff: zod_1.z.string().describe("Git diff content (as text) OR a file path to a diff file"),
42
+ });
43
+ exports.AgentlintCheckContextSchema = zod_1.z.object({
44
+ file: zod_1.z.string().describe("Path to AGENTS.md or CLAUDE.md to lint"),
45
+ });
46
+ exports.AgentreflectGenerateSchema = zod_1.z.object({
47
+ from_notes: zod_1.z.string().optional().describe("Free-form notes to reflect on"),
48
+ from_pytest: zod_1.z.string().optional().describe("Path to pytest output file"),
49
+ from_git: zod_1.z.boolean().optional().describe("Reflect from recent git log"),
50
+ apply: zod_1.z.string().optional().describe("Path to apply suggestions to (AGENTS.md/CLAUDE.md)"),
51
+ yes: zod_1.z.boolean().optional().describe("Auto-accept all suggestions without prompting"),
52
+ });
53
+ // ---------------------------------------------------------------------------
54
+ // Tool handlers
55
+ // ---------------------------------------------------------------------------
56
+ async function coderaceRace(args) {
57
+ const cmdArgs = ["race"];
58
+ if (args.agents)
59
+ cmdArgs.push("--agents", args.agents);
60
+ if (args.task)
61
+ cmdArgs.push("--task", args.task);
62
+ const result = await (0, runner_js_1.runCLI)("coderace", cmdArgs, { cwd: args.repo_path });
63
+ return (0, runner_js_1.formatResult)(result);
64
+ }
65
+ async function coderaceReview(args) {
66
+ const cmdArgs = ["review"];
67
+ if (args.diff_source)
68
+ cmdArgs.push("--diff-source", args.diff_source);
69
+ if (args.lanes)
70
+ cmdArgs.push("--lanes", args.lanes);
71
+ if (args.cross_reviewers)
72
+ cmdArgs.push("--cross-reviewers", args.cross_reviewers);
73
+ const result = await (0, runner_js_1.runCLI)("coderace", cmdArgs, { cwd: args.repo_path });
74
+ return (0, runner_js_1.formatResult)(result);
75
+ }
76
+ async function agentmdGenerate(args) {
77
+ const cmdArgs = [];
78
+ if (args.output)
79
+ cmdArgs.push("--output", args.output);
80
+ if (args.minimal)
81
+ cmdArgs.push("--minimal");
82
+ if (args.tiered)
83
+ cmdArgs.push("--tiered");
84
+ const result = await (0, runner_js_1.runCLI)("agentmd", cmdArgs, { cwd: args.repo_path });
85
+ return (0, runner_js_1.formatResult)(result);
86
+ }
87
+ async function agentmdDiff(args) {
88
+ const cmdArgs = ["diff"];
89
+ if (args.output)
90
+ cmdArgs.push("--output", args.output);
91
+ const result = await (0, runner_js_1.runCLI)("agentmd", cmdArgs, { cwd: args.repo_path });
92
+ return (0, runner_js_1.formatResult)(result);
93
+ }
94
+ async function agentlintCheck(args) {
95
+ // diff can be raw content (piped) or a file path
96
+ const isFilePath = !args.diff.includes("\n") && args.diff.trim().length < 500;
97
+ let result;
98
+ if (isFilePath) {
99
+ result = await (0, runner_js_1.runCLI)("agentlint", ["check", args.diff]);
100
+ }
101
+ else {
102
+ // pipe diff content via stdin
103
+ result = await (0, runner_js_1.runCLI)("agentlint", ["check", "-"], { stdin: args.diff });
104
+ }
105
+ return (0, runner_js_1.formatResult)(result);
106
+ }
107
+ async function agentlintCheckContext(args) {
108
+ const result = await (0, runner_js_1.runCLI)("agentlint", ["check-context", args.file]);
109
+ return (0, runner_js_1.formatResult)(result);
110
+ }
111
+ async function agentreflectGenerate(args) {
112
+ const cmdArgs = [];
113
+ if (args.from_notes)
114
+ cmdArgs.push("--from-notes", args.from_notes);
115
+ if (args.from_pytest)
116
+ cmdArgs.push("--from-pytest", args.from_pytest);
117
+ if (args.from_git)
118
+ cmdArgs.push("--from-git");
119
+ if (args.apply)
120
+ cmdArgs.push("--apply", args.apply);
121
+ if (args.yes)
122
+ cmdArgs.push("--yes");
123
+ const result = await (0, runner_js_1.runCLI)("agentreflect", cmdArgs);
124
+ return (0, runner_js_1.formatResult)(result);
125
+ }
126
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";;;AAu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int, and agentreflect as tools for Claude Code and MCP clients",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "agentkit-mcp": "dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "start": "node dist/index.js",
12
+ "dev": "ts-node src/index.ts",
13
+ "test": "vitest run",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "claude",
19
+ "agentmd",
20
+ "agentlint",
21
+ "agentreflect",
22
+ "coderace",
23
+ "agent-quality",
24
+ "claude-code"
25
+ ],
26
+ "author": "mikiships",
27
+ "license": "MIT",
28
+ "dependencies": {
29
+ "@modelcontextprotocol/sdk": "^1.10.2",
30
+ "zod": "^4.3.6"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^22.0.0",
34
+ "typescript": "^5.7.0",
35
+ "vitest": "^3.1.1"
36
+ },
37
+ "engines": {
38
+ "node": ">=18"
39
+ },
40
+ "files": [
41
+ "dist/",
42
+ "README.md",
43
+ "LICENSE"
44
+ ],
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/mikiships/agentkit-mcp.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/mikiships/agentkit-mcp/issues"
51
+ },
52
+ "homepage": "https://github.com/mikiships/agentkit-mcp#readme"
53
+ }