add-mcp-tool

add-mcp-tool is a skill for Claude Code from mirkosertic/MCPLuceneServer. It costs 33 tokens per session (768 once invoked), scanned A, original, Apache-2.0.

A step-by-step guide for adding an MCP tool endpoint. MCP is a standard that lets AI applications call tools exposed by a server.

In plain words
What is it for?
Use it when creating a new tool, defining request and response objects, documenting parameters, handling optional fields, and registering the endpoint.
Why use it?
It provides the required structure for tool inputs and outputs, reducing integration mistakes and helping clients such as Claude Desktop understand the tool's schema.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when creating a new tool, defining request and response objects, documenting parameters, handling optional fields, and registering the endpoint.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mirkosertic/mcpluceneserver/add-mcp-tool
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mirkosertic/MCPLuceneServer --skill add-mcp-tool
Clone the repo
git clone --depth 1 https://github.com/mirkosertic/MCPLuceneServer

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 add-mcp-tool

README.md
[![agentmods](https://agentmods.dev/badge/skills/mirkosertic/mcpluceneserver/add-mcp-tool/github.svg)](https://agentmods.dev/skills/mirkosertic/mcpluceneserver/add-mcp-tool)
Your own site
<a href="https://agentmods.dev/skills/mirkosertic/mcpluceneserver/add-mcp-tool"><img src="https://agentmods.dev/badge/skills/mirkosertic/mcpluceneserver/add-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.

agentmods 80×15 button for add-mcp-tool

Your own site · 80×15
<a href="https://agentmods.dev/skills/mirkosertic/mcpluceneserver/add-mcp-tool"><img src="https://agentmods.dev/badge/skills/mirkosertic/mcpluceneserver/add-mcp-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 768 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.00033 $0.00768
Opus 5.5 $0.00013 $0.00307
Sonnet 5.5 $0.00007 $0.00154
Haiku 4.5 $0.00003 $0.00077

Measured 3mo ago against content hash 6a98ac4cdbb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-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 3mo 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.

.claude/skills/add-mcp-tool/SKILL.md · 111 lines

How it starts

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

Adding a New MCP Tool

Follow these steps in order when adding a new MCP tool to the server.

Step 1: Create Request DTO (if tool has parameters)

Create a new class in src/main/java/com/ohmydigital/mcpluceneserver/mcp/dto/.

Pattern:

public record MyToolRequest(
    @Description("Description of the parameter")
    String requiredParam,
    @Nullable @Description("Optional parameter")
    String optionalParam
) {
    public static MyToolRequest fromMap(final Map<String, Object> map) {
        return new MyToolRequest(
            (String) map.get("requiredParam"),
            (String) map.get("optionalParam")
        );
    }
}
  • Use @Description annotation for MCP schema generation
  • Use @Nullable for optional fields
  • Always provide a fromMap() static factory method

Step 2: Create Response DTO

Create in the same mcp/dto/ directory.

Pattern:

public record MyToolResponse(
    boolean success,
    @Nullable String error,
    // ... data fields
) {
    public static MyToolResponse success(/* data params */) {
        return new MyToolResponse(true, null, /* data */);
    }

    public static MyToolResponse error(final String message) {
        return new MyToolResponse(false, message, /* nulls */);
    }
}

All responses MUST include success (boolean) and error (nullable String).

Step 3: Register Tool Specification

In LuceneSearchTools.getToolSpecifications(), add a new ToolSpecification:

new ToolSpecification("myToolName", "Human-readable description", schemaJson)
  • Tool name: camelCase
  • Description: concise, explains what it does and when to use it
  • Schema: JSON Schema for the request parameters

Step 4: Implement Handler

Add a handler method in LuceneSearchTools:

private CallToolResult myToolName(final Map<String, Object> arguments) {
    try {
        final var request = MyToolRequest.fromMap(arguments);
        // ... implementation
        final var response = MyToolResponse.success(/* data */);
        return new CallToolResult(List.of(new TextContent(objectMapper.writeValueAsString(response))));
    } catch (final SpecificException e) {
        logger.error("myToolName failed", e);
        return new CallToolResult(List.of(new TextContent(
            objectMapper.writeValueAsString(MyToolResponse.error(e.getMessage())))));
    }
}

Read the full file on GitHub · 111 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. 3mo ago First seen · 111 lines · 33 tokens per session scan A 6a98ac4cdbb1

Subscribe to this mod's changes

add-mcp-tool is a skill published in the GitHub repository mirkosertic/MCPLuceneServer (6 stars, last pushed 18d ago), licensed Apache-2.0. It adds 33 tokens to every session and 768 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

add-mcp-tool compared with skills from other repositories

add-mcp-tool next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
add-mcp-toolmirkosertic/MCPLuceneServerSkill618d agoApache-2.0A33Claude Code
n8n-subworkflowsczlonkowski/n8n-mcpSkill23kyesterdayMITA121Claude Code, Codex
n8n-code-toolczlonkowski/n8n-mcpSkill23kyesterdayMITA221Claude Code, Codex
api-designmajiayu000/spellbookSkill301yesterdayMITA42Claude Code, Codex
sanity-singletonssanity-io/agent-toolkitSkill203yesterdayMITA90Claude Code
notion-toolxuiltul/animaworksSkill2672d agoApache-2.0A52Claude Code, Codex
verifywenlan-app/wenlanSkill502yesterdayApache-2.0A63Claude Code