This server implements the Model Context Protocol (MCP) to run shell scripts or commands, allowing AI models to execute actions on your system based on commands received. It serves as a bridge between AI models and your local environment for task automation.
You can install the MCP server using npm:
npm install -g mcp-server-cli
To start the MCP server with default settings:
mcp-server
This command starts the MCP server with the default configuration.
You can customize the server behavior with various command-line options:
mcp-server [options]
Available options:
-h, --help
- Display help information-s, --server <server>
- Specify the MCP server URL (default: "wss://mcp.mistral.ai/ws")-p, --port <port>
- Set local server port (default: 8999)-a, --apiKey <apiKey>
- Provide your API key--shell <shell>
- Specify which shell to use (default: determined by OS)--shellArgs <shellArgs>
- Specify shell arguments--allowPrivacy
- Allow privacy endpoint--allowRunCommand
- Allow running commands in PATH--allowRunScript
- Allow running scripts at path--allowNetwork
- Allow network access--allowEnv
- Allow access to environment variables--allowFileRead
- Allow reading files--allowFileWrite
- Allow writing files--allowListDir
- Allow listing directories-v, --verbose
- Enable verbose modemcp-server --apiKey your_api_key_here
mcp-server --server wss://custom-mcp-server.com/ws --port 9000
To allow the server to execute commands and read files:
mcp-server --allowRunCommand --allowFileRead
mcp-server --allowPrivacy --allowRunCommand --allowRunScript --allowNetwork --allowEnv --allowFileRead --allowFileWrite --allowListDir
For security reasons, only enable the permissions that you absolutely need. Running with all permissions enabled could potentially allow malicious code execution if the server is compromised.
If you experience connection problems with the default MCP server:
If you encounter permission errors when executing commands:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-server-cli" '{"command":"npx","args":["mcp-server-cli"]}'
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": {
"mcp-server-cli": {
"command": "npx",
"args": [
"mcp-server-cli"
]
}
}
}
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": {
"mcp-server-cli": {
"command": "npx",
"args": [
"mcp-server-cli"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect