AgenticMaid Project
About
AgenticMaid is a Python library designed to interact with one or more Multi-Capability Protocol (MCP) servers.
Details
- License
- Apache-2.0 license
Explore
Multi-Server MCP Interaction: Connects to and utilizes tools from multiple MCP servers.
Dynamic Tool Fetching: Retrieves available tools from MCP servers at runtime.
Flexible Configuration: Supports configuration via Python dictionaries, JSON files, and .env files for sensitive data.
AI Service Management: Configures and utilizes various AI/LLM services (e.g., OpenAI, Anthropic, Azure OpenAI, local models).
Scheduled Tasks: Allows defining and running tasks based on cron-like schedules.
Chat Service Integration: Provides a framework for handling interactions with defined chat services.
Agent Creation: Uses langgraph to create ReAct agents that can leverage MCP tools and configured LLMs.
Environment Variable Support: Loads default configurations and sensitive keys (like API keys) from an .env file.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
AgenticMaid ProjectCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Configuration
The AgenticMaid can be configured in multiple ways:
1. Python Dictionary: Pass a Python dictionary directly to the AgenticMaid constructor.
2. JSON File: Provide a path to a JSON configuration file to the constructor.
3. .env File: For default values and sensitive information like API keys, create a .env file in the AgenticMaid/ directory (i.e., alongside client.py). Values from the .env file can be overridden by the main JSON/dictionary configuration.
Configuration Structure
The main configuration (Python dictionary or JSON) generally includes the following sections:
model (optional): Global default settings for AI models.
ai_services: Definitions for various AI/LLM providers and models.
mcp_servers: Configuration for the MCP servers the client will connect to.
scheduled_tasks: An array of tasks to be run on a schedule.
chat_services: Definitions for chat services the client can interact with.
agents (optional): Pre-defined agent configurations.
-
default_llm_service_name(optional): A global default LLM service to use if not specified elsewhere.
See the
AgenticMaid/config.example.json file for a detailed example with comments explaining each field.--config-file
(required): Path to the JSON configuration file for `AgenticMaid`. This file should define `ai_services`, `mcp_servers`, and `scheduled_tasks` as needed. Refer to [`AgenticMaid/config.example.json`](./config.example.json) for the structure.
AgenticMaid also provides a command-line interface (CLI) tool to execute all enabled scheduled tasks based on a provided configuration file. This is useful for batch processing or running tasks from a terminal or script.
To use the CLI tool:
Ensure the AgenticMaid package and its dependencies are accessible in your PYTHONPATH.
From the root directory of the Agent project, you can run the CLI module as follows:
python -m AgenticMaid.cli --config-file path/to/your/config.json
Arguments:
-
--config-file(required): Path to the JSON configuration file forAgenticMaid. This file should defineai_services,mcp_servers, andscheduled_tasksas needed. Refer toAgenticMaid/config.example.jsonfor the structure.
1. The CLI tool will load the specified configuration file.
2. It will initialize an ClientAgenticMaid instance with this configuration.
3. It will then attempt to execute all tasks listed in the scheduled_tasks section of the configuration that have "enabled": true.
4. Output, including task execution status and any results or errors, will be logged to the console.
Example Command:
python -m AgenticMaid.cli --config-file ./AgenticMaid/config.example.json
This command will run all enabled scheduled tasks defined in AgenticMaid/config.example.json. Check the console output for details on each task's execution.
The original "Examples" section is now renumbered.
]]>
"my_mcp_server": {
"adapter_type": "fastapi",
"base_url": "http://localhost:8001/mcp/v1", # Replace with your actual MCP server URL
"name": "Example MCP Server"
}
},
"scheduled_tasks": [
{
"name": "Test Scheduled Task",
"cron_expression": "daily at 00:00", # Will run once if current time is past 00:00 and scheduler is kept running
"prompt": "This is a test scheduled prompt. What time is it using Gemini?",
"model_config_name": "default_llm",
"enabled": True # Set to False if you don't want it to run
}
],
"chat_services": [
{
"service_id": "test_chat_gemini",
"llm_service_name": "default_llm"
},
{
"service_id": "test_chat_claude",
"llm_service_name": "claude_opus_llm"
}
],
"default_llm_service_name": "default_llm"
}
client = ClientAgenticMaid(config_path_or_dict=config)
await client.async_initialize()
if not client.config:
print("Client configuration failed. Exiting.")
return
print(f"ClientAgenticMaid Initialized. Config Source: {client.config_source}")
print(f"Available MCP Tools: {[tool.name for tool in client.mcp_tools] if client.mcp_tools else 'No tools fetched (check MCP server config and availability)'}")
print("Make sure your .env file (in AgenticMaid directory) has GOOGLE_API_KEY and ANTHROPIC_API_KEY set for this example to fully work.")
print("Also, ensure an MCP server is running at the configured URL if you expect MCP tools.")
asyncio.run(run_client_operations())
``
This README provides a comprehensive guide to installing, configuring, and using the ClientAgenticMaid`. Remember to adapt paths and configurations to your specific project setup.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"agenticmaid project": {
"AutoMaid": {
"command": "python",
"args": [
"-m",
"uvicorn",
"AgenticMaid.api:app",
"--reload"
]
}
}
}
}
McpServers
{
"AutoMaid": {
"command": "python",
"args": [
"-m",
"uvicorn",
"AgenticMaid.api:app",
"--reload"
]
}
}
Overview
AgenticMaid is a Python library designed to interact with one or more Multi-Capability Protocol (MCP) servers. It allows for dynamic fetching and utilization of tools (capabilities) provided by these servers. The client can also manage configurations for various AI/LLM services, schedule automated tasks, and handle chat service interactions, making it a versatile component for building AI-powered applications.
It leverages langchain-mcp-adapters for communication with MCP servers and langgraph for creating reactive agents that can use the fetched MCP tools.
Features
Multi-Server MCP Interaction: Connects to and utilizes tools from multiple MCP servers.
Dynamic Tool Fetching: Retrieves available tools from MCP servers at runtime.
Flexible Configuration: Supports configuration via Python dictionaries, JSON files, and .env files for sensitive data.
AI Service Management: Configures and utilizes various AI/LLM services (e.g., OpenAI, Anthropic, Azure OpenAI, local models).
Scheduled Tasks: Allows defining and running tasks based on cron-like schedules.
Chat Service Integration: Provides a framework for handling interactions with defined chat services.
Agent Creation: Uses langgraph to create ReAct agents that can leverage MCP tools and configured LLMs.
Environment Variable Support: Loads default configurations and sensitive keys (like API keys) from an .env file.
Installation
1. Prerequisites:
Python 3.8+
2. Clone the repository (if applicable) or add AgenticMaid to your project.
3. Install Dependencies:
The client relies on several libraries. Ensure you have a requirements.txt file in your project or install them directly. Key dependencies include:
pip install python-dotenv langchain-mcp-adapters langgraph schedule langchain-core langchain-openai langchain-anthropic fastapi pydantic "uvicorn[standard]"
The command above includes core dependencies and those required for the FastAPI service and CLI tool. The file
AgenticMaid/requirements.txt lists dependencies primarily for the API and CLI features.
Configuration
The AgenticMaid can be configured in multiple ways:
1. Python Dictionary: Pass a Python dictionary directly to the AgenticMaid constructor.
2. JSON File: Provide a path to a JSON configuration file to the constructor.
3. .env File: For default values and sensitive information like API keys, create a .env file in the AgenticMaid/ directory (i.e., alongside client.py). Values from the .env file can be overridden by the main JSON/dictionary configuration.
Configuration Structure
The main configuration (Python dictionary or JSON) generally includes the following sections:
model (optional): Global default settings for AI models.
ai_services: Definitions for various AI/LLM providers and models.
mcp_servers: Configuration for the MCP servers the client will connect to.
scheduled_tasks: An array of tasks to be run on a schedule.
chat_services: Definitions for chat services the client can interact with.
agents (optional): Pre-defined agent configurations.
default_llm_service_name (optional): A global default LLM service to use if not specified elsewhere.
See the AgenticMaid/config.example.json file for a detailed example with comments explaining each field.
1. Using .env File
Create a file named .env in the AgenticMaid directory (e.g., AgenticMaid/.env). This file is used for API keys and other default settings. Values from here serve as defaults and can be overridden by the main configuration file or dictionary.
Example AgenticMaid/.env:
```env
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



