Python Version and Dependencies Required for the MCP Ambari API

The MCP Ambari API requires Python 3.12 or newer and depends on aiohttp (≥3.12.15) for HTTP communication and fastmcp (≥2.12.3) for MCP server functionality.

The call518/mcp-ambari-api repository implements a Model Context Protocol (MCP) server that interfaces with Apache Ambari's REST API. Understanding the Python version and dependencies required for this project is essential for successful deployment and development.

Python Version Requirements

The project mandates Python 3.12 or newer, as specified in the requires-python field of pyproject.toml at line 10. This version requirement ensures compatibility with modern async/await patterns and type hinting features used throughout the codebase.

Core Runtime Dependencies

The minimal runtime footprint consists of two primary libraries declared in the dependencies section of pyproject.toml (lines 12-13):

aiohttp for Asynchronous HTTP

aiohttp (≥3.12.15) serves as the asynchronous HTTP client for communicating with Apache Ambari's REST API. This library handles all network I/O operations within src/mcp_ambari_api/functions.py, where the actual business logic for Ambari API calls is implemented.

fastmcp for MCP Server Framework

fastmcp (≥2.12.3) provides the core framework implementing the Model Context Protocol server capabilities. The FastMCP class is instantiated in src/mcp_ambari_api/mcp_main.py, which serves as the entry point for registering MCP tools and handling protocol-level operations.

Development Dependencies

For contributors and maintainers, the project defines an optional dev dependency group in pyproject.toml (line 31) containing code quality tools:

  • pre-commit (≥4.5.1) – Git hook manager for automated linting and secret scanning
  • ruff (≥0.15.1) – Fast Python linter and formatter

These tools are not required for production deployments but are essential for maintaining code standards when contributing to the repository.

Installation Guide

The recommended installation method uses the uv tool for fast, reliable dependency management.

Installing Runtime Dependencies


# Create a virtual environment with Python 3.12 or newer

uv venv .venv --python 3.12

# Activate the environment (POSIX shells)

source .venv/bin/activate

# Install runtime dependencies (aiohttp and fastmcp)

uv sync

Installing Development Dependencies


# Install both runtime and development dependencies

uv sync --group dev

Verifying Installation

import aiohttp
from fastmcp import FastMCP

# Verify aiohttp version

print(f"aiohttp version: {aiohttp.__version__}")

# Verify FastMCP can be instantiated

app = FastMCP()
print("FastMCP instantiated successfully")

Key Source Files

Understanding where dependencies are utilized helps with debugging and extension:

File Role Dependency Usage
pyproject.toml Declares Python version and all dependencies requires-python, dependencies, dev groups
src/mcp_ambari_api/mcp_main.py Entry point for MCP server Instantiates FastMCP class
src/mcp_ambari_api/functions.py Business logic for Ambari API calls Uses aiohttp for HTTP requests
.github/workflows/pypi-publish.yml CI/CD for package publishing Ensures dependency consistency during build

Summary

  • Python 3.12+ is strictly required as defined in pyproject.toml
  • Runtime dependencies are minimal: aiohttp (≥3.12.15) for HTTP and fastmcp (≥2.12.3) for MCP server functionality
  • Development tools (pre-commit, ruff) are optional but recommended for contributors
  • Use uv sync for installation; add --group dev for development dependencies
  • Core implementation resides in src/mcp_ambari_api/mcp_main.py (FastMCP) and src/mcp_ambari_api/functions.py (aiohttp)

Frequently Asked Questions

Can I use Python 3.11 with the MCP Ambari API?

No. The project explicitly requires Python 3.12 or newer as specified in the requires-python field of pyproject.toml. Attempting to install with Python 3.11 will result in a dependency resolution error.

Are the development dependencies required for production deployment?

No. The development dependencies (pre-commit and ruff) are only required if you are contributing code to the repository. For production deployments, only aiohttp and fastmcp are needed.

How do I check which versions of the dependencies are currently installed?

You can verify installed versions using Python's import system. Run python -c "import aiohttp; print(aiohttp.__version__)" to check aiohttp, or examine the output of uv pip list if using the uv package manager.

Where are the dependencies actually used in the codebase?

The fastmcp dependency is used in src/mcp_ambari_api/mcp_main.py to instantiate the MCP server, while aiohttp is used in src/mcp_ambari_api/functions.py to handle HTTP communication with the Apache Ambari REST API.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →