credit-risk-mcp
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., "@credit-risk-mcpWhat's the Altman Z-Score for AAPL?"
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.
Credit Risk Analytics MCP Server
A Python MCP (Model Context Protocol) server that exposes credit-risk analytics as callable tools for Claude Desktop — turning natural-language questions into real financial risk calculations.
What it does
This server gives Claude three tools:
Tool | What it does |
| Pulls live balance sheet & income statement data for any stock ticker (via |
| Computes the Altman Z-Score — a classic bankruptcy-risk formula combining 5 financial ratios — for a public company |
| Predicts an individual loan applicant's default probability using a logistic regression model |
Ask Claude Desktop something like "What's the Altman Z-Score for TCS.NS?" or give it a loan applicant's income, debt ratio, and credit history, and it calls the right tool, runs the real calculation, and explains the result.
Related MCP server: Finance MCP Server
Why MCP
Without MCP, these would just be Python functions you'd have to run yourself. MCP turns them into tools an AI client can call directly: Claude Desktop sends a structured JSON-RPC request to this server, the server runs the actual calculation, and sends the result back — so you get a live, verifiable answer instead of a guess from the model's training data.
Project structure
credit-risk-mcp/
├── server.py # The MCP server — defines all 3 tools
├── train_model.py # Generates synthetic credit data + trains the logistic regression model
├── requirements.txt # Python dependencies
├── model.pkl # Trained logistic regression model
├── scaler.pkl # StandardScaler used to preprocess model inputs
└── .gitignoreSetup
git clone https://github.com/Lipika118/credit-risk-mcp.git
cd credit-risk-mcp
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtThe trained model (model.pkl, scaler.pkl) is already included, so you can
skip straight to running the server. If you want to retrain it yourself:
python3 train_model.pyThis generates a synthetic-but-realistic applicant dataset (income, debt ratio, credit history, late payments, loan amount, age), trains a logistic regression model, and prints the test AUC.
Testing standalone
Before connecting to Claude Desktop, test the tools directly with the MCP Inspector:
pip install "mcp[cli]"
mcp dev server.pyThis opens a browser UI where you can call each tool manually and see the JSON-RPC request/response for each one.
Connecting to Claude Desktop
Add this to your claude_desktop_config.json
(%APPDATA%\Claude\claude_desktop_config.json on Windows,
~/Library/Application Support/Claude/claude_desktop_config.json on Mac):
{
"mcpServers": {
"credit-risk": {
"command": "/full/path/to/venv/Scripts/python.exe",
"args": ["/full/path/to/credit-risk-mcp/server.py"]
}
}
}Fully quit and reopen Claude Desktop, then check Connectors in the chat
input menu — credit-risk should be listed and toggled on.
Example usage
Company risk:
"What's the Altman Z-Score for TCS.NS?"
Ticker: TCS.NS
Altman Z-Score: 10.69
Risk Zone: Safe zone (low bankruptcy risk)
Component ratios:
Working Capital / Total Assets: 0.410
Retained Earnings / Total Assets: 0.548
EBIT / Total Assets: 0.366
Market Cap / Total Liabilities: 11.271
Revenue / Total Assets: ...Individual risk:
"A loan applicant has monthly income 40000, debt-to-income ratio 0.5, 3 years credit history, 2 late payments last year, wants a loan of 250000, and is 27 — what's their default risk?"
Default probability: 78.0%
Risk band: High riskNotes on the model
The loan-default model is trained on synthetic data, not real applicant records — this avoids privacy/licensing issues while still learning genuine, explainable relationships (higher debt-to-income ratio and more late payments both increase predicted default risk). It's meant to demonstrate the MCP integration pattern, not to be used for real lending decisions.
Safety
predict_loan_default_risk and calculate_altman_zscore are both
read-only — they don't modify any data or make external calls beyond
fetching public market data.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
SEC filing intelligence for AI agents. Financials, screening, peer comparison for 5,000+ companies.
Provide AI assistants with real-time access to official SEC EDGAR filings and financial data. Enab…
Altman Z-Score bankruptcy-risk screen for a US-listed ticker, inputs looked up automatically.
Loan & mortgage calculator, compound interest, ROI, crypto prices, FX conversion for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with natural language access to WRDS financial data for credit and equity analysis through 29 specialized tools. It enables users to query bond history, credit ratings, financial metrics, and syndicated loans using simple conversational prompts.MIT
- FlicenseNot gradedqualityDmaintenanceEnables financial calculations such as compound interest, loan EMI, and savings goal projections through natural language.-
- FlicenseBqualityCmaintenanceEnables SEC EDGAR financial research, analysis, valuation, and chart data generation through natural language.24-
- AlicenseNot gradedqualityBmaintenanceEnables querying of SEC EDGAR filings and financial data via natural language, offering tools for company lookup, filing retrieval, XBRL data, and full-text search.116 npmMIT