Nash Command Executor
STDIOMCP server enabling command execution, Python code, web content fetching, and task management.
MCP server enabling command execution, Python code, web content fetching, and task management.
Nash MCP (a Model Context Protocol (MCP) server) enables seamless execution of commands, Python code, web content fetching, and reusable task management.
git clone https://github.com/nash-run/nash-mcp.git cd nash-mcp poetry install
This is the command to use for MCP config files
/path/to/this/repo/.venv/bin/mcp run /path/to/this/repo/src/nash_mcp/server.py
As an example, if you were to use this MCP with Claude Desktop, you would change your ~/Library/Application Support/Claude/claude_desktop_config.json
to:
{ "mcpServers": { "Nash": { "command": "/Users/john-nash/code/nash-mcp/.venv/bin/mcp", "args": ["run", "/Users/john-nash/code/nash-mcp/src/nash_mcp/server.py"] } } }
Nash MCP requires environment variables to specify all data file paths. Create a .env
file in the root directory with the following variables:
# Required environment variables
NASH_SECRETS_PATH=/path/to/secrets.json
NASH_TASKS_PATH=/path/to/tasks.json
NASH_LOGS_PATH=/path/to/logs/directory
NASH_SESSIONS_PATH=/path/to/sessions/directory
There are no default values - all paths must be explicitly configured.
The Nash MCP server creates a unique session directory for each server instance. This session directory stores:
This persistent storage enables powerful workflows:
⚠️ MANDATORY PRE-CODING CHECKLIST - COMPLETE BEFORE WRITING ANY CODE: ⚠️
1. Check available packages: list_installed_packages()
- Know what libraries you can use
- Avoid importing unavailable packages
2. Check available secrets: nash_secrets()
- See what API keys and credentials are available
- Don't write code requiring credentials you don't have
3. Check existing files: list_session_files()
- See what code already exists
- Avoid duplicating existing functionality
4. Review relevant file contents: get_file_content("filename.py")
- Understand existing implementations
- Decide whether to edit or create new
When working with Nash MCP, balance efficiency and context preservation:
list_session_files()
edit_python_file()
for minor to moderate changesThe golden rule is to minimize token usage while maintaining context and code history.
This approach preserves script history, maintains context, and makes incremental development more efficient. The editing workflow follows this pattern:
list_installed_packages()
and nash_secrets()
list_session_files()
get_file_content("file_name.py")
edit_python_file("file_name.py", old_content, new_content)
execute_python("", "file_name.py")
(empty code string to run without modifying)execute_python(new_code, "new_file.py")
When deciding whether to edit or create a new file, consider which approach will use fewer tokens:
Always aim to produce the smallest, most efficient output that accomplishes the task while maintaining clarity and context.
Detailed timestamped logs of all operations and tool executions are emitted by the server. These logs are stored in the directory specified by the NASH_LOGS_PATH
environment variable.
poetry run pytest
With coverage
poetry run pytest --cov=nash_mcp
MIT