dealithic-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dealithic_mcp-0.1.0/PKG-INFO +7 -0
- dealithic_mcp-0.1.0/README.md +36 -0
- dealithic_mcp-0.1.0/dealithic_mcp.egg-info/PKG-INFO +7 -0
- dealithic_mcp-0.1.0/dealithic_mcp.egg-info/SOURCES.txt +10 -0
- dealithic_mcp-0.1.0/dealithic_mcp.egg-info/dependency_links.txt +1 -0
- dealithic_mcp-0.1.0/dealithic_mcp.egg-info/entry_points.txt +2 -0
- dealithic_mcp-0.1.0/dealithic_mcp.egg-info/requires.txt +2 -0
- dealithic_mcp-0.1.0/dealithic_mcp.egg-info/top_level.txt +1 -0
- dealithic_mcp-0.1.0/mcp_server/__init__.py +0 -0
- dealithic_mcp-0.1.0/mcp_server/server.py +57 -0
- dealithic_mcp-0.1.0/pyproject.toml +16 -0
- dealithic_mcp-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# agentic-ai
|
|
2
|
+
|
|
3
|
+
Metered, agent-native API selling DEALITHIC's deal-analysis engines per query — REST + MCP,
|
|
4
|
+
API-key auth, Stripe usage-based billing. Founding plan: `AGENT_SERVICE_MARKETPLACE.md`.
|
|
5
|
+
Current state + open items: `STATUS.md`.
|
|
6
|
+
|
|
7
|
+
## Products
|
|
8
|
+
|
|
9
|
+
| Product | Endpoint | What it does |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `sec_extract` | `POST /v1/sec/extract` | SEC EDGAR → validated statements + derived metrics (EBITDA) |
|
|
12
|
+
| `validate_financials` | `POST /v1/financials/validate` | Validation pass over company financials |
|
|
13
|
+
| `deal_score` | `POST /v1/deals/score` | rNPV / stress / composite risk score for a deal profile |
|
|
14
|
+
|
|
15
|
+
All product endpoints require `X-Api-Key: agai_...`. Every successful call writes a
|
|
16
|
+
`usage_events` row and reports one metered unit to Stripe.
|
|
17
|
+
|
|
18
|
+
## Layout
|
|
19
|
+
|
|
20
|
+
- `service/` — FastAPI app: `auth.py` (hashed API keys in Supabase), `metering.py`
|
|
21
|
+
(usage + Stripe), `engines.py` (thin adapters into the transaction_intelligence repo —
|
|
22
|
+
the only file that knows DEALITHIC internals), `main.py` (routes).
|
|
23
|
+
- `mcp_server/` — stdio MCP server; tools proxy to the hosted REST API so billing stays
|
|
24
|
+
server-side.
|
|
25
|
+
- `supabase/schema.sql` — `api_keys` + `usage_events`.
|
|
26
|
+
|
|
27
|
+
## Run locally
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python -m venv .venv && source .venv/bin/activate
|
|
31
|
+
pip install -r requirements.txt
|
|
32
|
+
cp .env.example .env # fill in
|
|
33
|
+
uvicorn service.main:app --reload
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Mint a key: `POST /admin/keys` with `X-Admin-Token` + `{"customer_email": "..."}`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
dealithic_mcp.egg-info/PKG-INFO
|
|
4
|
+
dealithic_mcp.egg-info/SOURCES.txt
|
|
5
|
+
dealithic_mcp.egg-info/dependency_links.txt
|
|
6
|
+
dealithic_mcp.egg-info/entry_points.txt
|
|
7
|
+
dealithic_mcp.egg-info/requires.txt
|
|
8
|
+
dealithic_mcp.egg-info/top_level.txt
|
|
9
|
+
mcp_server/__init__.py
|
|
10
|
+
mcp_server/server.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mcp_server
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""MCP server exposing the agentic-ai products as tools.
|
|
2
|
+
|
|
3
|
+
Runs over stdio; each tool call hits the hosted REST API with the user's key,
|
|
4
|
+
so metering/billing stay server-side. One config line for any MCP client:
|
|
5
|
+
|
|
6
|
+
{"mcpServers": {"agentic-ai": {
|
|
7
|
+
"command": "python", "args": ["-m", "mcp_server.server"],
|
|
8
|
+
"env": {"AGENTIC_AI_API_KEY": "agai_...", "AGENTIC_AI_BASE_URL": "https://..."}}}}
|
|
9
|
+
"""
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
import httpx
|
|
13
|
+
from mcp.server.fastmcp import FastMCP
|
|
14
|
+
|
|
15
|
+
BASE_URL = os.environ.get("AGENTIC_AI_BASE_URL", "http://localhost:8000")
|
|
16
|
+
API_KEY = os.environ.get("AGENTIC_AI_API_KEY", "")
|
|
17
|
+
|
|
18
|
+
mcp = FastMCP("agentic-ai")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _post(path: str, payload: dict) -> dict:
|
|
22
|
+
r = httpx.post(
|
|
23
|
+
f"{BASE_URL}{path}",
|
|
24
|
+
json=payload,
|
|
25
|
+
headers={"X-Api-Key": API_KEY},
|
|
26
|
+
timeout=120,
|
|
27
|
+
)
|
|
28
|
+
r.raise_for_status()
|
|
29
|
+
return r.json()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@mcp.tool()
|
|
33
|
+
def sec_extract(ticker: str) -> dict:
|
|
34
|
+
"""Extract validated financial statements and derived metrics (incl. EBITDA)
|
|
35
|
+
from SEC EDGAR filings for a US-listed ticker."""
|
|
36
|
+
return _post("/v1/sec/extract", {"ticker": ticker})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@mcp.tool()
|
|
40
|
+
def validate_financials(financials: dict) -> dict:
|
|
41
|
+
"""Run DEALITHIC's validation pass over a set of company financials
|
|
42
|
+
(statement consistency, derived-metric sanity checks)."""
|
|
43
|
+
return _post("/v1/financials/validate", {"financials": financials})
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@mcp.tool()
|
|
47
|
+
def deal_score(deal: dict) -> dict:
|
|
48
|
+
"""Risk-score a deal profile: rNPV, stress scenarios, composite deal score."""
|
|
49
|
+
return _post("/v1/deals/score", {"deal": deal})
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def main():
|
|
53
|
+
mcp.run()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
main()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "dealithic-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server for the agentic-ai deal-intelligence API: SEC extraction, financial validation, deal scoring"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
dependencies = ["mcp>=1.0", "httpx>=0.27"]
|
|
11
|
+
|
|
12
|
+
[project.scripts]
|
|
13
|
+
dealithic-mcp = "mcp_server.server:main"
|
|
14
|
+
|
|
15
|
+
[tool.setuptools]
|
|
16
|
+
packages = ["mcp_server"]
|