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/github.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/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.

agentmods 80×15 button for documcp-tool

Your own site · 80×15
<a href="https://agentmods.dev/agents/tosin2013/documcp/documcp-tool"><img src="https://agentmods.dev/badge/agents/tosin2013/documcp/documcp-tool.svg" alt="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.5 $0.00007 $0.00317
Sonnet 5.5 $0.00003 $0.00158
Haiku 4.5 $0.00002 $0.00079

Measured 2mo ago against content hash 1d31522b3957, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 3mo ago), licensed MIT. It adds 17 tokens to every session and 792 once invoked, about $0.0001 per session on Opus 5.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

documcp-tool compared with agents from other repositories

documcp-tool next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
documcp-tooltosin2013/documcpAgent103mo agoMITA17Claude Code
angular-reviewerTheBeardedBearSAS/claude-craftAgent1073d agoMITA36Claude Code
typescript-experttravisjneuman/.claudeAgent107yesterdayMITA31Claude Code
ia-kieran-revieweriliaal/whetstoneAgent352d agoMITA54Claude Code
FAI Bun Expertfrootai/frootaiAgent74d agoMITA40Claude Code
FAI Deno Expertfrootai/frootaiAgent74d agoMITB39Claude Code
fakoli-guidofakoli/fakoli-pluginsAgent41mo agoMITA30Claude Code, Cursor