mcp-tool-writer

Create and register MCP tools implementing the MCPTool protocol.

6|Updated Dec 2, 2025
One-click install
npx skills add https://github.com/Sunalamye/Naki --skill mcp-tool-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-tool-writer
Source: https://github.com/Sunalamye/Naki/tree/main/skills-naki/skills/mcp-tool-writer
Command: npx skills add https://github.com/Sunalamye/Naki --skill mcp-tool-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps create and modify MCP (Model Context Protocol) tools for the Naki project, enabling scalable AI-assisted tooling. It codifies tool definitions, input schemas, and the wiring to the MCP context.

Core Features & Use Cases

  • Tool definition & schema: Define a new MCPTool with a unique name, description, and input schema.
  • Context integration: Implement execute(arguments:) using MCPContext (including JavaScript execution, status checks, and logging).
  • Tool registration: Register the new tool in MCPToolRegistry so it is discoverable by the MCP runtime.
  • Use Case: A developer adds a new MCP tool to automate a repetitive UI action and exposes it to the AI agent.

Quick Start

Create a new MCP tool struct following MCPTool protocol, implement execute(arguments:), and register it in MCPToolRegistry. Then build and test with mcp__naki__<tool_name>.

Frequently Asked Questions about mcp-tool-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new MCP tool for the Naki mahjong AI assistant?

Create a new MCP tool by defining a struct that implements the MCPTool protocol with a unique name, description, and inputSchema. Implement the execute(arguments:) method using MCPContext for interactions, then register the tool in MCPToolRegistry so the MCP runtime can discover it.

What is the MCPTool protocol and how does it work with the MCP architecture?

The MCPTool protocol is the foundation for defining tools in the Model Context Protocol architecture. Each tool requires a unique identifier, description, input schema definition, and an execute method that handles tool invocation and integrates with MCPContext for JavaScript execution, status checks, and logging.

How do I integrate MCPContext interactions like logging and JavaScript execution into a custom MCP tool?

Within your tool's execute(arguments:) method, use MCPContext to call methods like executeJavaScript, getBotStatus, triggerAutoPlay, getLogs, clearLogs, and log. These enable your tool to interact with the Naki system, retrieve bot state, and handle errors via MCPToolError.

Can I modify or update an existing MCP tool after it's been registered?

Yes, you can modify existing MCP tools by updating the tool definition, input schema, or execute implementation, then re-registering in MCPToolRegistry. The Skill supports full lifecycle management of the 26 existing SystemTools, BotTools, GameTools, UITools, and UI Names.

What error handling mechanisms does the MCP tool framework provide?

The MCP tool framework provides MCPToolError for structured error handling within your execute method. Use this to catch and report failures during tool execution, ensuring the AI agent receives actionable error information.

Do I need Swift knowledge to create MCP tools for Naki?

Yes, MCP tools for Naki are written in Swift and follow the MCPTool protocol. You should be familiar with Swift syntax, protocol implementation, and the MCPContext API to define tool schemas and execute logic.