sens-mcp
sens-mcp
これは、SENS Energy Data API(ポーランドの電力市場データ API。配電事業者、料金プラン、複合価格計算)向けの MCP(Model Context Protocol)サーバーおよび開発者向けスターターキットです。
これは、API と通信する LLM や AI エージェント(Claude Desktop、Cursor、LangChain、n8n など)が直面する「コールドスタート」問題を解決します。ポーランドのエネルギー市場には独自の語彙(OSD vs. sprzedawca、料金グループ G11/G12/G12w など)があり、モデルはそれらを初期状態では知りません。また、生の REST レスポンスは大きすぎるうえに、手計算で照合・計算すると誤りやすいものです。
sens-mcp が提供するもの:
ゼロショットの発見 — MCP リソース(
sens://market/cheat-sheet)と発見ツール(resolve_operator、search_tariffs)を使い、約400トークン未満の情報量でモデルに市場の語彙を学習させます。実効的な自己修正 — ツールのエラーは生の HTTP エラーではなく、
did you mean G12w?のような提案を含む構造化 JSON を返すため、ReAct ループ内のエージェントは次の呼び出しを自ら修正できます。計算の単一の真実源 — 価格・電力量の計算はすべて SENS バックエンドで行われます。ツールキットはクライアント側で合計額を再計算しません。
ノンブロッキング起動 — 組み込みのフォールバック市場スキーマによりサーバーは即座に起動し、ライブな料金メタデータはバックグラウンドで更新されます。
クイックスタート
uvx で実行(推奨、インストール不要)
export SENS_API_KEY=sens_live_your_key_here
uvx sens-mcpまたは pip でインストール
pip install sens-mcp
export SENS_API_KEY=sens_live_your_key_here
python -m sens_mcp環境変数
変数 | 必須 | デフォルト | 説明 |
| はい | — | SENS APIキーです。 |
| いいえ |
| ステージング環境やセルフホスト運用向けの上書きURLです。 |
Related MCP server: US ISO Grid MCP
AI エージェントでの利用
Claude Desktop
claude_desktop_config.json に追加します(configs/claude_desktop_config.json を参照):
{
"mcpServers": {
"sens-energy": {
"command": "uvx",
"args": ["sens-mcp"],
"env": {
"SENS_API_KEY": "sens_live_your_key_here"
}
}
}
}Cursor
.cursor/mcp.json に追加します(configs/cursor_mcp.json を参照)— 上記と同じ形式です。
公開ツール
ツール | 目的 |
| タイプミスに寛容なファジーマッチで、都市名や会社名を、API が期待する |
| 顧客種別(家庭 / 小規模企業 / 産業)に応じて有効な料金コードを発見します。 |
| 複合電力価格と料率の内訳を取得します。 |
| 料金プランのURE 認可済みの固定・変動レート構成要素を確認します。 |
リソース: sens://market/cheat-sheet — ポーランド電力市場の語彙(OSD、料金グループ、価格構成要素の構造)をまとめた Markdown チートシート。
開発者向けサンプル (MCP 不要)
SENS REST API を直接呼び出すスタンドアンルーン・スニペット:
examples/python/async_stream.py—sinceによる差分同期
API リファレンス(要点)
ベースURL:
https://api.getsens.energy認証:
X-API-KEY:` ヘッダー(Bearer 認証ではない、クエリパラメータでもない)GET /api/v1/prices—osd,sprzedawca,taryfa,market,date,annual_kwh,region,since,page,size(最大1000)GET /api/v1/tariffs—since/If-Modified-Sinceによる差分クエリ、page、sizeGET /api/v1/tariffs/components?tariff_id=...— 単一のtariffの構成要素の詳細を取得。sinceにも対応。
完全な Swagger/OpenAPI ドキュメント: https://api.getsens.energy/api/docs。
詳細な開発者向けドキュメント(クイックスタート、MCP 連携ガイド、市場用語): docs.getsens.energy。
開発
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytestテストではすべての HTTP 呼び出しを respx でモックしています。デフォルトのテストスイートはライブ API に一切アクセスしません。
ライブ統合テストスイート(オプトイン)
tests/test_live_integration.py は、実際の MCP stdio プロトコルを介して実サーバーをサブプロセスとして起動し、実際の本番 SENS API に対して実行します。さらに、MCP ツールのレスポンスと、同じエンドポイントへの生の httpx 呼び出しがバイト単位で一致することを検証します。デフォルトでは除外されていますが、実際の API キーを使って明示的に実行できます:
SENS_API_KEY=<a real key> pytest -m live tests/test_live_integration.py -vライセンス
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with structured access to the U.S. EIA Open Data API for energy data including power plants, operations, fuel prices, projections, and state CO2 emissions.MIT
- AlicenseNot gradedqualityCmaintenanceEnables real-time access to US electricity generation, fuel mix, and demand data through natural language queries.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access and analyze Spanish electricity consumption data via the Datadis API, providing tools for supply management, consumption analysis, anomaly detection, and executive reporting.MIT
- AlicenseAqualityAmaintenanceEnables querying Tibber electricity prices, forecasts, consumption data, cheapest hours, and live Pulse measurements through natural language.7MIT
Related MCP Connectors
Real-time electricity prices for AI agents. 40+ countries, 100+ zones. No auth required.
Verified Polish open data for AI agents: debt, budget, 460 MPs, votings, judiciary search, RAG.
European day-ahead electricity prices (43 zones), accuracy-published forecasts, carbon, optimize.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/SofiaFlux/sens-toolkit'
If you have feedback or need assistance with the MCP directory API, please join our Discord server