society-maintenance-mcp-server
Enables querying society maintenance and expense data from Excel files via natural language, providing tools to check pending payments, balance sheets, expense summaries, and flat histories.
README
Society Maintenance Tracker — MCP Server
An MCP (Model Context Protocol) server that exposes society maintenance and expense data as tools, so any MCP-compatible AI agent (Claude Desktop, Cursor, watsonx, etc.) can query it using natural language.
What it does
The server reads two Excel files (Maintenance.xlsx and Expenses.xlsx) and registers 8 tools that an AI agent can call:
| Tool | What it answers |
|---|---|
tool_get_all_months |
Which months have data? |
tool_get_pending_maintenance |
Which flats haven't paid? (by month or year) |
tool_get_collected_maintenance |
Which flats have paid? (by month or year) |
tool_get_balance_sheet |
Income vs expenses — surplus or deficit? |
tool_get_expense_summary |
Expenses broken down by category |
tool_get_flat_history |
Full payment history for a specific flat |
tool_download_pending_report |
Generate & save pending maintenance Excel report |
tool_download_balance_report |
Generate & save balance sheet Excel report |
Project structure
Society Maintenance Tracker/
├── server.py # MCP server entry point (8 tools registered)
├── server/
│ ├── __init__.py
│ └── data_loader.py # Loads & queries Maintenance.xlsx + Expenses.xlsx
├── reports/
│ ├── __init__.py
│ └── generator.py # Generates styled Excel reports
├── data/ # ← YOU must supply these (not included in repo)
│ ├── Maintenance.xlsx
│ └── Expenses.xlsx
├── downloads/ # Auto-created — generated reports saved here
├── requirements.txt
├── Dockerfile
└── README.md
Prerequisites
- Python 3.11 or 3.12
- The two Excel data files (see Data files below)
Installation
1. Clone the repo
git clone https://github.com/YOUR_USERNAME/society-maintenance-tracker.git
cd society-maintenance-tracker
2. Create a virtual environment (recommended)
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
3. Install dependencies
pip install -r requirements.txt
4. Add your data files
Create a data/ folder and place your Excel files inside:
data/
├── Maintenance.xlsx ← sheet name must be "Maintenance"
└── Expenses.xlsx ← sheet name must be "Expenses"
Expected columns:
Maintenance.xlsx — Month | Date | Flat No | Name | Amount | Late Charges
Expenses.xlsx — Month | Date | Expence Type | Details | Amount | Spend By
Running the server
stdio mode — for AI agents that spawn it as a subprocess (Claude Desktop, Cursor, etc.)
python server.py
⚠️ Do not type into the terminal in this mode — the server speaks JSON-RPC over stdin/stdout. It will look frozen; that is normal.
SSE mode — for persistent servers / external clients
python server.py --sse
Server listens at http://localhost:8100/sse.
Connecting to AI clients
Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"society-maintenance": {
"command": "python",
"args": ["C:/full/path/to/society-maintenance-tracker/server.py"]
}
}
}
Restart Claude Desktop. You can now ask questions like:
- "Which flats haven't paid maintenance for January 2024?"
- "What is the balance sheet for 2024?"
- "Give me the payment history for flat 601."
Cursor / VS Code (MCP extension)
Add to your MCP settings:
{
"society-maintenance": {
"command": "python",
"args": ["/full/path/to/server.py"]
}
}
MCP Inspector (browser UI — best for testing)
npx @modelcontextprotocol/inspector python server.py
Opens at http://localhost:5173 — browse and call all tools interactively.
Running with Docker
# Build
docker build -t society-mcp .
# Run (mount your local data/ folder into the container)
docker run -v $(pwd)/data:/app/data society-mcp
Testing
Quick data sanity check
python -c "
import sys; sys.path.insert(0, '.')
from server.data_loader import get_all_months, get_balance_sheet
print(get_all_months())
print(get_balance_sheet(year=2024))
"
Full MCP protocol test (stdio)
python _test_server.py
This sends a proper JSON-RPC handshake and lists all registered tools.
Data files
The data/ folder is excluded from this repository (see .gitignore) because the Excel files contain private resident information.
To use this server:
- Create your own
Maintenance.xlsxandExpenses.xlsxfollowing the column format above. - Place them in the
data/folder. - The server will load them automatically on first tool call.
Month format
Months in the Excel file must follow the pattern MonthName_YYYY, e.g.:
Jan_2024 Feb_2024 March_2024 April_2024
May_2024 June_2024 July_2024 Aug_2024
Sep_2024 Oct_2024 Nov_2024 Dec_2024
The server normalises common variants automatically (january_2024, MARCH_2025, jun_2024, etc.).
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。