Skip to main content
Glama

MCP Server for ML Model Integration

by nicknochnack
# Import depdendencies from mcp.server.fastmcp import FastMCP import json import requests from typing import List # Server created mcp = FastMCP("churnandburn") # Create the tool @mcp.tool() def PredictChurn(data: List[dict]) -> str: """This tool predicts whether an employee will churn or not, pass through the input as a list of samples. Args: data: employee attributes which are used for inference. Example payload [{ 'YearsAtCompany':10, 'EmployeeSatisfaction':0.99, 'Position':'Non-Manager', 'Salary:5.0 }] Returns: str: 1=churn or 0 = no churn""" payload = data[0] response = requests.post( "http://127.0.0.1:8000", headers={"Accept": "application/json", "Content-Type": "application/json"}, data=json.dumps(payload), ) return response.json() if __name__ == "__main__": mcp.run(transport="stdio")

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nicknochnack/BuildMCPServer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server