Documentation
kmcp add-tool
#
Create a boilerplate for a sample echo
tool in the tools
directory of your MCP project and update all the MCP server dependencies to import that tool. You can use this boilerplate as the base to build your own tool.
kmcp add-tool [tool-name] [flags]
Flags:
--description, -d
- Tool description--force, -f
- Overwrite existing tool file-h, --help
- Help for the command--interactive, -i
- Interactive tool creation--project-dir
- Project directory (default: current directory)
Global Flags:
--verbose, -v
- Show detailed output
Example#
The following command creates a mytool
MCP tool in the my-mcp-server
MCP project. You can edit the file and adjust the code as needed.
kmcp add-tool mytool --project-dir my-mcp-server
Kagent Lab: Discover kagent and kmcp
Free, on‑demand lab: build custom AI agents with kagent and integrate tools via kmcp on Kubernetes.