mcp-lab
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., "@mcp-labsearch incidents for database connection failures"
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.
mcp-lab
Companion repo for the "MCP" post (#14) on
karthiksolution.wordpress.com,
in the AI/agents series. Builds on the tracer/drift-monitor infra
established across earlier posts, most directly
structured-outputs-lab.
What's in here
A real MCP (Model Context Protocol) server, mcp_server/server.py,
exposing all 3 of the protocol's primitives around a small ops-
knowledge domain:
Tools:
search_incidents(query),get_runbook(service)Resource:
incident://{incident_id}, a full incident record addressed by URIPrompt:
postmortem_summary(incident_id), a reusable, pre-filled prompt template
Two ways to connect a Gemini-based client to it:
mcp_client_native:google-genai's own experimental built-in MCP bridge, pass a live MCP session directly into generation config and automatic function calling drives it. Tools only, async client only, and (see Pitfalls) requires passingconfigas a plain dict, not atypes.GenerateContentConfigobject, or it crashes.mcp_client_manual: a hand-written bridge covering all 3 primitives, converting MCP tool schemas to Gemini function declarations, running the tool-call loop by hand, and manually fetching the resource and prompt the native bridge can't touch.
common/evaluator.py's ToolCallEvaluator checks structural
correctness against real MCP call history (response.automatic_function_calling_history
for the native bridge, the manual loop's own return value for the
other), not an LLM judge, this post is about protocol plumbing, not
prompt content quality.
Related MCP server: devops-mcp-server
4 real bugs found while building this, all in Pitfalls
A subprocess launched with the bare string
"python"instead ofsys.executableused the system Python, not the venv, and couldn't findmcpat all.GenerateContentConfig(tools=[session])crashes withTypeError: cannot pickle '_asyncio.Task' object,generate_contentunconditionally deep-copies its config before reaching any MCP-specific handling. Passingconfigas a plain dict avoids it entirely.Schema.from_json_schema()expects aJSONSchemaobject, not the plain dictTool.input_schemaactually is,JSONSchema.model_validate(...)first is required.Replaying a
function_callpart back into conversation history for a hand-written multi-turn loop needs the original part'sthought_signaturepreserved, reconstructing a newPartfrom just the extracted call drops it and the API rejects the next turn.
Setup (Windows / PowerShell)
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
copy .env.example .envEdit .env and set GEMINI_API_KEY to your real key.
Running the demo
python run_demo.pyRunning the offline validation (no API key required beyond a placeholder)
python -m tests_offline.test_data_mock
python -m tests_offline.test_bridge_conversion_mock
python -m tests_offline.test_evaluator_mock
python -m tests_offline.test_llm_utils_config_mockRunning the evaluator
python run_eval.py --save-baseline
python run_eval.pyLicense
MIT, see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Manage incidents and on-call: list/create/update incidents, who is on call, on-call overrides.
Enrich, search, assess, and manage threat intelligence through 80+ typed MCP tools.
- mttrlyOAuthcom.mttrly
AI-powered incident management and server monitoring via MCP.
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceEnables managing incident response workflows including incidents, on-call, postmortems, and more through the Runframe platform using MCP tools.50 npm4MIT- FlicenseNot gradedqualityCmaintenanceExposes DevOps/SRE operations like Kubernetes pod status, Prometheus metrics queries, and deploy history as tools for MCP-compatible clients.-
- FlicenseNot gradedqualityBmaintenanceProvides MCP tools to search engineering runbooks and historical incidents using semantic retrieval, supporting evidence-grounded incident investigation.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to investigate production incidents by exposing service health, logs, and deployment data through MCP tools.5 npm-