serbian-data-mcp

serbian-data-mcp

Enables searching and analyzing over 3,400 datasets from the Serbian government open data portal, with built-in charting and data transformation tools.

Category
访问服务器

README

Serbian Data MCP Server

MCP server for accessing Serbian open data portal (data.gov.rs) with built-in visualization capabilities.

Features

  • 🔍 Search 3,400+ datasets from Serbian government
  • 📊 Create 6 types of charts (line, bar, pie, scatter, histogram, box)
  • 📥 Download data in JSON, CSV, XML, XLSX formats
  • 🎨 Export visualizations as HTML/PNG/JSON
  • 🇷🇸 Full Serbian language support (UTF-8)
  • 🚀 Built-in rate limiting and caching
  • 📖 Comprehensive documentation with 24+ examples
  • 🛠️ Data transformation tools (filter, group, aggregate, sort, select)

🚀 Quick Start

Option 1: Automated Setup (Recommended)

# Run the interactive setup wizard
./setup.sh

This will automatically:

  • ✅ Check your Python installation
  • ✅ Create configuration with sensible defaults
  • ✅ Install all dependencies
  • ✅ Set up necessary directories
  • ✅ Test the installation

Option 2: Manual Setup

# Clone repository
git clone https://github.com/acailic/serbian-data-mcp
cd serbian-data-mcp

# Install with uv
uv sync

# Or with pip
pip install -e .

# Create configuration
cp config.example.json config.json

📖 Configuration

Interactive Configuration Wizard

python configure.py

The wizard guides you through:

  • API settings (URL, rate limiting, timeout)
  • Directory preferences (cache, exports)
  • Validation with helpful error messages
  • Automatic directory creation

Manual Configuration

Edit config.json (created from config.example.json):

{
  "api_base": "https://data.gov.rs",
  "rate_limit": 1.0,
  "timeout": 30,
  "cache_dir": ".cache",
  "export_dir": "exports"
}

🧪 Testing

Test API Connection

./test_connection.sh

This validates:

  • Connectivity to data.gov.rs
  • API response format
  • Available dataset count

Run Examples

python example_usage.py

Demonstrates:

  • Dataset search
  • Data retrieval
  • Visualization creation
  • Export functionality

📚 Documentation

📖 Complete Documentation Available in docs/

Additional Resources:

  • DEV_GUIDE.md - Comprehensive developer guide
  • Examples - Check example_usage.py for usage patterns
  • Error Handling - Helpful error messages for common issues

🚀 Usage

Claude Desktop Configuration

Add to Claude Desktop config:

{
  "mcpServers": {
    "serbian-data": {
      "command": "uv",
      "args": ["--directory", "/path/to/serbian-data-mcp", "run", "python", "-m", "serbian_data_mcp"]
    }
  }
}

Available Tools

  • search_datasets - Search datasets with filters
  • get_dataset - Get complete dataset details
  • get_resource_data - Download and parse resource data
  • create_visualization - Create charts from data
  • list_organizations - Browse data providers
  • suggest_datasets - Autocomplete for search

Examples

# Search datasets
datasets = await mcp.call_tool("search_datasets", {
    "query": "population",
    "format": "json",
    "page_size": 10
})

# Create visualization
chart = await mcp.call_tool("create_visualization", {
    "data": data,
    "chart_type": "line",
    "title": "Population Trends",
    "x_column": "year",
    "y_column": "population",
    "export_format": "html"
})

Development

Setup Development Environment

# Install dependencies
make install

# Or manually
uv sync --dev

Running Tests

# Run all tests with coverage
make test

# Quick tests (no coverage)
make test-quick

# Only unit tests
make test-unit

# Only integration tests
make test-integration

Code Quality Checks

# Run all quality checks (lint, format, type-check, security)
make check

# Quick checks (lint + format only)
make check-quick

# Individual checks
make lint      # Ruff linting
make format    # Format code with ruff
make type-check # Type checking with pyright
make security  # Security checks with bandit

Available Make Commands

make help      # Show all available commands
make install   # Install dependencies
make test      # Run tests with coverage
make check     # Run all quality checks
make clean     # Clean up generated files
make dev       # Setup development environment
make all       # Install, test, and check

Testing Infrastructure

The project includes comprehensive testing infrastructure:

  • Unit Tests: Individual component testing
  • Integration Tests: End-to-end workflow testing
  • Coverage Reports: HTML and terminal coverage output
  • Type Checking: 100% type coverage with pyright
  • Code Quality: Automated linting and formatting with ruff
  • Security Checks: Bandit security scanning

CI/CD Pipeline

GitHub Actions workflows automatically run:

  1. Test Suite (.github/workflows/test.yml)

    • Tests on Python 3.11, 3.12, 3.13
    • Coverage reporting to Codecov
  2. Code Quality (.github/workflows/code-quality.yml)

    • Type checking with pyright
    • Linting with ruff
    • Formatting checks
    • Security scanning with bandit

Project Structure

serbian-data-mcp/
├── src/serbian_data_mcp/
│   ├── api/              # API client and models
│   ├── data/             # Data parsing and transformation
│   ├── viz/              # Visualization tools
│   └── config.py         # Configuration management
├── tests/                # Comprehensive test suite
├── .github/workflows/    # CI/CD configuration
├── pyproject.toml        # Project configuration
└── Makefile              # Development commands

Quality Standards

  • Type Coverage: 100% (strict pyright checking)
  • Test Coverage: Comprehensive with coverage reporting
  • Code Style: Automated formatting with ruff (120 char line length)
  • Security: Automated security scanning
  • CI/CD: Automated testing on multiple Python versions

License

MIT License - see LICENSE file

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选