Configurable Command MCP Server
A flexible MCP server that executes arbitrary command-line tools defined in a configuration file.
Configurable Command MCP Server
A flexible Model Context Protocol (MCP) server that allows you to define and execute arbitrary command-line tools through configuration files. Perfect for giving Claude Desktop access to specific command-line utilities in a secure, controlled manner.
Features
- 🛠️ Configuration-driven: Define tools via JSON without modifying code
- 🔒 Secure execution: Parameter sanitization, directory restrictions, and command allowlisting
- ⚡ Rate limiting: Prevent abuse with configurable execution limits
- 📝 Parameter validation: Type checking, patterns, and required/optional parameters
- 🎯 Directory scoping: Restrict tool execution to specific directories
- ⏱️ Timeout control: Configurable execution timeouts per tool
- 📊 Output management: Size limits and structured result formatting
Setup Instructions
1. Create the project directory and install dependencies
cd /Users/dewoller/code/generic_mcp npm install
2. Build the TypeScript code
npm run build
3. Configure your tools
Edit the tools.json file to define your command-line tools. The file is already configured with useful examples like:
list_files: List directory contentsgrep_search: Search for patterns in filesword_count: Count lines/words/charactersgit_status: Check git repository statusfind_files: Find files by pattern- And more!
4. Configure Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "command-executor": { "command": "node", "args": ["/Users/dewoller/code/generic_mcp/dist/index.js"], "env": { "CONFIG_PATH": "/Users/dewoller/code/generic_mcp/tools.json" } } } }
5. Restart Claude Desktop
After saving the configuration, restart Claude Desktop to load the MCP server.
Testing the Installation
Run Integration Tests
npm run test:integration
This will test several tools and show you their output.
Manual Testing in Development Mode
Run in development mode (with TypeScript)
npm run dev
Or run the built version
npm start
Usage Examples
Once configured, you can ask Claude to use these tools:
- "List all JavaScript files in my code directory"
- "Search for TODO comments in the project"
- "Show me the git status"
- "Count lines in all Python files"
- "Find all markdown files"
Adding Custom Tools
To add a new tool, edit tools.json:
{ "name": "my_tool", "description": "Description for Claude", "command": "actual-command", "args": ["-flag", "{parameter}"], "parameters
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Devopness
Devopness MCP server for DevOps happiness! Empower AI Agents to deploy apps and infra, to any cloud.
Sensei MCP
Expert guidance for Dojo and Cairo development on Starknet, specializing in the Dojo ECS framework for building onchain worlds.
Android Preference Editor
Edit Android preferences using adb and Node.js.
Gru Sandbox
Gru-sandbox(gbox) is an open source project that provides a self-hostable sandbox for MCP integration or other AI agent usecases.
Recent Go MCP Server
Provides Go language updates and best practices in a structured Markdown format for LLM coding agents.
LaTeX to MathML MCP Server
Converts LaTeX mathematical expressions to MathML format using MathJax-node.
AvaloniaUI
Tools, resources, and guidance for building cross-platform applications with AvaloniaUI.
Grey Hack MCP Server
A Grey Hack server for Cursor IDE, providing GitHub code search, Greybel-JS transpilation, API validation, and script generation.
MCP WordPress Server
A comprehensive MCP server for managing WordPress sites, featuring a wide range of tools for performance monitoring, caching, and more.
Mindpilot MCP
Visualize legacy code and inspect complex flows to understand your agent's operations.