add-mcp-tools

Automate adding MCP tool domains with zod schemas and Better Auth integration.

396|51|Updated Mar 14, 2025
One-click install
npx skills add https://github.com/decocms/mesh --skill add-mcp-tools
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-mcp-tools
Source: https://github.com/decocms/mesh/tree/main/.cursor/skills/add-mcp-tools
Command: npx skills add https://github.com/decocms/mesh --skill add-mcp-tools

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide standardizes how to add new MCP tools to the MCP Mesh codebase, ensuring consistent patterns for schemas, tool definitions, and access control.

Core Features & Use Cases

  • Defines a reusable pattern for domain tools including zod schemas, defineTool integration, and Better Auth-based access control.
  • Provides a scalable blueprint for organizing tool files (schema.ts, create/list/update/delete, and index barrel) and for registry, permissions, and documentation.
  • Use Case: when expanding MCP Mesh with new domains (e.g., apiKeys, webhooks), follow this blueprint to maintain consistency and auditability.

Quick Start

Follow the checklist to implement a new MCP tool domain in apps/mesh/src/tools, including schemas, create/list/update/delete files, and Better Auth integration.

Frequently Asked Questions about add-mcp-tools

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

FAQPage Schema
How do I add new MCP tools to a codebase using Better Auth?

To add MCP tools with Better Auth, you define zod schemas, scaffold handlers via defineTool, apply access control, and update the tool registry. This enforces consistent patterns and auditability for new tool domains like webhooks or secrets.

How does defineTool structure MCP tool handlers?

The defineTool scaffolding structures MCP tool handlers by enforcing consistent input and output schemas via zod. It standardizes the tool definition process to ensure predictable execution and seamless integration with the broader tool registry.

What is the best way to organize MCP tool files for apiKeys and webhooks?

The best way to organize MCP tool files is using a scalable blueprint with separate files for schemas, create, list, update, delete operations, and an index barrel. This maintains consistency across new domains like apiKeys and webhooks.

Do I need zod schemas to define MCP tools?

Yes, zod schemas are required to define MCP tools because they enforce strict input and output validation. This schema-first approach ensures data integrity and consistency when integrating new tool domains into the registry.

Can I use Better Auth RBAC for MCP tool access control?

Yes, Better Auth RBAC can be used for MCP tool access control. It integrates directly into the tool definition process to manage permissions, ensuring only authorized users can execute specific tool handlers within the mesh.

When should I not use the MCP tools blueprint?

You should not use the MCP tools blueprint for simple, one-off scripts that do not require registry updates, strict schemas, or Better Auth integration. It is designed for expanding tool domains needing structured access control and auditability.