Skip to main content

MCP server for DeAlgo CSC — runtime decision firewall for AI agents. Drop into Claude Desktop, Claude Code, or Cursor and your agent must consult csc_check before acting.

Project description

DeAlgo MCP Server

Runtime decision firewall for AI agents. Exposes the CSC engine (via the dealgo-portal control layer) as a Model Context Protocol server so any MCP-aware client — Claude Desktop, Claude Code, Cursor, custom agents — can consult CSC before executing risky actions.

Claude / agent
      ↓
MCP tool: csc_check(...)
      ↓
dealgo-portal /api/csc/check  (Bearer dealgo_sk_live_…)
      ↓
CSC engine: reality · policy · throttle gates
      ↓
{ decision, action, reason, v2_bias, latency_ms }

Tools

csc_check(feed, risk?, volatility?, confidence?, symbol?, source?, intent?, v2_aware=True)

Primary tool. Score one signal/action against CSC. Returns

{ "decision": "APPROVE" | "DELAY" | "DENY",
  "action":   "EXECUTE" | "WAIT" | "REJECT",
  "reason":   "...",
  "v2_bias":  -0.018,
  "stimulus_id": "stim_…",
  "latency_ms": 41 }

Proceed only on APPROVE. On DELAY, retry with backoff. On DENY, do not retry — surface the reason to the user.

check_action(intent, action, actor_id, domain, environment, metadata)

Backwards-compat shim. Maps the legacy governance payload onto csc_check so existing demos and Claude Desktop configs keep working. Prefer csc_check directly in new code.

Resource

governance://decisions/recent — last 20 decisions logged for the configured API key. Lets agents introspect their own history.

Setup (recommended — published package)

  1. Install:

    pip install dealgo-mcp
    
  2. Get a sandbox key from your portal at https://api.dealgo.io/keys (or https://api.dealgo.io/quickstart for a one-click reveal). Use a dealgo_sk_test_… key for a no-meter sandbox, dealgo_sk_live_… for prod.

  3. Wire into Claude Desktop. Merge this into the config:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    {
      "mcpServers": {
        "dealgo-csc": {
          "command": "dealgo-mcp",
          "env": {
            "DEALGO_API_KEY": "dealgo_sk_test_…",
            "DEALGO_API_URL": "https://api.dealgo.io"
          }
        }
      }
    }
    
  4. Restart Claude Desktop. Then ask Claude:

    "Use csc_check before doing anything risky."

    Every risky action will now consult /v1/decide and surface the verdict.

Setup (local dev — from source)

git clone https://github.com/dealgo-systems/dealgo-mcp-server
cd dealgo-mcp-server
pip install -e .            # editable install — picks up changes immediately

Then point Claude Desktop config to the editable install ("command": "dealgo-mcp" still works after pip install -e . — entry point is registered system-wide).

Smoke test

DEALGO_API_KEY=dealgo_sk_test_... python smoke_test.py

Exercises all three CSC gates (reality, policy, throttle), the backwards-compat shim, and the recent-decisions resource. Pass = CSC governance is live over MCP.

Configuration

Env var Default Required
DEALGO_API_KEY (none) yes
DEALGO_API_URL https://api.dealgo.io no

Now Claude can call CSC before executing actions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dealgo_mcp-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dealgo_mcp-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file dealgo_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: dealgo_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dealgo_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 87d262985ae1051f4f1c6b18656f8c0a40793be01baaa8bf7fb41e99d8c13c2d
MD5 a47835f4bb8339fab5850a99efc3d5c5
BLAKE2b-256 f0cceb5de0b9cf73da19abc5a5307cbb628fbca8dfc4c5d8b9fda8f71be42b81

See more details on using hashes here.

Provenance

The following attestation bundles were made for dealgo_mcp-0.1.0.tar.gz:

Publisher: publish.yml on dealgo-systems/dealgo-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dealgo_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dealgo_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dealgo_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea2c7317607f44970de4e6b0c48ac87f2c827b5cf94da1898595d1628cf5b020
MD5 7363834007bd915c88a37c5a75c248da
BLAKE2b-256 fa8cfba6b74f9c2dc97267a09258bf7d5a472349ff712b0d2df777813a75e91f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dealgo_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dealgo-systems/dealgo-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page