Skip to main content
Glama
commit_refactorapp-consolidate-all-tool-modules-into-a-si_45536ee.md4.41 kB
# Documentation for Commit 45536ee **Commit Hash:** 45536eee29b6503022218c5697e441e444989eb3 **Commit Message:** refactor(app): consolidate all tool modules into a single app.py file **Generated:** Thu Oct 16 20:01:29 EDT 2025 **Repository:** geminiAgentMCP --- Here is the documentation for the provided git diff. *** ### **Refactoring: Consolidation of MCP Tools into a Single Application File** This update introduces a significant refactoring to simplify the project structure. All Model Context Protocol (MCP) tools, previously organized in a modular `src/tools/` directory, have been consolidated into a single `src/app.py` file. This change streamlines the codebase, simplifies the application's entry point, and removes the direct dependency on `uvicorn`. --- ### **Detailed Changes** #### 1. **Code Consolidation and New Entry Point** - **New File:** `src/app.py` has been created. It now contains the definitions for all MCP tools, including: - `call_gemini` - `create_github_issue` & `create_github_pr` - `summarize_docs` & `generate_docstrings` - `analyze_dependencies` - `lint_code` & `generate_unit_tests` - This file also serves as the new executable entry point for the server, using `mcp.run()` to start the service. #### 2. **File Deletions and Relocations** - **Deleted:** The previous main application file, `src/main.py`, has been removed. - **Deleted:** The entire `src/tools/` directory and all its modules (`code.py`, `dependencies.py`, `docs.py`, `gemini.py`, `github.py`) have been deleted as their contents are now in `src/app.py`. - **Moved:** The utility module has been relocated from `src/tools/utils.py` to `src/utils.py`. #### 3. **Dependency Management** - **Removed:** The `uvicorn` package has been removed from `requirements.txt`. The `fastmcp` library now manages the server lifecycle directly. #### 4. **API Modification** - The `call_gemini` tool's signature has been updated for clarity. The `context` parameter has been renamed to `system_instruction`. --- ### **Impact** - **Simplified Codebase:** The project structure is now flatter and easier to navigate, with all core tool logic centralized in one location. - **Simplified Execution:** The server is now started with a standard Python command, abstracting away the underlying web server implementation. - **Improved Maintainability:** Centralizing tool definitions can make them easier to manage and discover. --- ### **Usage** To run the MCP server, execute the new application file directly from your terminal: ```bash # Ensure GITHUB_TOKEN is set if using GitHub tools export GITHUB_TOKEN="your_personal_access_token" # Run the server python src/app.py ``` The server will start on `http://0.0.0.0:8000` by default. **Example: Updated `call_gemini` Tool Usage** The `call_gemini` tool now uses the `system_instruction` parameter. * **Old Usage:** ```json { "tool_name": "call_gemini", "parameters": { "prompt": "Explain the concept of recursion.", "context": "You are a helpful programming assistant." } } ``` * **New Usage:** ```json { "tool_name": "call_gemini", "parameters": { "prompt": "Explain the concept of recursion.", "system_instruction": "You are a helpful programming assistant." } } ``` --- ### **Breaking Changes** 1. **Server Startup Command:** The previous method of starting the server (e.g., `uvicorn src.main:app`) is no longer valid. The application must be run via `python src/app.py`. 2. **`call_gemini` Tool API:** Any client code or automation that calls the `call_gemini` tool must be updated to use the `system_instruction` parameter instead of `context`. 3. **Internal Imports:** The internal module paths have changed. Any custom extensions that imported from `src.tools.*` will be broken. --- ### **Migration Notes** - **Update Startup Scripts:** Modify any deployment scripts, Dockerfiles, or process managers (like `systemd`) to use the new startup command: `python src/app.py`. - **Update Client Integrations:** Review and update any applications or scripts that interact with the `call_gemini` tool to align with the new parameter name. - **Update Environment:** It is safe to remove `uvicorn` from your environment if it was installed as a direct dependency. Run `pip install -r requirements.txt` to sync your dependencies.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LeeSinLiang/GeminiAgentMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server