The AI Meta MCP Server provides a dynamic framework that allows AI models to create and execute custom tools through a meta-function architecture. This server enables AI to extend its capabilities by defining new functions at runtime while maintaining security through sandboxed environments and human approval flows.
Install the server using npm:
npm install ai-meta-mcp-server
You can also run the server using Docker:
# Build the Docker image
docker build -t ai-meta-mcp-server .
# Run the container
docker run --rm -i ai-meta-mcp-server
# Run with custom configuration and persistent storage
docker run --rm -i \
-e ALLOW_PYTHON_EXECUTION=true \
-e ALLOW_SHELL_EXECUTION=false \
-v $(pwd)/data:/app/data \
ai-meta-mcp-server
Run the server with the default configuration:
npx ai-meta-mcp-server
The server can be configured using environment variables:
ALLOW_JS_EXECUTION
: Enable JavaScript execution (default: true)ALLOW_PYTHON_EXECUTION
: Enable Python execution (default: false)ALLOW_SHELL_EXECUTION
: Enable Shell execution (default: false)PERSIST_TOOLS
: Save tools between sessions (default: true)TOOLS_DB_PATH
: Path to store tools database (default: "./tools.json")Add the following configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"ai-meta-mcp": {
"command": "npx",
"args": ["-y", "ai-meta-mcp-server"],
"env": {
"ALLOW_JS_EXECUTION": "true",
"ALLOW_PYTHON_EXECUTION": "false",
"ALLOW_SHELL_EXECUTION": "false"
}
}
}
}
Once the server is running and connected to your AI assistant, you can create new tools by asking the AI to create them for you. For example:
Can you create a tool called "calculate_compound_interest" that computes compound interest given principal, rate, time, and compounding frequency?
The AI will use the built-in define_function
meta-tool to create your new tool, which then becomes immediately available for use.
The AI Meta MCP Server includes several important security features:
Important: This server allows for dynamic code execution. Use with caution and only in trusted environments.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "ai-meta-mcp" '{"command":"npx","args":["-y","ai-meta-mcp-server"],"env":{"ALLOW_JS_EXECUTION":"true","ALLOW_PYTHON_EXECUTION":"false","ALLOW_SHELL_EXECUTION":"false"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"ai-meta-mcp": {
"command": "npx",
"args": [
"-y",
"ai-meta-mcp-server"
],
"env": {
"ALLOW_JS_EXECUTION": "true",
"ALLOW_PYTHON_EXECUTION": "false",
"ALLOW_SHELL_EXECUTION": "false"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"ai-meta-mcp": {
"command": "npx",
"args": [
"-y",
"ai-meta-mcp-server"
],
"env": {
"ALLOW_JS_EXECUTION": "true",
"ALLOW_PYTHON_EXECUTION": "false",
"ALLOW_SHELL_EXECUTION": "false"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect