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.2.0.tar.gz (13.3 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.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dealgo_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 13.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 6ea17bc66586bda255025767349c2b2227a9169d1a5e295f66adc086c8c1c470
MD5 938d2493d72a2cd45793f4fa73696f6b
BLAKE2b-256 552f888f069c5d88a149fe997cf23a717bfbc305c7e2772cc9a553d61fac51e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dealgo_mcp-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: dealgo_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be3e7d87a1d5ae86529da8177f2238fd0f1fb6664661dd6acdeaa20425cab9c9
MD5 f529f0001f0444d6cf66fcb55041a1c4
BLAKE2b-256 c5619ec69cecaeb4e8de11546c60a10df38655afd51e38226082dfec98f5fa0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dealgo_mcp-0.2.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