azure-billing-mcp-server
MCP server for Azure cost analysis via the Azure Cost Management Query API, deployed to Google Cloud Run for use with Gemini Enterprise.
README
azure-billing-mcp-server
MCP server for actual Azure spend / cost analysis via the Azure Cost Management Query API. Deployed to Google Cloud Run for use with Gemini Enterprise.
Architecture
User in Gemini Enterprise
|
v
Gemini Enterprise -> Entra ID OAuth (login.microsoftonline.com)
| receives access token (scope: api://<client-id>/mcp.access)
v
MCP Server (Cloud Run, access gated by IAM -- see GEMINI_SETUP.md)
BearerTokenMiddleware captures the token for audit logging only --
it is NOT forwarded to Azure (wrong audience for management.azure.com)
|
v
Server's own service principal credentials -> Azure Cost Management API
|
v
Response back to Gemini -> User
This is a deliberate difference from a same-app OAuth setup (where the
forwarded token would be directly reusable against the downstream API):
here the Entra app used for login and the service principal used for
billing data are two separate identities, so the incoming token is logged
for visibility but never used to call Azure. See GEMINI_SETUP.md for the
full reasoning.
Files
server.py # everything: FastMCP app, Azure Cost Management client,
# all 6 tools, and the entrypoint -- one file on purpose
requirements.txt
Dockerfile
deploy_cloudrun.sh # deploy + IAM grant + placeholder secret creation
.env.example # for local runs
CREDENTIALS.md # Azure Cost Management service principal setup/rotation
GEMINI_SETUP.md # OAuth fields, IAM grant, troubleshooting for Gemini Enterprise
Tools
list_subscriptions, query_costs, get_cost_by_service,
get_cost_by_resource_group, get_daily_cost_trend, get_top_resources_by_cost
Two separate credentials -- don't confuse them
- Entra ID app (
gemini-enterprise-mcp) -- only for Gemini Enterprise's OAuth consent screen. SeeGEMINI_SETUP.md. - Azure Cost Management service principal -- what this server actually
uses to query Azure. See
CREDENTIALS.md.
Who's allowed to call this server is Cloud Run IAM, not an in-app token
check -- see GEMINI_SETUP.md for why.
Local development
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # fill in the three AZURE_* values
python server.py # http://0.0.0.0:8000/mcp
Deploy
gcloud auth login
gcloud config set project <your-gcp-project-id>
gcloud services enable run.googleapis.com secretmanager.googleapis.com discoveryengine.googleapis.com
# edit the identifiers at the top of deploy_cloudrun.sh, then:
bash deploy_cloudrun.sh
Then follow GEMINI_SETUP.md for the Entra ID app registration and the
values to paste into Gemini Enterprise's data store form.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.