Kela MCP Server
Enables AI assistants to answer questions about Finnish social benefits (Kela) by providing tools for searching, checking eligibility, and getting application steps.
README
Kela MCP Server
An open-source knowledge server that helps AI assistants answer questions about Finnish social benefits (Kela). Works with any AI assistant that supports the Model Context Protocol. Note! This is a hobby project to demonstrate how to create MCP's.
You: "Can I get housing allowance if I earn 1400€/month in Helsinki?"
AI: Let me check that for you...
[calls kela-mcp → check_eligibility]
Based on current asumistuki rules, with 1400€/month income in Helsinki:
- You may be eligible for partial housing allowance
- Estimated amount: 150-280€/month depending on rent and household size
- Apply through OmaKela with form AT1
This is informational only. Verify at kela.fi
What is MCP?
Model Context Protocol (MCP) is an open standard that lets AI assistants use external tools and data sources. Think of it like giving your AI assistant "superpowers", instead of relying only on its training data, it can call real tools to look things up, do calculations, or take actions.
┌─────────────────┐ ┌─────────────────┐
│ │ "What is │ │
│ AI Assistant │ kuntoutustuki?" │ Kela MCP │
│ (Claude, etc.) │ ───────────────────► │ Server │
│ │ │ │
│ │ ◄─────────────────── │ [looks up │
│ │ {eligibility, │ real data] │
│ │ amounts, ...} │ │
└─────────────────┘ └─────────────────┘
Without MCP: AI answers from memory (may be outdated or wrong) With MCP: AI calls this server to get current, structured information
MCP is an open protocol - not tied to any specific AI company. Any AI assistant that implements MCP can use this server.
What This Server Provides
Tools (things the AI can do)
| Tool | What it does | Example |
|---|---|---|
search_benefits |
Find relevant benefits | "help for unemployed students" |
get_benefit_details |
Get full info on one benefit | "tell me about opintotuki" |
check_eligibility |
Estimate if you qualify | "can I get asumistuki with X income?" |
get_application_steps |
How to apply | "how do I apply for sairauspäiväraha?" |
compare_benefits |
Side-by-side comparison | "difference between X and Y?" |
Resources (data the AI can browse)
| Resource | Contents |
|---|---|
kela://benefits |
List of all benefit categories |
kela://benefits/{id} |
Detailed info for one benefit |
kela://updates |
Recent changes to benefits |
Supported Benefits (MVP)
- Asumistuki - Housing allowance
- Opintotuki - Student financial aid
- Sairauspäiväraha - Sickness allowance
- Työttömyysturva - Unemployment benefits
- Kuntoutustuki - Rehabilitation subsidy
- Vanhempainpäiväraha - Parental allowance
- Toimeentulotuki - Social assistance
- Eläkkeet - Pensions (overview)
Quick Start
Prerequisites
- Python 3.11 or newer
- An MCP-compatible AI client (see Supported Clients)
Installation
# Clone the repository
git clone https://github.com/emmakingdev/kela-mcp.git
cd kela-mcp
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package
pip install -e .
# Build the search index
python scripts/build_db.py
Verify it works
# Run the server directly to test
python -m kela_mcp.server
# You should see:
# Kela MCP Server running...
# Press Ctrl+C to stop
Supported Clients
MCP is an open protocol. Here's how to connect this server to popular AI clients:
Claude Desktop
Edit your Claude Desktop config file:
macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"kela": {
"command": "python",
"args": ["-m", "kela_mcp.server"],
"cwd": "/full/path/to/kela-mcp"
}
}
}
Restart Claude Desktop. You should see "kela" in the MCP servers list. If it fails, create the venv again.
Claude Code (CLI)
Add to your Claude Code MCP settings:
{
"mcpServers": {
"kela": {
"command": "python",
"args": ["-m", "kela_mcp.server"],
"cwd": "/full/path/to/kela-mcp"
}
}
}
Other MCP Clients
Any client that implements the MCP specification should work. The server uses stdio transport by default (the most widely supported).
For clients that need HTTP/SSE transport:
# Install with SSE support
pip install -e ".[sse]"
# Run with SSE transport
python -m kela_mcp.server --transport sse --port 8080
Building Your Own Client
If you're building an AI application and want to integrate this server, see the MCP Documentation for client implementation guides in various languages.
Usage Examples
Once connected, just ask your AI assistant about Kela benefits in natural language:
In Finnish
"Mitä tukia voin saada opiskelijana?"
"Kuinka paljon asumistukea voin saada jos vuokra on 600€?"
"Miten haen sairauspäivärahaa?"
In English
"What benefits can I get as a student in Finland?"
"Am I eligible for housing allowance with 1500€ income?"
"How do I apply for parental leave benefits?"
The AI will automatically use the appropriate tools from this server to answer.
Project Structure
kela-mcp/
├── src/
│ └── kela_mcp/
│ ├── __init__.py
│ ├── server.py # MCP server entry point
│ ├── tools/ # Tool implementations
│ │ ├── search.py
│ │ ├── details.py
│ │ ├── eligibility.py
│ │ └── application.py
│ ├── resources.py # MCP resources
│ ├── prompts.py # Prompt templates
│ └── db.py # Database interface
├── data/
│ ├── benefits/ # Benefit data (JSON)
│ │ ├── asumistuki.json
│ │ ├── opintotuki.json
│ │ └── ...
│ └── kela.db # Search index (SQLite)
├── scripts/
│ ├── build_db.py # Build search index
│ └── validate_data.py # Validate benefit data
├── tests/
├── pyproject.toml
└── README.md
Data Sources & Accuracy
All information comes from publicly available sources on kela.fi.
Important Disclaimers
This is NOT official Kela guidance.
- Benefits rules change frequently
- Individual circumstances vary
- Always verify information at kela.fi or contact Kela directly
- This tool provides general information to help you understand your options
Data Freshness
Each benefit entry includes a last_updated timestamp. We aim to review data quarterly, but cannot guarantee real-time accuracy.
Development
Running Tests
pytest tests/
Adding a New Tool
- Create a new file in
src/kela_mcp/tools/ - Implement the tool function with
@server.tool()decorator - Register it in
server.py - Add tests in
tests/
Local Development with Hot Reload
# Install dev dependencies
pip install -e ".[dev]"
# Run with auto-reload (requires watchdog)
watchmedo auto-restart --patterns="*.py" --recursive -- python -m kela_mcp.server
FAQ
Why MCP instead of a regular API?
MCP allows AI assistants to intelligently choose which tools to use based on the conversation. Instead of you manually calling an API, you just ask a question and the AI figures out what information it needs.
Can I use this without an AI assistant?
The server is designed for MCP clients, but the underlying data is plain JSON. You can directly read the files in data/benefits/ or query data/kela.db with SQL.
Is this affiliated with Kela?
No. This is an independent open-source project. We aggregate publicly available information to make it more accessible.
Why Finnish benefits specifically?
The Finnish benefits system is complex and navigating it can be confusing, especially for immigrants or people unfamiliar with the system. This tool helps make that information more accessible.
License
MIT License - see LICENSE for details.
Acknowledgments
- Model Context Protocol - The open standard that makes this possible
- Kela - For providing comprehensive public documentation
- Contributors who help keep the data accurate
Links
- MCP Specification
- MCP Python SDK
- Kela.fi - Official source
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。