This project utilizes FastAgent to interact with various services through Model Context Protocol (MCP) servers. MCP servers provide a standardized protocol that enables AI agents to communicate with external systems, offering access to various functionalities such as capturing screenshots, querying weather information, sending emails, interacting with Slack workspaces, and managing SQLite databases. This integration allows users to experience a rich and interactive environment with comprehensive service connectivity while maintaining best practices for agent-based system architecture.
To get this project up and running, follow these steps after navigating to the root directory of the project:
- Initialize the virtual environment with
uv:uv init
- Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS/Linux:
source .venv/bin/activate
- On Windows:
- Add
rufffor linting (optional but recommended):uv add ruff
- Check the code with
ruff(optional):uv run ruff check
- Install libraries:
uv pip install -r requirements.txt
- Lock dependencies:
uv lock
- Sync dependencies (install them based on the lock file):
uv sync
- Run the agent:
uv run agent.py
FastAgent is the primary client used in this project to orchestrate and manage interactions with the different MCP servers. It allows for seamless communication and data exchange between the agent and the services.
Below is a list of MCP servers configured for this project. For detailed implementation and setup instructions, please refer to their respective repositories.
- Description: Provides functionalities to interact with the local filesystem.
- Implementation Details: MCP server filesystem
- Configuration in
fastagent.config.yaml:filesystem: command: "npx" args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
-
Description: Enables interaction with Google Maps services.
-
Implementation Details: MCP server google-maps
-
Configuration in
fastagent.config.yaml:google-maps: command: "npx" args: ["-y", "@modelcontextprotocol/server-google-maps"] env: GOOGLE_MAPS_API_KEY: "AIza----------------------------------------------------"
Obtaining a Google Maps API Key: Please refer to documentation for instructions on obtaining a Google Maps API key.
Note: For full functionality, make sure to enable almost all Maps APIs (Places API (New), Directions API, Geocoding API, etc.) for your GCP project.
- Description: Allows the agent to communicate and interact with Slack.
- Implementation Details: MCP server slack
- Configuration in
fastagent.config.yaml:slack: command: "npx" args: [ "-y", "@modelcontextprotocol/server-slack" ] env: SLACK_BOT_TOKEN: "xoxb----------------------------------------------------" SLACK_TEAM_ID: "T-----------" SLACK_CHANNEL_IDS: "C------------, C------------, C------------"
- Description: Provides an interface to interact with an SQLite database.
- Implementation Details: MCP server sqlite
- Configuration in
fastagent.config.yaml:sqlite: command: "uv" args: [ "--directory", "./src/sqlite", "run", "mcp-server-sqlite", "--db-path", "test.db" ]
- Note: The test.db file is located in the ./src/sqlite/ directory.
- Description: Provides functionalities to capture screenshots of the user's screen.
- Implementation Details: This server is implemented as a local Python script. Refer to
./created_mcp_servers/screenshot_capture.pyfor details. - Configuration in
fastagent.config.yaml:screenshot_capture: command: "python" args: ["./created_mcp_servers/screenshot_capture.py"]
- Description: Provides weather information for any city.
- Implementation Details: This server is implemented as a local Python script. Refer to
./created_mcp_servers/weather_api.pyfor details. - Configuration in
fastagent.config.yaml:Note: This server interacts with an external weather API. Ensure any necessary API keys or configurations required byweather_api: command: "python" args: ["./created_mcp_servers/weather_api.py"]
./created_mcp_servers/weather_api.pyare correctly set up in your environment or the script.
- Description: Enables the agent to perform internet searches using the Serper API and retrieve results.
- Implementation Details: This server is implemented as a local Python script. Refer to
./created_mcp_servers/serper_search.pyfor details. - Configuration in
fastagent.config.yaml:Note: This server interacts with the Serper API. Ensure any necessary API keys or configurations required byserper_search: command: "python" args: ["./created_mcp_servers/serper_search.py"]
./created_mcp_servers/serper_search.pyare correctly set up in your environment or the script.
- Description: Allows the agent to interact with Gmail for sending and receiving emails.
- Implementation Details: Utilizes the
@gongrzhe/server-gmail-autoauth-mcppackage. More information can be found at MCP server gmail-autoauth. - Configuration in
fastagent.config.yaml:Note: This server usesgmail: command: "npx" args: ["@gongrzhe/server-gmail-autoauth-mcp"]
@gongrzhe/server-gmail-autoauth-mcpwhich is designed to simplify Gmail authentication. However, initial setup or user consent might be required. Refer to the server's documentation for specific authentication procedures and requirements.
This project defines several agents, each with a specific role, orchestrated by FastAgent:
route: This agent acts as a router, directing incoming requests to the appropriate specialized agent based on the nature of the request. It utilizes the following agents:chat_agent,screenshot_agent,weather_agent,search_agent,gmail_agent,maps_agent,slack_agent,sqlite_agent, andfallback_agent.orchestrate: This agent manages the overall flow and coordination between agents, starting with therouteagent.chat_agent: Handles direct conversations with the user in Turkish, responding to greetings and general chat.screenshot_agent: Captures screenshots of the user's screen when requested.weather_agent: Provides weather information for any city requested by the user.search_agent: Performs internet searches based on user queries and presents the results.gmail_agent: Manages Gmail interactions, such as sending and receiving emails.maps_agent: Performs various map-related operations, including geocoding, reverse geocoding, place searches, getting place details, calculating distances, retrieving elevation data, and generating directions.slack_agent: Interacts with Slack, enabling actions like listing channels, sending messages, replying to messages, reacting with emojis, fetching channel history, retrieving thread replies, listing users, and getting user profiles. All responses are in Turkish.sqlite_agent: Interacts with an SQLite database, allowing it to execute SQL queries, list tables, fetch table schemas, and perform other database operations. Responses to the user are in Turkish.fallback_agent: Handles requests that cannot be processed by any of the other specialized agents. It politely informs the user in Turkish that the request is outside its current capabilities and suggests alternative actions the user can take (e.g., chat, screenshot, weather, search, email, maps, Slack, or database operations).
Here are some example questions or commands you can use with the agents. These will typically be processed by the orchestrate and route agents to direct them to the appropriate specialized agent.
- "Merhaba, nasılsın?"
- "Bana bir fıkra anlatır mısın?"
- "Ekranımın görüntüsünü alır mısın?"
- "Bir ekran görüntüsü yakala."
- "İstanbul için hava durumu nedir?"
- "Ankara'da şu an hava nasıl?"
- "Türkiye'nin en yüksek dağı hangisidir?"
- "Yapay zeka alanındaki son gelişmeler nelerdir?"
- "Gelen kutumda yeni e-posta var mı?"
- "
arkadas@example.comadresine 'Selam' konulu bir e-posta gönder, içeriği 'Merhaba, nasılsın?' olsun."
- "Eyfel Kulesi'nin koordinatlarını verir misin?"
- "Ankara Kalesi'nden Anıtkabir'e yol tarifi oluştur."
- İzmir Saat Kulesi'nden Konak Pier'e arabayla gitmek ne kadar sürer?
- "
#genelkanalına 'Herkese merhaba, günaydın!' mesajını yolla." - "Slack'teki aktif kullanıcıları listeler misin?"
- "
urunlertablosundaki tüm verileri göster." - "Veritabanımda hangi tabloların olduğunu söyler misin?"
- "test.db veritabanında 'notlar' adında yeni bir tablo oluştur. Bu tabloda 'id' (INTEGER PRIMARY KEY AUTOINCREMENT), 'baslik' (TEXT NOT NULL) ve 'icerik' (TEXT) adında üç sütun olsun."
(This agent handles requests that other agents cannot. The following are examples of such requests that would trigger the fallback_agent.)
- "Bana bir resim çizer misin?"
- "Yarın piyasalar nasıl olacak tahmin edebilir misin?"