A robust Python project for managing and interacting with files and directories using Google's ADK and Model Context Protocol (MCP) tools.
agent_mcp
provides an intelligent agent that helps users manage files, list directories, and perform various filesystem operations programmatically. It leverages the google-adk library for agent development and the @modelcontextprotocol/server-filesystem NPM package for advanced filesystem integration.
- List and manage files in a specified directory
- Read and display file contents
- Integrate with Gemini LLM for intelligent file management
- Easily configurable target directory
- Environment variable support for secure configuration
agent_mcp/
│
├── adk_agent_samples/
│ └── mcp_agent/
│ └── agent.py
│
├── mainfoder1/
│ └── rootfolder/
│ ├── __init__.py
│ └── reqerments.txt
│
├── .env
├── .gitignore
├── LICENSE
├── README.md
└── step_By_step.md
- Python 3.8+
- Node.js and npm
- google-adk
- @modelcontextprotocol/server-filesystem
python-dotenv
for environment variable management
-
Clone the repository:
git clone <your-repo-url> cd agent_mcp
-
Set up Python environment and install dependencies:
python -m venv venv source venv/bin/activate pip install google-adk python-dotenv
-
Install the MCP server filesystem tool:
npm install -g @modelcontextprotocol/server-filesystem
-
Configure environment variables:
- Create a
.env
file in the project root with your Gemini API key:GEMINI_API_KEY=your-gemini-api-key
- Create a
- The main agent logic is in
adk_agent_samples/mcp_agent/agent.py
. - By default, the agent manages files in the
mainfoder1/rootfolder
directory. - You can modify the
TARGET_FOLDER_PATH
variable inagent.py
to change the target directory.
To run the agent, execute the main script or integrate it into your application as needed:
python adk_agent_samples/mcp_agent/agent.py
See step_By_step.md
for a detailed setup and usage guide.
This project is licensed under the Apache License 2.0.