home / mcp / configurable command mcp server
Exposes JSON-defined command-line tools via a controlled MCP interface for secure, configurable execution.
Configuration
View docs{
"mcpServers": {
"dewoller-generic_mcp": {
"command": "node",
"args": [
"/Users/dewoller/code/generic_mcp/dist/index.js"
],
"env": {
"CONFIG_PATH": "/Users/dewoller/code/generic_mcp/tools.json"
}
}
}
}You can run and expose arbitrary command-line tools through a configurable MCP server. By defining tools in a JSON configuration, you gain secure, controlled access to specific utilities while enforcing parameter validation, directory restrictions, and timeouts.
You interact with the MCP server through your client by calling predefined tools. Each tool is defined in configuration with a name, a description, the command to execute, and any required parameters. You can ask your MCP client to list files, search through code, count lines, or perform other supported actions without exposing your entire system.
Prerequisites you need before installing: Node.js (runtime), npm for package management, and a local development environment for editing configuration files.
1. Create your project directory and install dependencies.
2. Build the TypeScript code.
3. Define your tools in a JSON configuration file named tools.json.
4. Point your client to the MCP server using the local stdio configuration described below.
The MCP server is configured to execute tools defined in tools.json. Each tool includes command arguments and optional environment variables. Execution is isolated by directory restrictions, parameter validation, and timeouts to prevent abuse.
Environment variables shown in the example configure how the MCP server locates its tool definitions and runs in your environment.
- Parameter validation ensures inputs match expected types and formats.
- Directory scoping restricts where tools can operate to protect your filesystem.
- Timeouts prevent long-running or stalled commands from consuming resources.
List directory contents for a given path with optional flags to show hidden files or detailed details.
Search for a pattern within files, returning matches with file paths and line numbers.
Count lines, words, or characters in input files or streams.
Show the current status of a Git repository, including staged and unstaged changes.
Find files by pattern or name across a directory tree.