
OTC Pricing MCP
io.github.seaser0由 GitHub 账号 seaser0 发布v0.1.1更新于 Oct 24, 2026
MCP server for the Open Telekom Cloud Price Calculator API (eu-de, eu-nl, eu-ch2).
概览
为助手提供 Open Telekom Cloud 价格数据与文档检索的 MCP 服务器,可查询、估算并比较云成本。
- 可以做什么
- 列出可用的 OTC 服务与区域,并查看某项服务价格数据可筛选或返回的字段。按区域筛选查询一个或多个服务的价格记录,并按 vCPU、内存、操作系统和区域查找 ECS 计算规格。估算一组资源的月度成本,并比较按量付费与 12、24、36 个月预留价格。检索 OTC 用户手册与 API 参考的索引副本,再以 Markdown 获取匹配的文档页面或章节。
- 适用场景
- 适合规划或比较 Open Telekom Cloud 部署时使用:选择计算规格、估算月度开销、权衡预留与按量计费,或在不离开助手的情况下查阅 OTC 文档。
- 运行要求
- 本地 Python 3.12+ 进程,可从 PyPI 包或仓库用 uv 安装。需要访问 OTC 价格计算 API 的网络。可选环境变量用于设置日志级别、指标与健康检查的 HTTP 端口和绑定地址、API 基础地址以及文档索引路径。
安装
在 SourceWeft 中
- 打开 控制台中的 OTC Pricing MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
OTC Pricing MCP Server
[CI] [Release] [License] [Python]
An open-source Model Context Protocol (MCP) server for the Open Telekom Cloud (OTC) Price Calculator API.
Expose OTC pricing data to Claude and other LLM clients with full observability (structured logging, Prometheus metrics, health checks).
Status: v0.1.3 — STDIO + SSE transports, Kubernetes deployment, full observability
What is MCP?
Model Context Protocol is a standard that enables LLM applications (like Claude) to interact with external tools and data sources. This server supports two transports:
This server gives Claude access to OTC pricing data and the user-manual / API-reference documentation through 9 specialized tools, on whichever transport you prefer.
What Can You Do With This?
Example Use Cases:
- Ask Claude: "Find the cheapest ECS instance with 4 CPUs and 8GB RAM in eu-de"
- Claude calls
find_compute_flavortool → gets pricing data → answers you - Ask: "Compare PAYG vs 12-month reserved pricing for S3 storage"
- Claude calls
compare_billing_modelstool → does the analysis → shows savings
Quick Start
1. Install
Requirements: Python 3.12+
What You'll See:
The server now listens for MCP connections on both stdin/stdout and http://localhost:8080/sse.
2. Connect Your MCP Client
Option A — STDIO (local, Claude Desktop)
Option B — SSE (remote, Kubernetes)
Point any MCP client that supports SSE transport at the hosted endpoint:
Or test locally while running the server:
3. Start Using Tools
Once connected, Claude can call any of the 7 available tools. See the Tools Reference section below.
Tools Reference
The server exposes 7 MCP tools for different pricing queries:
1. list_services
Purpose: Get all available OTC services
Input: None
Output: List of service names and metadata
Example Claude usage:
2. list_regions
Purpose: Get available OTC regions
Input: None
Output: List of region codes (eu-de, eu-nl, eu-ch2, etc.)
Example Claude usage:
3. get_service_schema
Purpose: Get filterable/returnable columns for a service
Input:
service(string): Service name (e.g., "ecs", "evs", "obs", "s3", "rds")
Output: Schema with filterable and returnable column names
Example Claude usage:
4. query_pricing
Purpose: Query pricing data with flexible filtering
Input:
services(array): List of service names (e.g., ["ecs", "evs"])region(string, optional): Filter by region (e.g., "eu-de")max_results(integer, optional): Max results to return (default: 5000)
Output: Pricing rows matching the filter
Example Claude usage:
5. find_compute_flavor
Purpose: Find compute (ECS) instances by vCPU/RAM/OS
Input:
v_cpu(integer): Number of virtual CPUsram_gb(number): RAM in GiBos(string, optional): Operating system (Linux, Windows, etc.)region(string, optional): Region (default: eu-de)
Output: Matching ECS instance types with pricing
Example Claude usage:
6. estimate_monthly_cost
Purpose: Calculate monthly cost for multiple resources
Input:
items(array): Resources with:id(string): Product ID (e.g., "OTC_S3M1_LI")quantity(number, optional): How many units (default: 1)hours_per_month(number, optional): Usage hours (default: 730)
Output: Itemized costs with monthly total
Example Claude usage:
7. compare_billing_models
Purpose: Compare PAYG vs Reserved Instance pricing
Input:
product_id(string): Product ID (e.g., "OTC_S3M1_LI")quantity(number, optional): Quantity (default: 1)hours_per_month(number, optional): Usage hours (default: 730)
Output: Cost comparison for PAYG, 12mo, 24mo, 36mo reserved
Example Claude usage:
8. search_otc_docs
Purpose: Full-text search across the indexed OTC user manual and API reference
Input:
query(string): Search terms (BM25-ranked, AND of tokens)scope(string, optional):public|swiss|both(default:both)service(string, optional): Restrict to one service repo (e.g.elastic-cloud-server)top_k(integer, optional): 1-50, default 5
Output: Ranked list of {url, title, h2, h3, snippet, service, cloud, upstream_commit} hits.
The index ships with the package and is rebuilt weekly from the upstream
opentelekomcloud-docs/<service> Sphinx/RST repos (Apache-2.0); the runtime
never touches the Anubis-gated docs.otc.t-systems.com HTML.
Example Claude usage:
9. get_otc_doc_section
Purpose: Fetch the body of one indexed documentation page (or one of its sections) as Markdown
Input:
url(string): Canonical URL as returned bysearch_otc_docs(with or without#anchor)section(string, optional): H2/H3 heading filter (case-insensitive substring)
Output: {url, title, sections: [{h2, h3, anchor, body}, ...], matched, ...}
Example Claude usage:
Configuration
Environment Variables
Control the server behavior with environment variables:
Example:
Observability: Metrics & Logs
This server is built with production-grade observability so you can debug issues and monitor performance.
Structured Logging (JSON)
Every action is logged as JSON, making logs machine-readable for aggregation and analysis.
Start the server with DEBUG logging:
You'll see JSON logs like:
Key fields in every log:
timestamp: When the event happened (ISO 8601)event: What happened (tool_invocation_start, upstream_request_success, etc.)request_id: Unique ID for this request (same across all related logs)- Custom fields depending on the event
Logs are printed to stderr, so redirect to a file or log aggregator:
Pipe to jq for pretty printing:
HTTP Endpoints (port 8080)
The uvicorn server exposes all endpoints on port 8080:
Health Checks:
Prometheus Metrics:
Returns Prometheus format metrics:
Available Metrics:
otc_pricing_mcp_requests_total{tool, status}: Count of tool invocationsotc_pricing_mcp_request_duration_seconds{tool}: Tool execution timeotc_pricing_mcp_upstream_requests_total{service, status}: Count of API callsotc_pricing_mcp_upstream_duration_seconds{service}: API call latency
Using Prometheus:
Add to your prometheus.yml:
Then query in Prometheus:
Debugging Guide
Problem: Slow API Calls
Check the logs:
Check metrics:
Problem: Tool Fails
Look for error logs:
Example error log:
Problem: OTC API Unreachable
Check readiness endpoint:
Check metrics:
Problem: Need Full Request Trace
Use request_id to trace a request:
This shows all logs for that request in order:
- tool_invocation_start
- upstream_request_start
- upstream_request_success (with items_returned)
- tool_invocation_success
Running Locally (Development)
Setup
Run in Development Mode
Running in Production (Docker)
Build Image
Run Container
Kubernetes Deployment
See deploy/kubernetes/ for the full manifest set (Deployment, Service, Ingress, NetworkPolicy, ServiceMonitor, PodDisruptionBudget).
When self-hosting on Kubernetes, connect remote clients to your ingress hostname:
Key features:
- Non-root user, read-only root filesystem
- Resource limits (100m–500m CPU, 128Mi–512Mi RAM)
- Liveness probe: GET /healthz on port 8080
- Readiness probe: GET /readyz on port 8080
- NetworkPolicy: ingress from nginx controller only, egress to DNS + OTC API
- ServiceMonitor for Prometheus scraping
- Managed by ArgoCD with
selfHeal: trueandprune: true
Architecture
Request Flow
Both transports share the same MCP Server instance and run concurrently in the same asyncio event loop.
Component Overview
Enhancement Ideas (Future Development)
Stories 0–9 are complete. The following are post-v1.0 enhancements:
Enhancement Ideas
Caching
- Cache pricing data for N seconds to reduce API load
- Redis or in-memory cache option
- Cache invalidation strategy
Advanced Querying
- More filtering options (e.g., price range, commitment period)
- Sorting by price, CPU, RAM
- Aggregations (min/max/avg pricing per service)
Cost Analysis Tools
- Historical pricing trends
- Cost anomaly detection
- Recommendation engine (right-sizing)
Multi-Cloud Support
- AWS pricing API integration
- Azure pricing API integration
- Cost comparison across clouds
User Preferences
- Save favorite services/regions
- Custom pricing alerts
- Budget tracking per project
Better Error Recovery
- Exponential backoff with jitter (vs fixed exponential)
- Circuit breaker pattern
- Fallback to cached data on API failure
Performance Optimizations
- Query result pagination
- Database caching layer
- Streaming responses for large datasets
Observability Enhancements
- Distributed tracing (OpenTelemetry)
- Custom business metrics (cost calculated, queries per service)
- Log aggregation integration (Loki, ELK)
- Alert rules (Prometheus Alertmanager)
Testing Improvements
- Load testing (k6, Locust)
- Chaos testing (failure scenarios)
- Contract testing with OTC API
API Stability
- API versioning (v1, v2)
- Deprecation policies
- Backward compatibility guarantees
Contributing
We welcome contributions! See CONTRIBUTING.md for:
- Development setup
- Code style (ruff, mypy --strict)
- Testing requirements (53+ tests with coverage)
- Security scanning (bandit, cyclonedx-bom)
- Commit message conventions
Quick PR Checklist:
- Tests pass:
uv run pytest tests/ - Linting passes:
uv run ruff check src/ - Type checking passes:
uv run mypy src/ --strict - Security scan passes:
uv run bandit -r src/ - Meaningful commit message
License
Apache License 2.0 — see LICENSE file.
Copyright: seaser0 ([email protected])
Getting Help
Questions or Issues?
- Check the Debugging Guide above
- Open a GitHub Issue: https://github.com/seaser0/otc-pricing-mcp/issues
- Check logs with:
LOG_LEVEL=DEBUG python -m otc_pricing_mcp 2>&1 | jq .
Want to Report a Security Issue? See SECURITY.md for responsible disclosure.
Project Status
Architecture Decisions
See docs/ directory for detailed documentation:
docs/ci-cd.md— CI/CD workflow detailsdocs/deployment.md— Deployment guidedocs/security.md— Security features and considerations
Built with ❤️ by seaser0
Last updated: 2026-05-07
来源:README.md,提交 8e8354a
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分