rentals-ops
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rentals-ops bookings are failing since the last deploy — what changed?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Rentals API
StayEase Rentals API: a FastAPI service for searching and booking rental homes, with built-in telemetry, plus simulation services that put it under load and break it on purpose.
simulation/loadgen.py ──HTTP traffic──▶ rentals_api (FastAPI) ──records──▶ telemetry.db ──▶ scripts/peek.py
simulation/chaos.py ───flips faults───▶ │ requests · logs · deploysProject layout
rentals-api/
├── rentals_api/ ← Part 1: the application
│ ├── main.py the FastAPI app: properties and bookings endpoints
│ ├── telemetry.py records every request, log line and deploy into telemetry.db
│ └── faults.py fault-injection hooks (all off by default)
├── simulation/ ← Part 2: simulation services
│ ├── loadgen.py synthetic users that search, view and book non-stop
│ └── chaos.py switches faults on and off, ships a buggy release
├── scripts/
│ └── peek.py a terminal dashboard over telemetry.db
├── ops_mcp/ ← Part 3: the Ops MCP server (built in class)
│ ├── queries.py all the SQL: requests, logs and deploys (never the faults table)
│ ├── server.py 8 tools, 3 resources, 2 prompts
│ └── call.py try the tools from the terminal, no AI needed
├── tests/
│ └── test_ops_mcp.py contract tests for the MCP server
├── pyproject.toml dependencies
├── uv.lock exact versions, the same for everyone
└── .python-version Python 3.12Related MCP server: Nibble
Setup
1 · Install uv (one time)
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shOpen a new terminal and check with uv --version.
2 · Get the code and install
cd D:\Training\GenAI\Projects # or any folder you like
git clone <repository URL shared by your trainer>
cd rentals-api
uv syncuv sync downloads Python 3.12 if needed, creates a private .venv folder, and installs the exact versions in uv.lock.
Run every command below from the
rentals-apifolder.
Part 1 · The Rentals API
Run it
uv run uvicorn rentals_api.main:app --port 9000Open http://127.0.0.1:9000/docs to try every endpoint in the browser.
Method | Endpoint | Does |
GET |
| Liveness check |
GET |
| Search listings |
GET |
| One listing (IDs 101–108) |
POST |
| Book: |
GET |
| One booking |
How the telemetry works
A FastAPI middleware in main.py wraps every request. It times the request and writes one row to telemetry.db: method, route template (such as /properties/{property_id}), status code, duration and app version. The API also writes structured log lines (level, route, message and details), and telemetry.db keeps a history of deploys.
After a few requests, look at it:
uv run python -m scripts.peekPart 2 · Simulation services
Use three terminal windows, all in the rentals-api folder:
Window | Command | You should see |
1 · API |
|
|
2 · load |
| About 19 req/s, reported every 10 seconds |
3 · you |
| Requests, errors and latency per route |
Break it on purpose
uv run python -m simulation.chaos status
uv run python -m simulation.chaos bad_deploy # ship buggy version 1.4.1
# ...wait a minute...
uv run python -m scripts.peek 1
uv run python -m simulation.chaos resetIncident | Command | What to look for in |
Bad deploy |
| Errors on one route, right after a new version |
Slow database |
| Every route slow; "connection pool exhausted" warnings |
Payment timeout |
| Only bookings failing, with 502 errors |
Turn faults off with off, or everything at once with reset.
Part 3 · The Ops MCP server
ops_mcp lets an AI assistant investigate incidents like an on-call engineer. It sees only what a human would: requests, logs and deploys. It has seven read-only tools and one action, rollback_deploy, which is guarded and should only be used after you say yes.
Tool | Answers |
| Is it broken right now? Traffic, errors, p95, SLO breaches, worst routes |
| What changed compared with the baseline? |
| When did it start, minute by minute, for one route? |
| What is failing? 5xx by route, plus grouped error and warning messages |
| What exactly did the logs say? |
| What shipped recently? |
| Is the new version to blame? |
| Action. Go back to an earlier version |
It also has resources (ops://slo, ops://runbook, ops://status) and prompts (investigate, incident_report).
Try it without an AI
Keep the API and the load generator running (Part 2), then:
uv run python -m ops_mcp.call --list
uv run python -m ops_mcp.call service_overview minutes=5
uv run python -m ops_mcp.call compare_windows recent_minutes=2 baseline_minutes=10
uv run python -m ops_mcp.call --resource ops://runbook
uv run pytest -q # 13 passedOr open the MCP Inspector in the browser (needs Node.js; the first start takes about 30 s):
uv run mcp dev ops_mcp/server.pyOpen the page it prints (http://localhost:6274) and click Connect. Everything is already filled in.
Connect it to Claude Desktop (stdio)
Claude Desktop starts the server itself and talks to it over stdio (standard input and output). You don't run the server in a terminal yourself.
1 · Find two paths (in PowerShell, from the rentals-api folder):
(Get-Command uv).Source # e.g. C:\Users\<you>\.local\bin\uv.exe
(Get-Location).Path # e.g. D:\Training\GenAI\Projects\rentals-api2 · Open the config file: in Claude Desktop, go to Settings → Developer → Edit Config. That opens claude_desktop_config.json (usually %APPDATA%\Claude\claude_desktop_config.json).
3 · Add the server. Put in your own two paths, and use double backslashes (\\) in JSON:
{
"mcpServers": {
"rentals-ops": {
"command": "C:\\Users\\<you>\\.local\\bin\\uv.exe",
"args": ["run", "--directory", "D:\\Training\\GenAI\\Projects\\rentals-api",
"python", "-m", "ops_mcp.server"]
}
}
}If you'd rather not use uv here, point at the project's own Python. In that case PYTHONPATH is required:
{
"mcpServers": {
"rentals-ops": {
"command": "D:\\Training\\GenAI\\Projects\\rentals-api\\.venv\\Scripts\\python.exe",
"args": ["-m", "ops_mcp.server"],
"env": { "PYTHONPATH": "D:\\Training\\GenAI\\Projects\\rentals-api" }
}
}
}Claude starts the server from another folder, so a config with just
.venv\Scripts\python.exe -m ops_mcp.serverfails withNo module named 'ops_mcp'. Use--directoryorPYTHONPATHas shown.
If the file already has other settings, add "rentals-ops" inside the existing "mcpServers" block instead of pasting a second one.
4 · Restart Claude Desktop completely: right-click its icon in the system tray and choose Quit. Closing the window is not enough. Then open it again.
5 · Check it's connected: in a new chat, open the tools menu (the slider icon under the message box). It should list rentals-ops with 8 tools. The prompts Investigate an incident and Write an incident report are in the + menu.
If it doesn't appear, read %APPDATA%\Claude\logs\mcp-server-rentals-ops.log.
Sample questions
Start the API and the load generator, and wait a few minutes so there is a baseline. Then break something with simulation.chaos and ask Claude:
Health checks (any time)
"Is the rentals service healthy right now?"
"What's our p95 latency and error rate over the last 15 minutes? Are we within SLO?"
"What was deployed in the last day, and by whom?"
After simulation.chaos bad_deploy
"Users say some listing pages are broken. Investigate and tell me the root cause."
"Did the latest deploy cause the errors? Show me the evidence by version."
"When exactly did the errors on
/properties/{property_id}start?""Roll back if you think it's needed." (Claude should show the evidence and ask you first.)
After simulation.chaos slow_db on
"Everything feels slow. What's going on?"
"Should we roll back?" (It should say no: errors are flat on every version and the runbook says scale the database.)
"Search the logs for connection pool warnings in the last 5 minutes."
After simulation.chaos payment_timeout on
"Customers can't complete bookings. Which route is failing, and why?"
"Show me the most common error messages in the last 10 minutes."
Wrap-up
Use the Write an incident report prompt, or ask: "Write a short incident report for the last 30 minutes. Use only numbers from the tools."
Stop the load generator for a minute and ask: "Is the service healthy?" (It should warn that no recent data is coming in.)
Run simulation.chaos reset between incidents.
Troubleshooting
Problem | Fix |
| Open a new terminal after installing uv |
| Set |
| Run commands from the |
| Another copy is running. Close it, or use |
| The API (window 1) and the load generator (window 2) must be running |
Clean start | Stop everything and delete |
Command Prompt won't switch to D: | Use |
Claude Desktop: | Use |
Claude Desktop doesn't show | Check the JSON (double backslashes, no trailing commas), then Quit from the system tray and reopen. Logs: |
Tools say "No requests recorded" | The API and the load generator must be running; the tools only read |
| Use |
Available Tools
8 toolscompare_windowsARead-only
What changed? Each route's recent p95 and error rate against the baseline window just before it, with a verdict. Problems first.
Inputs: recent_minutes, baseline_minutes. Returns: as_of, routes, recent_minutes, baseline_minutes
error_breakdownARead-only
What is failing? 5xx responses by route and status, plus the most frequent ERROR and WARNING messages (similar messages grouped, with first and last seen).
Inputs: minutes. Returns: as_of, errors, total_5xx, top_messages, +1 more
errors_by_versionARead-only
Is the new version to blame? Requests, 5xx errors, error rate and p95 per app version. Errors only on the newest version point at the deploy; errors on every version point elsewhere.
Inputs: route, minutes. Returns: as_of, route, versions, window_minutes
latency_trendBRead-only
When did it start, and is it getting better? One route, minute by minute: requests, p95, error %.
Inputs: route (required), minutes. Returns: as_of, route, minutes, window_minutes
recent_deploysARead-only
What was deployed recently, and when? Newest first. A deploy near the start of an incident is a suspect, not proof: check errors_by_version before blaming it.
Inputs: limit. Returns: result
rollback_deployADestructiveIdempotent
Should we roll back? Records a rollback to an earlier, already-deployed version. Use ONLY when errors started with a deploy and appear only on the new version. Never for a slow database or payment-provider problems: rolling back will not fix those. Ask the person and get a yes before calling this.
Inputs: reason (required), to_version (required). Returns: note, time, author, version, +1 more
search_logsBRead-only
What exactly did the logs say? Matching log lines, newest first, with their details.
Inputs: level, limit, route, minutes, +1 more. Returns: as_of, lines, window_minutes
service_overviewARead-only
Is the service healthy right now? Traffic, error rate, latency, SLO breaches, and routes worst first. Start every investigation here.
Inputs: minutes. Returns: as_of, p50_ms, p95_ms, routes, +6 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a narrow, clearly stated purpose, and the descriptions actively cross-reference each other to prevent misselection (e.g. recent_deploys says a deploy is a suspect, not proof, and points to errors_by_version). The error-related tools (error_breakdown, compare_windows, errors_by_version) overlap in topic but are cleanly separated by dimension: by route/status, by time-window delta, and by app version. rollback_deploy is unambiguously the only mutating tool and carries explicit guardrails.
Names are uniformly snake_case and human-readable, but the convention is mixed: some are verb_noun imperatives (search_logs, compare_windows, rollback_deploy) while others are noun phrases (service_overview, error_breakdown, latency_trend, recent_deploys). The pattern is still predictable enough that an agent can infer what each tool returns, but it isn't a single consistent verb_noun scheme.
Eight tools is well-scoped for an incident-triage server: a funnel from health overview to deploys to errors to logs to drift to per-version attribution, plus exactly one remediation action. No tool looks redundant or like filler, and the set stays small enough to reason about under pressure.
The investigation path is complete end to end (orient, correlate with deploys, localize errors, read logs, detect drift, attribute by version, act) with no dead ends for the stated workflows. Minor gaps remain: no way to inspect what a deploy actually changed (commits/diff), no dependency-level health signal for the database or payment provider explicitly called out in the rollback guardrail, and no log search scoped by version or instance.
Maintenance
Related MCP Connectors
Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
AI SRE: investigate production incidents across your observability stack.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes service health and log search tools for incident triage, enabling AI agents to investigate and summarize operational issues.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to investigate production incidents by exposing service health, logs, and deployment data through MCP tools.ISC
- AlicenseNot gradedqualityCmaintenanceEnables a local AI agent to investigate service incidents by querying read-only telemetry such as service health, metrics, logs, and traces, then produce verifiable assessments with evidence links and uncertainty.Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to inspect, query, and diagnose problems in a continuous delivery platform, and to perform release, deployment, runbook, task, tenant, and related operational actions with configurable read-only or write access.547 npmMIT