Metadata-Version: 2.4
Name: dcisionai-mcp-client
Version: 3.4.0
Summary: DcisionAI MCP Client — stdio↔HTTP proxy to the hosted DcisionAI optimization MCP.
Author-email: DcisionAI <support@dcisionai.com>
License: Proprietary
Project-URL: Homepage, https://platform.dcisionai.com
Project-URL: Source, https://github.com/DcisionAI/dcisionai-mcp-platform
Project-URL: Issues, https://github.com/DcisionAI/dcisionai-mcp-platform/issues
Keywords: mcp,model-context-protocol,dcisionai,optimization,claude,anthropic
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0

# dcisionai-mcp-client

Local stdio MCP server that forwards every JSON-RPC call to the
DcisionAI hosted streamable-HTTP MCP endpoint at
`https://platform.dcisionai.com/mcp` (or wherever `DCISIONAI_MCP_URL`
points).

## Why this exists

The DcisionAI optimization pipeline (Domain Agent → Consultant Agent →
solver → explanation, with the Solver Intelligence layer) runs as a
multi-service deployment on Railway. Some MCP hosts (older Claude
Desktop / Cursor builds, sandboxed environments) only accept stdio MCP
servers launched via `command` + `args`. This package is the official
stdio↔HTTP bridge for those hosts.

For newer MCP hosts that speak streamable-HTTP natively (Claude Desktop
≥1.0, Cursor ≥0.42, Claude Code ≥0.5), use the direct URL config
instead — there's no advantage to running this proxy.

## Install

```bash
# One-shot launch (recommended for MCP host configs)
uvx --from dcisionai-mcp-client@latest dcisionai-mcp-client

# Or pin a version
uvx --from dcisionai-mcp-client==3.4.0 dcisionai-mcp-client

# Or install globally
pipx install dcisionai-mcp-client
dcisionai-mcp-client
```

## MCP host configuration

### Claude Desktop / Cursor / Claude Code

Add to your `mcpServers` config:

```json
{
  "mcpServers": {
    "dcisionai-optimization": {
      "command": "uvx",
      "args": [
        "--from",
        "dcisionai-mcp-client@latest",
        "dcisionai-mcp-client"
      ],
      "env": {
        "DCISIONAI_MCP_URL": "https://platform.dcisionai.com/mcp"
      },
      "disabled": false,
      "autoApprove": [
        "preflight_optimization",
        "submit_optimization_job",
        "get_job_status",
        "get_job_result",
        "get_job_raw",
        "get_job_thinking",
        "get_hitl_questions",
        "respond_to_hitl",
        "run_optimization_headless"
      ]
    }
  }
}
```

`env.DCISIONAI_MCP_URL` is optional — omit to default to production.

### URL by environment

| Environment | URL |
|---|---|
| dev   | `https://dcisionai-platform-v3-testing.up.railway.app/mcp` |
| qa    | `https://dcisionai-platform-qa.up.railway.app/mcp`         |
| prod (default) | `https://platform.dcisionai.com/mcp`                |

## Environment variables

| Variable | Default | Purpose |
|---|---|---|
| `DCISIONAI_MCP_URL` | `https://platform.dcisionai.com/mcp` | Remote streamable-HTTP MCP endpoint |
| `DCISIONAI_MCP_TOKEN` | _(unset)_ | Optional Bearer token for the remote endpoint (reserved for future auth) |
| `DCISIONAI_MCP_TIMEOUT_S` | `60` | Per-request HTTP timeout in seconds |

## What it does NOT do

This proxy is a transport adapter, not a local solver. The optimization
work — Domain Agent, codegen, Pyomo/HiGHS solve, Solver Intelligence,
explanation generation — all runs on the hosted endpoint. No Anthropic /
Pinecone / Neo4j / Voyage / Supabase keys are needed locally. That's the
whole point.

If you need a self-contained server (the pipeline running entirely on
your machine, BYO credentials, no network dependency on DcisionAI
infrastructure), look at `dcisionai-mcp-server@3.3.0` (separate
heavyweight package). The two coexist; the `-client` package is the
recommended path for the vast majority of integrations.

## Tool surface

The 9 tools the remote endpoint exposes (you'll see these in your MCP
host's tool panel after a successful handshake):

| Tool | Use |
|---|---|
| `preflight_optimization` | Identify missing data before submitting |
| `submit_optimization_job` | Kick off an async solve |
| `get_job_status` | Poll progress |
| `get_job_result` | Fetch executive-summary formatted result |
| `get_job_raw` | Fetch complete unformatted JSON (for downstream tooling) |
| `get_job_thinking` | Fetch agent reasoning trace |
| `get_hitl_questions` | When status=needs_input, fetch missing-data questions |
| `respond_to_hitl` | Submit answers and resume a paused job |
| `run_optimization_headless` | Single-call: submit + KB auto-answer + solve + return result |

Tool surface is authoritative on the server (`mcp/public/server.py`);
the proxy doesn't filter or transform — whatever the remote advertises
is what your host sees.

## Architecture

```
┌─────────────────┐   stdio JSON-RPC   ┌─────────────────────────┐
│   MCP host      │ ◄────────────────► │   dcisionai-mcp-client  │
│ (Claude Desktop,│                    │   (this package)        │
│  Cursor, etc.)  │                    └────────────┬────────────┘
└─────────────────┘                                 │ HTTPS POST + SSE
                                                    │ /mcp
                                                    ▼
                                        ┌─────────────────────────┐
                                        │   DcisionAI platform    │
                                        │   (Railway / Cloud)     │
                                        │  Domain → Consultant →  │
                                        │   solver → explain      │
                                        └─────────────────────────┘
```

Each stdin line is a JSON-RPC message. The proxy POSTs it, captures
`Mcp-Session-Id` from the initialize response, forwards it on subsequent
requests, parses the SSE response body, writes the JSON-RPC payload to
stdout.

## License

Proprietary. © DcisionAI.
