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 $0.00016 $0.00384
Sonnet 5 $0.00007 $0.00154
Haiku 4.5 $0.00003 $0.00077

Measured 9d ago against content hash 6a98ac4cdbb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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. 9d 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 (5 stars, last pushed 4d ago), licensed Apache-2.0. It adds 33 tokens to every session and 768 once invoked, about $0.0002 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 skills, from other repositories

n8n-code-tool

Write JavaScript or Python for the n8n Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode) — the AI-agent-callable tool, NOT the workflow Code node. Use when building a Code Tool attached to an AI Agent, writing code that an LLM will invoke, parsing the query input, returning a string result, defining an input schema…

czlonkowski/n8n-mcp · 221 tokens

n8n-subworkflows

Build reusable, composable n8n sub-workflows. Use when extracting shared logic, building anything multi-step or reused across workflows, or any workflow over 10 nodes — and whenever the user mentions sub-workflows, Execute Workflow, reuse, shared/common logic, modular workflows, "Define Below" inputs…

czlonkowski/n8n-mcp · 121 tokens

notion

Notion workspace integration for searching pages, managing databases, creating postmortems, and exporting RCA findings.

Arvo-AI/aurora · 23 tokens

api-design

REST/GraphQL/gRPC API design best practices. Use when designing APIs, defining contracts, handling versioning. Covers OpenAPI 3.2, GraphQL Federation, gRPC streaming.

majiayu000/spellbook · 42 tokens

notion-tool

Notion integration tool for searching, reading, creating, and updating pages and databases via the API. Use when: editing Notion pages, adding database rows, or searching a workspace.

xuiltul/animaworks · 41 tokens

toolify

When you want to integrate an external tool, API, MCP server, or service into a project — the wizard walks you through auth, config, env vars, client wrapper code, example usage, and (optionally) a smoke-test. Scoped to Next.js and Rails projects (the two primary stacks). Interactive Q&A pattern — starts with the tool…

coreyhaines31/makerskills · 261 tokens