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)
-
Install:
pip install dealgo-mcp
-
Get a sandbox key from your portal at https://api.dealgo.io/keys (or
https://api.dealgo.io/quickstartfor a one-click reveal). Use adealgo_sk_test_…key for a no-meter sandbox,dealgo_sk_live_…for prod. -
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" } } } }
- macOS:
-
Restart Claude Desktop. Then ask Claude:
"Use
csc_checkbefore doing anything risky."Every risky action will now consult
/v1/decideand 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87d262985ae1051f4f1c6b18656f8c0a40793be01baaa8bf7fb41e99d8c13c2d
|
|
| MD5 |
a47835f4bb8339fab5850a99efc3d5c5
|
|
| BLAKE2b-256 |
f0cceb5de0b9cf73da19abc5a5307cbb628fbca8dfc4c5d8b9fda8f71be42b81
|
Provenance
The following attestation bundles were made for dealgo_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on dealgo-systems/dealgo-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dealgo_mcp-0.1.0.tar.gz -
Subject digest:
87d262985ae1051f4f1c6b18656f8c0a40793be01baaa8bf7fb41e99d8c13c2d - Sigstore transparency entry: 1409404313
- Sigstore integration time:
-
Permalink:
dealgo-systems/dealgo-mcp-server@06321b4926fc4790e487ee4192fb9b17eb73ddc9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dealgo-systems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@06321b4926fc4790e487ee4192fb9b17eb73ddc9 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea2c7317607f44970de4e6b0c48ac87f2c827b5cf94da1898595d1628cf5b020
|
|
| MD5 |
7363834007bd915c88a37c5a75c248da
|
|
| BLAKE2b-256 |
fa8cfba6b74f9c2dc97267a09258bf7d5a472349ff712b0d2df777813a75e91f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dealgo_mcp-0.1.0-py3-none-any.whl -
Subject digest:
ea2c7317607f44970de4e6b0c48ac87f2c827b5cf94da1898595d1628cf5b020 - Sigstore transparency entry: 1409404334
- Sigstore integration time:
-
Permalink:
dealgo-systems/dealgo-mcp-server@06321b4926fc4790e487ee4192fb9b17eb73ddc9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dealgo-systems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@06321b4926fc4790e487ee4192fb9b17eb73ddc9 -
Trigger Event:
push
-
Statement type: