diy-tools-mcp
An MCP server that allows users to dynamically add custom tools/functions at runtime
Install / Use
claude mcp add hesreallyhim -- npx -y github:hesreallyhim/diy-tools-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of diy-tools-mcp
diy-tools-mcp scores 84/100 on our quality scale, 2806th of 4,614 Development & Engineering skills we index.
Its MCP Server is 16 KB long, well organised into 52 sections with 16 code examples: a thorough specification that gives an agent plenty to work with.
It has 44 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 2 days ago, so diy-tools-mcp is actively maintained.
- Our last check on 2026-10-21 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
diy-tools-mcp compared with similar skills
All 4 of these similar skills score higher than diy-tools-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| diy-tools-mcp (this skill)by hesreallyhim | 84 | 44 | 2d ago | MCP Server |
| taste-skillby Leonxlnx | 100 | 111.0k | 1d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.5k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.0k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 70.0k | today | CLAUDE.md |
Frequently asked questions
- How do I install diy-tools-mcp?
- Run
claude mcp add hesreallyhim -- npx -y github:hesreallyhim/diy-tools-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does diy-tools-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is diy-tools-mcp safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is diy-tools-mcp still maintained?
- The repository was last updated 2 days ago, so diy-tools-mcp is actively maintained.
Skill content
View source on GitHubDIY Tools MCP Server
A Model Context Protocol (MCP) server that allows you to create custom tools/functions at runtime in any programming language and expose them to Claude or other MCP clients.
Overview
The DIY Tools MCP server enables you to dynamically add custom tools without needing to write a full MCP server. Simply provide the function code, parameters schema, and the server handles the rest - validation, execution, persistence, and MCP protocol integration.
This server bridges the gap between simple function definitions and the MCP protocol, making it easy to extend Claude's capabilities with custom tools written in Python, JavaScript, Bash, Ruby, or TypeScript.
Features
- Dynamic Tool Registration: Add new tools at runtime without restarting the server
- Multi-Language Support: Write functions in Python, JavaScript, Bash, and more
- File-Based Functions: Define functions in separate files for better maintainability
- Automatic Validation: Functions are validated for syntax before registration
- Security Validation: Comprehensive security checks for file-based functions
- Persistence: Registered tools are saved and automatically loaded on server restart
- Type Safety: Full JSON Schema validation for function parameters
- Error Handling: Comprehensive error messages and timeout protection
- Source Code Viewer: Built-in tool to inspect function source code
Installation
# Clone the repository
git clone https://github.com/yourusername/diy-tools-mcp.git
cd diy-tools-mcp
# Install dependencies
npm install
# Build the project
npm run build
Usage
Starting the Server
# Start the server
npm start
# Or for development with auto-reload
npm run dev
Adding Tools
The server provides four built-in tools:
add_tool- Register a new custom functionremove_tool- Remove a registered functionlist_tools- List all available custom toolsview_source- View the source code of a registered tool
Example: Adding a Python Tool
{
"name": "calculate_factorial",
"description": "Calculate the factorial of a number",
"language": "python",
"code": "def main(n):\n if n <= 1:\n return 1\n return n * main(n - 1)",
"parameters": {
"type": "object",
"properties": {
"n": {
"type": "integer",
"description": "The number to calculate factorial for",
"minimum": 0
}
},
"required": ["n"]
},
"returns": "The factorial of the input number"
}
Example: Adding a JavaScript Tool
{
"name": "format_date",
"description": "Format a date string",
"language": "javascript",
"code": "function main({ date, format }) {\n const d = new Date(date);\n if (format === 'short') {\n return d.toLocaleDateString();\n }\n return d.toLocaleString();\n}",
"parameters": {
"type": "object",
"properties": {
"date": {
"type": "string",
"description": "Date string to format"
},
"format": {
"type": "string",
"enum": ["short", "long"],
"default": "long"
}
},
"required": ["date"]
}
}
Example: Adding a Bash Tool
{
"name": "system_info",
"description": "Get basic system information",
"language": "bash",
"code": "main() {\n echo '{\"os\": \"'$(uname -s)'\", \"kernel\": \"'$(uname -r)'\", \"arch\": \"'$(uname -m)'\"}'\n}",
"parameters": {
"type": "object",
"properties": {}
}
}
File-Based Functions
You can now define functions in separate files instead of inline code. This is useful for:
- Complex functions that are easier to maintain in dedicated files
- Functions you want to version control separately
- Reusing existing code without modification
Example: Adding a Python Function from File
- Create your function file
my_function.py:
from datetime import datetime
def main(name, age):
"""
Generate a personalized greeting.
"""
return {
"greeting": f"Hello {name}!",
"message": f"You are {age} years old.",
"timestamp": datetime.now().isoformat()
}
- Register the function:
{
"name": "personalized_greeting",
"description": "Generate a personalized greeting with timestamp",
"language": "python",
"codePath": "./my_function.py",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Person's name"
},
"age": {
"type": "integer",
"description": "Person's age"
}
},
"required": ["name", "age"]
}
}
Example: Adding a JavaScript Function from File
- Create your function file
data_processor.js:
async function main({ data, format }) {
// Process data based on format
if (format === 'csv') {
return processCSV(data);
} else if (format === 'json') {
return processJSON(data);
}
throw new Error(`Unsupported format: ${format}`);
}
function processCSV(data) {
// CSV processing logic
return { processed: true, format: 'csv', rows: data.split('\n').length };
}
function processJSON(data) {
// JSON processing logic
const parsed = JSON.parse(data);
return { processed: true, format: 'json', keys: Object.keys(parsed) };
}
module.exports = { main };
- Register the function:
{
"name": "data_processor",
"description": "Process data in various formats",
"language": "javascript",
"codePath": "./data_processor.js",
"parameters": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "Raw data to process"
},
"format": {
"type": "string",
"enum": ["csv", "json"],
"description": "Data format"
}
},
"required": ["data", "format"]
}
}
Configurable Entry Points (New in v1.2.0)
You can now specify any function name as the entry point, not just main. This allows you to:
- Use existing code without renaming functions
- Share a single file between multiple tools with different entry points
- Better organize related functions
Example: Multiple Tools from One File
- Create a file with multiple functions
math_utils.py:
def calculate_tax(income, tax_rate):
"""Calculate tax amount."""
return {
"tax_amount": income * tax_rate,
"net_income": income * (1 - tax_rate)
}
def compound_interest(principal, rate, time):
"""Calculate compound interest."""
amount = principal * (1 + rate) ** time
return {
"principal": principal,
"interest": amount - principal,
"total": amount
}
- Register multiple tools using different entry points:
// Tax calculator tool
{
"name": "tax_calculator",
"description": "Calculate tax and net income",
"language": "python",
"codePath": "./math_utils.py",
"entryPoint": "calculate_tax", // Specify which function to use
"parameters": {
"type": "object",
"properties": {
"income": { "type": "number" },
"tax_rate": { "type": "number" }
},
"required": ["income", "tax_rate"]
}
}
// Interest calculator tool
{
"name": "interest_calculator",
"description": "Calculate compound interest",
"language": "python",
"codePath": "./math_utils.py",
"entryPoint": "compound_interest", // Different function from same file
"parameters": {
"type": "object",
"properties": {
"principal": { "type": "number" },
"rate": { "type": "number" },
"time": { "type": "number" }
},
"required": ["principal", "rate", "time"]
}
}
If no entryPoint is specified, the system defaults to looking for a function named main for backward compatibility.
Viewing Function Source Code
Use the view_source tool to inspect any registered function:
{
"name": "view_source",
"arguments": {
"name": "data_processor",
"verbose": true
}
}
The verbose option includes full metadata about the tool in addition to the source code.
Supported Languages
- Python (
python) - Requires Python 3.x - JavaScript (
javascriptornode) - Requires Node.js - Bash (
bash) - Requires Bash shell - TypeScript (
typescript) - Transpiled and run as JavaScript - Ruby (
ruby) - Requires Ruby
Function Requirements
Python Functions
- Must define a
mainfunction that accepts keyword arguments - Should return JSON-serializable data
- Example:
def main(x, y): return x + y
JavaScript Functions
- Must define a
mainfunction (regular or async) - Receives parameters as a single object
- Example:
function main({ x, y }) { return x + y; }
Bash Functions
- Must define a
mainfunction - Receives JSON arguments as first parameter
- Should output JSON to stdout
- Example:
main() { # Parse JSON args if needed echo '{"result": "success"}' }
Ruby Functions
- Must define a
mainmethod that accepts keyword arguments - Should return JSON-serializable data
- Example:
def main(name:, age:) { greeting: "Hello #{name}, you are #{age} years old!" } end
Configuration
Timeout Settings
You can specify a timeout for each function (in milliseconds):
{
"timeout": 5000 // 5 seconds
}
Maximum timeout is 300000ms (5 minutes).
Dependencies
For Python functions, you can specify required packages:
{
"dependencies": ["numpy", "pandas"]
}
Note: Automatic dependency installation is not yet implemented.
Error Handling
The server provides detailed error messages for:
- Syntax errors in function code
- Invalid parameter schemas
- Runtime execution errors
- Timeout violations
- Missing dependencies
Storage
Functions are stored in the functions/ directory as JSON files. Each file contains:
- Function specification
- Unique ID
- Creation and update timestamps
Development
# Run in development mode with auto-reload
npm run dev
# Run tests
npm test
# Build for production
npm run build
# Clean build artifacts
npm run clean
Security Considerations
File-Based Functions Security
When using file-based functions, the server implements multiple security layers:
- Path Traversal Protection: Prevents access to files outside the intended directories
- Symbolic Link Detection: Blocks symbolic links to prevent unauthorized file access
- System Directory Protection: Restricts access to critical system directories including:
/etc,/usr/bin,/System(macOS),C:\Windows- User-specific sensitive directories (
~/.ssh,~/.aws, etc.)
- File Size Limits: Files are limited to 10MB to prevent resource exhaustion
- Dangerous Pattern Detection: Scans for potentially malicious code patterns:
eval()andexec()calls- Dynamic imports and requires
- Dangerous shell commands (
rm -rf /, etc.) - Subprocess calls with shell=True
- File Extension Validation: Only allows appropriate extensions for each language
- Main Function Requirement: Enforces that all functions have a proper
mainentry point
General Security Notes
- Functions run with the same
Truncated for display — read the full file on GitHub.
Related Skills
taste-skill
111.0kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
109.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
70.0kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
