Skip to main content

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.

Metadata

Release files for dealgo-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dealgo-mcp 0.2.0
File Size Uploaded Provenance
dealgo_mcp-0.2.0.tar.gz 13.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dealgo-mcp 0.2.0
File Interpreter ABI Platform
dealgo_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.7 kB

Release files / dealgo_mcp-0.2.0.tar.gz

Download URL dealgo_mcp-0.2.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6ea17bc66586bda255025767349c2b2227a9169d1a5e295f66adc086c8c1c470
BLAKE2b-256 checksum
How to use checksums
552f888f069c5d88a149fe997cf23a717bfbc305c7e2772cc9a553d61fac51e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 1, 2026.

Transparency log

Release files / dealgo_mcp-0.2.0-py3-none-any.whl

Download URL dealgo_mcp-0.2.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be3e7d87a1d5ae86529da8177f2238fd0f1fb6664661dd6acdeaa20425cab9c9
BLAKE2b-256 checksum
How to use checksums
c5619ec69cecaeb4e8de11546c60a10df38655afd51e38226082dfec98f5fa0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 1, 2026.

Transparency log

Security for dealgo-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dealgo_mcp-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page