MCP Server Enables Claude to Create and Run Custom Tools at Runtime

✍️ OpenClawRadar📅 Published: April 14, 2026🔗 Source
MCP Server Enables Claude to Create and Run Custom Tools at Runtime
Ad

A developer has built an MCP server that allows Claude to create, update, and run new tools at runtime without requiring redeployment. Unlike standard MCP setups where tools are fixed at deploy time, this system enables dynamic tool creation.

Core Architecture

The server implements five core MCP tools:

  • List Tools — returns available tools
  • Get Tool — fetches full tool definition including code
  • Create Tool — stores a new tool in a database registry
  • Update Tool — modifies an existing tool
  • Run Tool — executes any stored tool by name

Tool Execution Process

The Run Tool meta-tool works as follows:

  1. Looks up the requested tool in a MySQL table
  2. Fetches its code
  3. Passes parameters as context
  4. Runs it in a Deno subprocess with restricted permissions
  5. Returns the result

Sandbox Implementation

The developer evaluated Node VM, isolated-vm, and Docker before choosing Deno for sandboxing. Deno was selected because:

  • Clean permission model with granular network/filesystem/subprocess control
  • Native npm support
  • TypeScript built-in
  • ~50ms cold start vs 500ms+ for Docker

The sandbox uses these flags: --allow-net --deny-read --deny-write --deny-run --deny-ffi. This allows tool code to make HTTP requests and use npm packages, but prevents filesystem access or process spawning.

Ad

Tool Code Format

Tool code is JavaScript/TypeScript that receives a context object for parameters. Example from the source:

const response = await fetch(`https://api.example.com/${context.city}`);
const data = await response.json();
return { temp: data.temp, conditions: data.weather[0].description };

Self-Extension Capability

The system enables a self-extension loop: Claude identifies it needs a capability → creates the tool → uses it immediately → updates it if the result isn't right. This allows the system to become more capable over time without developer intervention.

The implementation is built on n8n as the MCP server with MySQL for tool storage and has been running in production for a few months.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

AI Chat Exporter: A Chrome Extension for High-Fidelity Claude Conversation PDFs
Tools

AI Chat Exporter: A Chrome Extension for High-Fidelity Claude Conversation PDFs

A developer built AI Chat Exporter, a Chrome extension that preserves math, code, and images when exporting Claude conversations to PDF. The tool uses a local browser-based rendering engine developed with Claude 3.5 Sonnet to handle progressive markdown and LaTeX formatting.

OpenClawRadar
Reflect MCP Server Implements Reflexion Paper for Persistent Coding Agent Memory
Tools

Reflect MCP Server Implements Reflexion Paper for Persistent Coding Agent Memory

A developer implemented the Reflexion paper (Shinn et al., NeurIPS 2023) as an MCP server to give local coding agents persistent memory of their mistakes. The system uses regex-based pattern matching on error messages and stores lessons in SQLite with FTS5.

OpenClawRadar
Mozilla Thunderbolt: Open-Source Enterprise AI Client for Self-Hosted Infrastructure
Tools

Mozilla Thunderbolt: Open-Source Enterprise AI Client for Self-Hosted Infrastructure

Mozilla announced Thunderbolt, an open-source AI client under MPL 2.0 license designed for organizations to deploy self-hosted AI infrastructure with model choice, enterprise data integration, and cross-platform native applications.

OpenClawRadar
Clawdwatch: Open-source OSINT tool for real-time flight tracking, news scraping, and alerts
Tools

Clawdwatch: Open-source OSINT tool for real-time flight tracking, news scraping, and alerts

Clawdwatch is a CLI tool that pulls live flight data from OpenSky Network, scrapes news from Al Jazeera and AP, and can send Telegram alerts for military aircraft or emergency squawks. It runs locally with npm install and tracks 204+ flights over the Middle East in real-time.

OpenClawRadar