mcp-loader
v0.2.0
Published
Auto-discover and load MCP tools from a directory
Maintainers
Readme
MCP Loader
Drop .ts or .js files in a folder. They become MCP tools. That's it.
Quick Start
// .claude/tool/math.ts
import { tool } from "mcp-loader";
export const add = tool({
description: "Add two numbers",
args: {
a: tool.schema.number(),
b: tool.schema.number(),
},
execute: ({ a, b }) => a + b,
});Add to .mcp.json:
{
"mcpServers": {
"tools": {
"command": "npx",
"args": ["mcp-loader", ".claude/tool"]
}
}
}Done. Tools work in Claude.
Install
Global install:
npm install -g mcp-loaderOr as a dev dependency:
npm install --save-dev mcp-loaderOr just use npx (no install):
npx mcp-loader .claude/toolFeatures
- Hot reload - Save file, tool updates (disable with
MCP_NO_HOT_RELOAD=true) - Multiple tools per file - Use named exports
- MCP context - Second param in execute has request info
- TypeScript - Full type safety
Note
After changing tools, refresh with /mcp in Claude Code or restart Claude Desktop.
License
MIT
