documcp: Agent for Claude Code

.github/agents/documcp-tool.md

documcp-tool is an agent for Claude Code from tosin2013/documcp. It costs 17 tokens per session (792 once invoked), scanned A, original, MIT.

A guide for building MCP tools in DocuMCP’s established TypeScript structure. MCP is a standard way for an AI assistant to call external tools.

In plain words
What is it for?
Use it when adding or modifying a DocuMCP tool with Zod input schemas, timing metadata, and the project’s response format.
Why use it?
It gives developers a consistent pattern for input validation, business logic, error handling, and formatted results.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

This is tosin2013/documcp's own configuration. It tells Claude Code how to work on documcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything documcp configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { MCPToolResponse, formatMCPResponse } from "../types/api.js";.

Reuse

Borrowing it

Nothing to install: this file belongs to tosin2013/documcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tosin2013/documcp/main/.github/agents/documcp-tool.md
Clone the repo
git clone --depth 1 https://github.com/tosin2013/documcp

Made for: Claude Code.

Wrote 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.

agentmods badge for documcp-tool

README.md
[![agentmods](https://agentmods.dev/badge/agents/tosin2013/documcp/documcp-tool.svg)](https://agentmods.dev/agents/tosin2013/documcp/documcp-tool)
Your own site
<a href="https://agentmods.dev/agents/tosin2013/documcp/documcp-tool"><img src="https://agentmods.dev/badge/agents/tosin2013/documcp/documcp-tool.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 792 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.00792
Opus 5 $0.00009 $0.00396
Sonnet 5 $0.00003 $0.00158
Haiku 4.5 $0.00002 $0.00079

Measured 6d ago against content hash 1d31522b3957, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

documcp-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 6d 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.

.github/agents/documcp-tool.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert at building MCP tools for DocuMCP following established patterns.

Tool Implementation Pattern

Every DocuMCP tool MUST follow this structure:

  1. Import required modules:
import { z } from "zod";
import { MCPToolResponse, formatMCPResponse } from "../types/api.js";
import { promises as fs } from "fs";
import path from "path";
  1. Define Zod input schema:
const inputSchema = z.object({
  // Define all parameters with types and constraints
  path: z.string().describe("Description for parameter"),
  depth: z.enum(["quick", "standard", "deep"]).optional().default("standard"),
});
  1. Implement tool function:
export async function myTool(args: unknown): Promise<MCPToolResponse> {
  const startTime = Date.now();

  try {
    // 1. Validate input
    const input = inputSchema.parse(args);

    // 2. Business logic here
    const result = await performAnalysis(input);

    // 3. Return formatted response
    return formatMCPResponse({
      success: true,
      data: result,
      metadata: {
        toolVersion: "1.0.0",
        executionTime: Date.now() - startTime,
        timestamp: new Date().toISOString(),
      },
      recommendations: [
        {
          type: "info",
          title: "Next Steps",
          description: "Consider running X tool next",
        },
      ],
    });
  } catch (error) {
    return formatMCPResponse({
      success: false,
      error: {
        code: "TOOL_ERROR",
        message: error instanceof Error ? error.message : "Unknown error",
        resolution: "Check inputs and try again",
      },
      metadata: {
        toolVersion: "1.0.0",
        executionTime: Date.now() - startTime,
        timestamp: new Date().toISOString(),
      },
    });
  }
}
  1. Integration steps:
    • Add tool to src/index.ts TOOLS array
    • Add handler in CallToolRequestSchema switch
    • Create tests in tests/tools/
    • Run npm run ci to validate

Read the full file on GitHub · 123 lines

Changes

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.

  1. 6d ago First seen · 123 lines · 17 tokens per session scan A 1d31522b3957

Subscribe to this mod's changes

documcp-tool is an agent published in the GitHub repository tosin2013/documcp (10 stars, last pushed 1mo ago), licensed MIT. It adds 17 tokens to every session and 792 once invoked, about $0.0001 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-31.

Related

Other agents, from other repositories

angular-reviewer

Angular 22 and TypeScript code review specialist — Signals, Signal Forms (stable), standalone components, RxJS, performance, zoneless change detection, httpResource.

TheBeardedBearSAS/claude-craft · 36 tokens

typescript-expert

TypeScript type system mastery including generics, conditional types, and advanced patterns. Use when solving complex type problems or improving type safety.

travisjneuman/.claude · 31 tokens

ia-kieran-reviewer

Persona-driven line-level Python and TypeScript code review with extremely high bar for type safety, naming conventions, and modern patterns. Use for line-level Py/TS quality after PR implementation. For broader review workflow, use the code-review skill.

iliaal/whetstone · 54 tokens

typescript-spec

TypeScript 고급 타입 시스템 전문가. 제네릭, 조건부 타입, 유틸리티 타입, 타입 추론 최적화. "TypeScript 타입", "제네릭", "타입 에러", "tsconfig" 요청에 실행.

Dannykkh/skill-olympus · 57 tokens

react-frontend-engineer

React frontend engineer for Arthur MCP. Use when implementing, debugging, refactoring, or testing React/TypeScript frontend features, including Feature-Driven Architecture, Atomic Design, barrel exports, pages, components, hooks, state, routing, forms, API integration, i18n, performance, accessibility, and frontend…

alexmmatos/arthur-mcp · 70 tokens

vue-expert

Use this agent when building Vue 3 applications that require Composition API mastery, reactivity optimization, or Nuxt 3 development with enterprise-scale performance concerns.

alexmmatos/arthur-mcp · 35 tokens