Skip to main content
Glama
README.md
# Drex MCP

Drex MCP exposes Nace.AI Drex as a bounded closed-decision tool for MCP-compatible agents. The agent supplies a question, explicit choices, and optional evidence/context; Drex returns a selected choice and probabilities. The agent remains responsible for deciding whether and how to act.

The server is a thin stdio MCP adapter to the public Drex API. It does not provide general conversation, execute the selected action, or contain a separate decision engine.

## Requirements

- Python 3.10+
- A Nace.AI Drex API key
- An MCP client (Hermes Agent is supported through its documented stdio MCP configuration)

## Install and configure

```sh
git clone https://github.com/colt2822/Drex-MCP.git
cd Drex-MCP
python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[test]'
export DREX_API_KEY='your_api_key_here'
```

The server reads `DREX_API_KEY` from its process environment. It makes an HTTPS request to the fixed public Drex endpoint with a 30 second request timeout and 5 second connect timeout. It does not print provider responses, credentials, or exception text.

## Tool

`drex_decide(question, choices, evidence="")`

- `question`: non-empty string, up to 2,000 characters
- `choices`: 2–12 non-empty string labels, each up to 200 characters
- `evidence`: optional string, up to 6,000 characters

The input becomes Drex's supported `state` and `questions.decision` choice schema. No unsupported API metadata is sent.

Success result:

```json
{
  "ok": true,
  "result": {
    "choices": {"retry_1": "Retry", "escalate_2": "Escalate", "stop_3": "Stop"},
    "choice": "retry_1",
    "probabilities": {"retry_1": 0.8, "escalate_2": 0.15, "stop_3": 0.05},
    "confidence": 0.8,
    "latency_ms": 123.45
  }
}
```

Errors use `{"ok": false, "error": {"code": "...", "message": "..."}}`; an upstream HTTP status is included when available. API response bodies and secrets are not included.

## Hermes Agent

Hermes reads MCP servers from `~/.hermes/config.yaml`. Install this package in the environment available to Hermes and merge [examples/hermes/config.yaml](examples/hermes/config.yaml) into that file. Set `DREX_API_KEY` in the MCP server `env` mapping, then restart Hermes. See [the Hermes-specific usage example](examples/hermes/README.md).

## Development and tests

```sh
python -m pip install -e '.[test]'
pytest
```

The standalone tests stub the network and do not make paid Drex calls. Separately, one direct MCP canary and one Hermes Agent canary each made a single live Drex API request during release validation.

## Compatibility

The API request and response validation follows the public `drex-latest` `/v1/systemone` choice schema used by Drex OpenWebUI Bridge v0.1.0. Python 3.10+ and MCP Python SDK 1.x are targeted. Hermes Agent v0.20.4 was verified with the example configuration for stdio connection, tool discovery, and one live tool call to Drex.

## License

MIT. See [LICENSE](LICENSE).

Unofficial community integration for Nace.AI Drex and Hermes Agent. This project is not an official Nace.AI or Hermes project unless explicitly endorsed.

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is zero possibility of confusion or overlap. The single tool's purpose is clearly stated and cannot be mistaken for any other tool.

Naming Consistency4/5

The name 'drex_decide' follows a clear server-prefix + verb convention and is readable and predictable. With only one tool there is no pattern to compare against, but the naming itself is sound and consistent with the server identity.

Tool Count3/5

A single tool feels thin, but the server's stated scope — returning a closed decision with a probability distribution — is narrow enough that one tool can plausibly fulfill it. Borderline, but not egregiously under-scoped.

Completeness4/5

The core decision-making operation is covered, and the description clearly demarcates that acting on the decision is the caller's responsibility. Minor gaps exist (e.g., no way to configure Drex's behavior or provide structured context), but the primary workflow is functional.

Maintenance

ActivityMaintained
ResponsivenessNo issues