A Model Context Protocol (MCP) server that provides file and command execution tools for CrewAI agents.
This MCP server provides several tools that can be used by CrewAI agents to interact with the file system and execute commands:
- read_file: Read file contents with line numbering
- list_files: List files in a directory, respecting .gitignore patterns
- write_to_file: Write content to files with validation
- execute_command: Execute shell commands with proper process management
-
Clone this repository:
git clone https://github.com/kimwwk/crewai-demo-mcp-server.git cd crewai-demo-mcp-server -
Install dependencies using
uv:# If you don't have uv installed, install it first: # curl -LsSf https://astral.sh/uv/install.sh | sh uv sync
uv run python main.py
# .venv/bin/python3 main.pyBy default, the server runs with SSE transport. To use stdio transport, uncomment the appropriate line in main.py.
PROJECT_ROOT_PATH: Set this to override the default project root path
Reads a file and returns its content with line numbers.
Parameters:
path: The relative path to the file from the project rootline_range: Optional line range to read (e.g., "10-50")max_lines: Maximum number of lines to read (default: 1000)
Lists files in a directory, optionally recursively, honoring .gitignore.
Parameters:
path: The relative path to the directory from the project rootrecursive: Whether to list files recursively (default: False)
Writes content to a file. Creates the file if it doesn't exist, or overwrites it if it does.
Parameters:
path: The relative path to the file from the project rootcontent: The content to writeline_count: The predicted number of lines for omission detection
Executes a command in a subprocess with timeout and captures streaming output.
Parameters:
command: The command to executecwd: Optional working directory (relative to PROJECT_ROOT_PATH or absolute)
MIT