# aviveldan/datagov-mcp architecture

> Architecture diagram of the GitHub repository aviveldan/datagov-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aviveldan/datagov-mcp
- Repository: https://github.com/aviveldan/datagov-mcp

## Overview

##### Project Type and Purpose
- This is a specialized, lightweight MCP (Model Context Protocol) server written in Python. Its primary purpose is to provide an interface for interacting with the Israeli Government Public API (data.gov.il) via a set of predefined tools.
- The README explains that the server exposes various commands (e.g., package_search, status_show, fetch_data_gov_il, etc.) and is designed to integrate with FastMCP tooling (via fastmcp install and fastmcp dev commands) and even applications like Claude Desktop.

##### File Structure
- Top-level files (like .gitignore, LICENSE, README.md, pyproject.toml) and configuration files (e.g., .python-version, uv.lock) indicate that this is a single-module Python project.
- The main executable is server.py. This is where the MCP server’s functionality and command dispatching mechanisms reside.
- The presence of pyproject.toml suggests that dependency management and project configuration are handled via a modern Python build tool.

##### Components
a. Main Application (DataGov Israel MCP Server):
- Represented by server.py, this acts as the core backend of the application.
- It likely contains a command dispatch mechanism that processes incoming MCP commands and directs them to the appropriate functionality.

b. MCP Tools / Commands Module:
- Although implemented within the main server file, each tool (like status_show, package_list, package_search, etc.) represents a logical module.
- You may want to show these as separate functional blocks (or grouped modules) within the main backend component to highlight individual responsibilities.

c. External Data Source:

d. Client and Integration Layer:
- Integration with FastMCP and Claude Desktop. This component indicates that the server is meant to be installed or run in an external client environment.

e. Configuration and Dependency Management:
- While not a runtime component, include a note or a small block for environment configuration (pyproject.toml, .python-version, uv.lock) as this illustrates how the application’s dependencies and runtime settings are managed.

##### Relationships and Interactions
- An inbound request flowing from the client (e.g., FastMCP) to the DataGov Server.
- The server’s internal command dispatcher selecting the correct tool/function based on the command (e.g., package_search or resource_search).
- Data interactions between the server and the external data.gov.il API.
- Optional response flow back to the client confirming status or delivering payload.

##### Key Architectural Patterns and Principles
- A facade pattern where server.py encapsulates and exposes various tools.
- Separation of concerns by distinguishing between the command handling (business logic), external API interactions, and client interface layers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A("Client (FastMCP/Claude Desktop)"):::client
    A -->|"request"| B("DataGov Israel MCP Server"):::server
    B -->|"dispatches_command"| C("Command Dispatcher"):::module
    B -->|"API_request"| D("External Data: data.gov.il API"):::external
    D -->|"API_response"| B
    B -->|"response"| A

    subgraph "Configuration & Dependency"
        E("pyproject.toml"):::config
        F(".python-version"):::config
        G("uv.lock"):::config
    end

    %% Click Events
    click B "https://github.com/aviveldan/datagov-mcp/blob/main/server.py"
    click C "https://github.com/aviveldan/datagov-mcp/blob/main/server.py"
    click E "https://github.com/aviveldan/datagov-mcp/blob/main/pyproject.toml"
    click F "https://github.com/aviveldan/datagov-mcp/blob/main/.python-version"
    click G "https://github.com/aviveldan/datagov-mcp/blob/main/uv.lock"

    %% Styles
    classDef client fill:#9fcae3,stroke:#333,stroke-width:2px;
    classDef server fill:#f7a072,stroke:#333,stroke-width:2px;
    classDef module fill:#c3aed6,stroke:#333,stroke-width:2px;
    classDef external fill:#ffeb99,stroke:#333,stroke-width:2px;
    classDef config fill:#c3f7c3,stroke:#333,stroke-width:2px;
```
