Metadata-Version: 2.4
Name: geodms-mcp
Version: 20.30.0
Summary: An MCP server that gives AI agents GeoDMS as typed tools: load a configuration, list its tree, compute an item, explain a value
License-Expression: GPL-3.0-or-later
License-File: license.txt
Requires-Python: >=3.10
Requires-Dist: mcp>=2.3,<3
Project-URL: Homepage, https://www.geodms.nl
Project-URL: Documentation, https://github.com/ObjectVision/GeoDMS/wiki/GeoDMS-MCP-server
Project-URL: Source, https://github.com/ObjectVision/GeoDMS
Project-URL: Issues, https://github.com/ObjectVision/GeoDMS/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Scientific/Engineering :: GIS
Description-Content-Type: text/markdown

# geodms-mcp: GeoDMS as tools for an AI agent

geodms-mcp is an [MCP](https://modelcontextprotocol.io) server that lets an AI agent, such as
Claude Code or Claude Desktop, work with GeoDMS configurations without a shell. The agent can
load a configuration (`.dms`), list its tree, read what an item is, compute an item and get its
statistics, and ask how one value came about. The server talks to its client over stdio.

The server holds no engine of its own. Each tool call starts one `GeoDmsRun` of an installed
GeoDMS, which loads the configuration again, and returns what that run reported. Every such run

- runs in the restricted mode of GeoDMS: it runs no command line, so `exec_ec` fails, and it
  writes only in a LocalData folder of its own and in the export folder that the server was
  started with, also when the write is the storage of an item that the requested item depends on;
- gets a LocalData folder of its own, made for the call and removed after it;
- is held to a memory limit (8 GB of commit on Windows, of resident memory on Linux) and a
  wall-clock limit (300 s). A call that reaches one returns `LIMIT(commit)`, `LIMIT(memory)` or
  `LIMIT(time)` instead of a result.

Only configurations under the folders named with `--config-root` can be loaded.

## Tools

| Tool | What it returns |
|---|---|
| `version` | the GeoDMS version that the server runs, its folders and its limits |
| `load_config` | the errors and warnings of loading a configuration |
| `list_items` | per item below a given item: path, kind, value type, domain unit, values unit, expression and failure reason |
| `item_info` | the same for one item, with the description of the storages and items its value comes from |
| `compute` | the statistics of a calculated item: count, minimum, maximum, sum, average, nulls and the like |
| `explain_value` | the Value Info page of one value: its expression and the values it came from |

## Installing

The wheel needs a GeoDMS of the same version, installed by its setup, and Python 3.10 or later:

    pip install geodms_mcp-20.30.0-py3-none-any.whl

pip installs the MCP Python SDK (`mcp`) from PyPI with it. The server finds `GeoDmsRun` on `PATH`,
or else in the installation folder of the GeoDMS of its own version; `--geodmsrun` names another.

## Starting it from a client

In Claude Code:

    claude mcp add geodms -- geodms-mcp --config-root C:/prj/mymodel --export-dir C:/LocalData/mymodel_export

In the configuration file of Claude Desktop:

    "mcpServers": {
      "geodms": {
        "command": "geodms-mcp",
        "args": ["--config-root", "C:/prj/mymodel", "--export-dir", "C:/LocalData/mymodel_export"]
      }
    }

Options: `--config-root FOLDER` (required, may be given more than once), `--export-dir FOLDER`,
`--geodmsrun EXE`, `--work-dir FOLDER` (where the folder of each call is made), `--max-commit-gb N`
and `--timeout-sec N` (0 switches a limit off), `--keep-work` (keep the folder of each call, with
the log of its run).

The documentation is on the wiki: https://github.com/ObjectVision/GeoDMS/wiki/GeoDMS-MCP-server
