churn-mcp-server

churn-mcp-server

Enables MCP-aware clients to call the churn-prediction API's predict_churn and check_model_health tools directly, proxying to the existing churn-api service over HTTP.

Category
Visit Server

README

churn-mcp-server

Exposes the existing ml-production-template churn-prediction API as an MCP tool, so an MCP-aware client (Claude Desktop, Claude Code, or any MCP client) can call predict_churn directly.

Design

This is a thin adapter, not a rewrite of the model server. It does not load the model itself -- it calls the already-deployed churn-api service's /predict endpoint over HTTP. That means:

  • The MCP layer can be redeployed or scaled independently of the model.
  • If churn-api restarts, this doesn't need to.
  • The "real" ML system (FastAPI + MLflow) is untouched; MCP is an additive interface on top of it, matching how you'd actually integrate MCP into an existing production service rather than baking it into the model server.

Two tools are exposed:

  • predict_churn -- the 19-field customer schema from the real API, returns churn_probability / churn_prediction / threshold_used.
  • check_model_health -- proxies the API's /health endpoint.

A version note

The official mcp Python SDK shipped a v2.0 recently that renamed FastMCP to MCPServer and moved import paths. This project pins mcp<2.0.0 and uses from mcp.server.fastmcp import FastMCP, since that's still the stable, widely-documented line as of this writing. If you're reading this later and pip install mcp pulls v2 by default, you'll need to port the import (mcp.server.fastmcp.FastMCPmcp.server.MCPServer) — check the SDK's migration guide before assuming the code below still applies as-is.

Local test (stdio, no Docker)

pip install -r requirements.txt
$env:MCP_TRANSPORT="stdio"
$env:CHURN_API_URL="http://localhost:8000"   # your local churn-api
python server.py

Point Claude Desktop's claude_desktop_config.json at it:

{
  "mcpServers": {
    "churn-predictor": {
      "command": "python",
      "args": ["C:\\path\\to\\churn-mcp-server\\server.py"],
      "env": { "CHURN_API_URL": "http://localhost:8000" }
    }
  }
}

Deploying into the existing kind cluster

This assumes the churn-api Deployment + Service from the Kubernetes project are already running in your kind cluster.

docker build -t churn-mcp-server:local .
kind load docker-image churn-mcp-server:local --name <your-cluster-name>
kubectl apply -f k8s/deployment.yaml
kubectl get pods -l app=churn-mcp-server

Verify:

kubectl port-forward svc/churn-mcp-server 8080:80
curl http://localhost:8080/healthz

A real gotcha worth knowing for interviews

A bare GET /mcp returns 406 Not Acceptable -- the MCP streamable-http transport requires Accept: text/event-stream, which a plain Kubernetes httpGet probe doesn't send. That breaks a naive readiness probe pointed at /mcp directly. The fix here: FastMCP.streamable_http_app() returns the underlying Starlette app, which you can mount alongside a hand-written /healthz route that returns a plain 200 -- see the bottom of server.py. This is a legitimate "I hit a real integration problem and understood why" story, which is a stronger interview answer than a project where nothing went wrong.

What this demonstrates (accurate resume phrasing)

"Built an MCP server exposing a production FastAPI model-serving endpoint as a callable tool, deployed to Kubernetes alongside the existing service."

Not accurate: claiming "MCP" as a bare skill tag without being able to explain what MCP actually is (a protocol for exposing tools to LLM clients, not a deployment or hosting mechanism).

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured