computeid-mcp 1.0.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.
- computeid_mcp-1.0.0/PKG-INFO +89 -0
- computeid_mcp-1.0.0/README.md +60 -0
- computeid_mcp-1.0.0/computeid_mcp.egg-info/PKG-INFO +89 -0
- computeid_mcp-1.0.0/computeid_mcp.egg-info/SOURCES.txt +9 -0
- computeid_mcp-1.0.0/computeid_mcp.egg-info/dependency_links.txt +1 -0
- computeid_mcp-1.0.0/computeid_mcp.egg-info/entry_points.txt +2 -0
- computeid_mcp-1.0.0/computeid_mcp.egg-info/requires.txt +2 -0
- computeid_mcp-1.0.0/computeid_mcp.egg-info/top_level.txt +1 -0
- computeid_mcp-1.0.0/server.py +838 -0
- computeid_mcp-1.0.0/setup.cfg +4 -0
- computeid_mcp-1.0.0/setup.py +32 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: computeid-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: ComputeID MCP Server — cryptographic identity for AI agents via Model Context Protocol
|
|
5
|
+
Home-page: https://github.com/trustedaicompute-ops/computeid-mcp
|
|
6
|
+
Author: ComputeID
|
|
7
|
+
Author-email: hello@compute-id.com
|
|
8
|
+
Keywords: mcp model-context-protocol ai agents identity security computeid quantum-safe
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: mcp>=1.0.0
|
|
18
|
+
Requires-Dist: httpx>=0.24.0
|
|
19
|
+
Dynamic: author
|
|
20
|
+
Dynamic: author-email
|
|
21
|
+
Dynamic: classifier
|
|
22
|
+
Dynamic: description
|
|
23
|
+
Dynamic: description-content-type
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: keywords
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
Dynamic: summary
|
|
29
|
+
|
|
30
|
+
# ComputeID MCP Server
|
|
31
|
+
|
|
32
|
+
Give Claude and any MCP-compatible AI the ability to issue cryptographic identities to AI agents natively.
|
|
33
|
+
|
|
34
|
+
## What it does
|
|
35
|
+
|
|
36
|
+
Once installed, Claude can:
|
|
37
|
+
- **Issue AgentPassports** to any AI agent it spawns or works with
|
|
38
|
+
- **Verify agent identity** before accepting work from another agent
|
|
39
|
+
- **Log every action** to an immutable audit trail automatically
|
|
40
|
+
- **Revoke agents instantly** if they behave unexpectedly
|
|
41
|
+
- **Register GPU hardware** with cryptographic DevicePassports
|
|
42
|
+
- **Generate compliance reports** for EU AI Act, SOC2, NIST AI RMF
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
pip install computeid-mcp
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configure Claude Desktop
|
|
51
|
+
|
|
52
|
+
Add to your `claude_desktop_config.json`:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"computeid": {
|
|
58
|
+
"command": "python",
|
|
59
|
+
"args": ["-m", "computeid_mcp"],
|
|
60
|
+
"env": {
|
|
61
|
+
"COMPUTEID_API_URL": "https://api.aicomputeid.com",
|
|
62
|
+
"COMPUTEID_TOKEN": "your-token-here"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Tools available
|
|
70
|
+
|
|
71
|
+
| Tool | Description |
|
|
72
|
+
|------|-------------|
|
|
73
|
+
| `computeid_status` | Check API health |
|
|
74
|
+
| `issue_agent_passport` | Issue a cryptographic identity to an AI agent |
|
|
75
|
+
| `verify_agent_passport` | Verify an agent's identity |
|
|
76
|
+
| `log_agent_action` | Log an action to the immutable audit trail |
|
|
77
|
+
| `revoke_agent_passport` | Instantly revoke an agent |
|
|
78
|
+
| `list_agent_passports` | List all agents in your organisation |
|
|
79
|
+
| `get_agent_audit_log` | Get full audit trail for an agent |
|
|
80
|
+
| `register_device` | Register a GPU or server |
|
|
81
|
+
| `list_devices` | List all devices |
|
|
82
|
+
| `approve_device` | Approve a pending device |
|
|
83
|
+
| `revoke_device` | Revoke a device |
|
|
84
|
+
| `generate_compliance_report` | EU AI Act, SOC2, NIST AI RMF reports |
|
|
85
|
+
| `get_audit_logs` | Organisation-wide audit logs |
|
|
86
|
+
|
|
87
|
+
## Docs
|
|
88
|
+
|
|
89
|
+
compute-id.com | hello@compute-id.com
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# ComputeID MCP Server
|
|
2
|
+
|
|
3
|
+
Give Claude and any MCP-compatible AI the ability to issue cryptographic identities to AI agents natively.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Once installed, Claude can:
|
|
8
|
+
- **Issue AgentPassports** to any AI agent it spawns or works with
|
|
9
|
+
- **Verify agent identity** before accepting work from another agent
|
|
10
|
+
- **Log every action** to an immutable audit trail automatically
|
|
11
|
+
- **Revoke agents instantly** if they behave unexpectedly
|
|
12
|
+
- **Register GPU hardware** with cryptographic DevicePassports
|
|
13
|
+
- **Generate compliance reports** for EU AI Act, SOC2, NIST AI RMF
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
pip install computeid-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configure Claude Desktop
|
|
22
|
+
|
|
23
|
+
Add to your `claude_desktop_config.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"computeid": {
|
|
29
|
+
"command": "python",
|
|
30
|
+
"args": ["-m", "computeid_mcp"],
|
|
31
|
+
"env": {
|
|
32
|
+
"COMPUTEID_API_URL": "https://api.aicomputeid.com",
|
|
33
|
+
"COMPUTEID_TOKEN": "your-token-here"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Tools available
|
|
41
|
+
|
|
42
|
+
| Tool | Description |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| `computeid_status` | Check API health |
|
|
45
|
+
| `issue_agent_passport` | Issue a cryptographic identity to an AI agent |
|
|
46
|
+
| `verify_agent_passport` | Verify an agent's identity |
|
|
47
|
+
| `log_agent_action` | Log an action to the immutable audit trail |
|
|
48
|
+
| `revoke_agent_passport` | Instantly revoke an agent |
|
|
49
|
+
| `list_agent_passports` | List all agents in your organisation |
|
|
50
|
+
| `get_agent_audit_log` | Get full audit trail for an agent |
|
|
51
|
+
| `register_device` | Register a GPU or server |
|
|
52
|
+
| `list_devices` | List all devices |
|
|
53
|
+
| `approve_device` | Approve a pending device |
|
|
54
|
+
| `revoke_device` | Revoke a device |
|
|
55
|
+
| `generate_compliance_report` | EU AI Act, SOC2, NIST AI RMF reports |
|
|
56
|
+
| `get_audit_logs` | Organisation-wide audit logs |
|
|
57
|
+
|
|
58
|
+
## Docs
|
|
59
|
+
|
|
60
|
+
compute-id.com | hello@compute-id.com
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: computeid-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: ComputeID MCP Server — cryptographic identity for AI agents via Model Context Protocol
|
|
5
|
+
Home-page: https://github.com/trustedaicompute-ops/computeid-mcp
|
|
6
|
+
Author: ComputeID
|
|
7
|
+
Author-email: hello@compute-id.com
|
|
8
|
+
Keywords: mcp model-context-protocol ai agents identity security computeid quantum-safe
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: mcp>=1.0.0
|
|
18
|
+
Requires-Dist: httpx>=0.24.0
|
|
19
|
+
Dynamic: author
|
|
20
|
+
Dynamic: author-email
|
|
21
|
+
Dynamic: classifier
|
|
22
|
+
Dynamic: description
|
|
23
|
+
Dynamic: description-content-type
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: keywords
|
|
26
|
+
Dynamic: requires-dist
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
Dynamic: summary
|
|
29
|
+
|
|
30
|
+
# ComputeID MCP Server
|
|
31
|
+
|
|
32
|
+
Give Claude and any MCP-compatible AI the ability to issue cryptographic identities to AI agents natively.
|
|
33
|
+
|
|
34
|
+
## What it does
|
|
35
|
+
|
|
36
|
+
Once installed, Claude can:
|
|
37
|
+
- **Issue AgentPassports** to any AI agent it spawns or works with
|
|
38
|
+
- **Verify agent identity** before accepting work from another agent
|
|
39
|
+
- **Log every action** to an immutable audit trail automatically
|
|
40
|
+
- **Revoke agents instantly** if they behave unexpectedly
|
|
41
|
+
- **Register GPU hardware** with cryptographic DevicePassports
|
|
42
|
+
- **Generate compliance reports** for EU AI Act, SOC2, NIST AI RMF
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
pip install computeid-mcp
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configure Claude Desktop
|
|
51
|
+
|
|
52
|
+
Add to your `claude_desktop_config.json`:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"computeid": {
|
|
58
|
+
"command": "python",
|
|
59
|
+
"args": ["-m", "computeid_mcp"],
|
|
60
|
+
"env": {
|
|
61
|
+
"COMPUTEID_API_URL": "https://api.aicomputeid.com",
|
|
62
|
+
"COMPUTEID_TOKEN": "your-token-here"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Tools available
|
|
70
|
+
|
|
71
|
+
| Tool | Description |
|
|
72
|
+
|------|-------------|
|
|
73
|
+
| `computeid_status` | Check API health |
|
|
74
|
+
| `issue_agent_passport` | Issue a cryptographic identity to an AI agent |
|
|
75
|
+
| `verify_agent_passport` | Verify an agent's identity |
|
|
76
|
+
| `log_agent_action` | Log an action to the immutable audit trail |
|
|
77
|
+
| `revoke_agent_passport` | Instantly revoke an agent |
|
|
78
|
+
| `list_agent_passports` | List all agents in your organisation |
|
|
79
|
+
| `get_agent_audit_log` | Get full audit trail for an agent |
|
|
80
|
+
| `register_device` | Register a GPU or server |
|
|
81
|
+
| `list_devices` | List all devices |
|
|
82
|
+
| `approve_device` | Approve a pending device |
|
|
83
|
+
| `revoke_device` | Revoke a device |
|
|
84
|
+
| `generate_compliance_report` | EU AI Act, SOC2, NIST AI RMF reports |
|
|
85
|
+
| `get_audit_logs` | Organisation-wide audit logs |
|
|
86
|
+
|
|
87
|
+
## Docs
|
|
88
|
+
|
|
89
|
+
compute-id.com | hello@compute-id.com
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
server.py
|
|
3
|
+
setup.py
|
|
4
|
+
computeid_mcp.egg-info/PKG-INFO
|
|
5
|
+
computeid_mcp.egg-info/SOURCES.txt
|
|
6
|
+
computeid_mcp.egg-info/dependency_links.txt
|
|
7
|
+
computeid_mcp.egg-info/entry_points.txt
|
|
8
|
+
computeid_mcp.egg-info/requires.txt
|
|
9
|
+
computeid_mcp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
server
|
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
ComputeID MCP Server
|
|
4
|
+
Lets Claude and any MCP-compatible AI issue AgentPassports,
|
|
5
|
+
manage DevicePassports, and verify identities natively.
|
|
6
|
+
|
|
7
|
+
Install: pip install computeid-mcp
|
|
8
|
+
Usage in Claude Desktop: add to claude_desktop_config.json
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import asyncio
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
import httpx
|
|
16
|
+
from datetime import datetime
|
|
17
|
+
from mcp.server import Server
|
|
18
|
+
from mcp.server.stdio import stdio_server
|
|
19
|
+
from mcp import types
|
|
20
|
+
|
|
21
|
+
# ── CONFIG ────────────────────────────────────────────────────────────────────
|
|
22
|
+
API_URL = os.getenv("COMPUTEID_API_URL", "https://api.aicomputeid.com")
|
|
23
|
+
API_TOKEN = os.getenv("COMPUTEID_TOKEN", "")
|
|
24
|
+
|
|
25
|
+
server = Server("computeid")
|
|
26
|
+
|
|
27
|
+
# ── HELPERS ───────────────────────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
def get_headers():
|
|
30
|
+
h = {"Content-Type": "application/json"}
|
|
31
|
+
if API_TOKEN:
|
|
32
|
+
h["Authorization"] = f"Bearer {API_TOKEN}"
|
|
33
|
+
return h
|
|
34
|
+
|
|
35
|
+
async def api_get(path: str) -> dict:
|
|
36
|
+
async with httpx.AsyncClient(timeout=15) as client:
|
|
37
|
+
r = await client.get(f"{API_URL}{path}", headers=get_headers())
|
|
38
|
+
return r.json()
|
|
39
|
+
|
|
40
|
+
async def api_post(path: str, data: dict) -> dict:
|
|
41
|
+
async with httpx.AsyncClient(timeout=15) as client:
|
|
42
|
+
r = await client.post(f"{API_URL}{path}", json=data, headers=get_headers())
|
|
43
|
+
return r.json()
|
|
44
|
+
|
|
45
|
+
async def api_patch(path: str) -> dict:
|
|
46
|
+
async with httpx.AsyncClient(timeout=15) as client:
|
|
47
|
+
r = await client.patch(f"{API_URL}{path}", headers=get_headers())
|
|
48
|
+
return r.json()
|
|
49
|
+
|
|
50
|
+
def fmt_result(data: dict, success_msg: str = "") -> str:
|
|
51
|
+
if "error" in data:
|
|
52
|
+
return f"Error: {data['error']}"
|
|
53
|
+
if success_msg:
|
|
54
|
+
return f"{success_msg}\n\n{json.dumps(data, indent=2, default=str)}"
|
|
55
|
+
return json.dumps(data, indent=2, default=str)
|
|
56
|
+
|
|
57
|
+
# ── TOOLS ─────────────────────────────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
@server.list_tools()
|
|
60
|
+
async def list_tools() -> list[types.Tool]:
|
|
61
|
+
return [
|
|
62
|
+
|
|
63
|
+
# ── STATUS ──────────────────────────────────────────────────────────
|
|
64
|
+
types.Tool(
|
|
65
|
+
name="computeid_status",
|
|
66
|
+
description="Check ComputeID API health and connection status. Use this first to verify the connection is working.",
|
|
67
|
+
inputSchema={
|
|
68
|
+
"type": "object",
|
|
69
|
+
"properties": {},
|
|
70
|
+
"required": []
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
|
|
74
|
+
# ── AGENT PASSPORT ───────────────────────────────────────────────────
|
|
75
|
+
types.Tool(
|
|
76
|
+
name="issue_agent_passport",
|
|
77
|
+
description="""Issue a cryptographic AgentPassport to an AI agent.
|
|
78
|
+
|
|
79
|
+
An AgentPassport gives an agent:
|
|
80
|
+
- A verified cryptographic identity
|
|
81
|
+
- An immutable capability certificate defining what it can and cannot do
|
|
82
|
+
- An audit trail that logs every action
|
|
83
|
+
- An instant kill switch via revocation
|
|
84
|
+
|
|
85
|
+
Use this whenever you spawn, create, or deploy an AI agent that will act autonomously.
|
|
86
|
+
This is the most important tool — every agent should have a passport before it acts.""",
|
|
87
|
+
inputSchema={
|
|
88
|
+
"type": "object",
|
|
89
|
+
"properties": {
|
|
90
|
+
"agent_name": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Name of the AI agent e.g. 'ResearchAgent', 'EmailAgent', 'CodeReviewAgent'"
|
|
93
|
+
},
|
|
94
|
+
"owner_org": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Organisation or company that owns this agent e.g. 'Acme Corp'"
|
|
97
|
+
},
|
|
98
|
+
"owner_email": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Email of the agent owner e.g. 'admin@acme.com'"
|
|
101
|
+
},
|
|
102
|
+
"trust_level": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"enum": ["restricted", "standard", "elevated", "autonomous"],
|
|
105
|
+
"description": "Trust level: restricted=read-only, standard=web+APIs, elevated=code execution, autonomous=full capabilities"
|
|
106
|
+
},
|
|
107
|
+
"model": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "AI model powering the agent e.g. 'claude-sonnet-4-5', 'gpt-4', 'gemini-pro'"
|
|
110
|
+
},
|
|
111
|
+
"purpose": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"description": "What this agent is designed to do e.g. 'Research and summarise news articles'"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"required": ["agent_name", "owner_org"]
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
|
|
120
|
+
types.Tool(
|
|
121
|
+
name="verify_agent_passport",
|
|
122
|
+
description="Verify whether an AI agent is trusted and its passport is valid. Use before accepting work from or delegating to another agent.",
|
|
123
|
+
inputSchema={
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"agent_id": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"description": "The agent ID or passport fingerprint to verify"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"required": ["agent_id"]
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
|
|
135
|
+
types.Tool(
|
|
136
|
+
name="log_agent_action",
|
|
137
|
+
description="Log an action taken by an AI agent to its immutable audit trail. Call this after every significant action an agent takes.",
|
|
138
|
+
inputSchema={
|
|
139
|
+
"type": "object",
|
|
140
|
+
"properties": {
|
|
141
|
+
"agent_id": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "The agent ID whose action to log"
|
|
144
|
+
},
|
|
145
|
+
"action": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"description": "The action taken e.g. 'web_search', 'file_read', 'api_call', 'email_sent', 'code_executed'"
|
|
148
|
+
},
|
|
149
|
+
"details": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"description": "Additional details about the action e.g. {query: 'market data', url: 'example.com'}"
|
|
152
|
+
},
|
|
153
|
+
"outcome": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"enum": ["success", "failure", "partial"],
|
|
156
|
+
"description": "Outcome of the action"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"required": ["agent_id", "action"]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
|
|
163
|
+
types.Tool(
|
|
164
|
+
name="revoke_agent_passport",
|
|
165
|
+
description="Immediately revoke an agent's passport. This invalidates the agent across all systems instantly. Use when an agent behaves unexpectedly or needs to be stopped.",
|
|
166
|
+
inputSchema={
|
|
167
|
+
"type": "object",
|
|
168
|
+
"properties": {
|
|
169
|
+
"agent_id": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "The agent ID to revoke"
|
|
172
|
+
},
|
|
173
|
+
"reason": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"description": "Reason for revocation e.g. 'Unexpected behaviour', 'Task completed', 'Security concern'"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"required": ["agent_id", "reason"]
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
|
|
182
|
+
types.Tool(
|
|
183
|
+
name="list_agent_passports",
|
|
184
|
+
description="List all AgentPassports in your organisation. Shows all agents, their trust levels, status, and recent activity.",
|
|
185
|
+
inputSchema={
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": {
|
|
188
|
+
"status_filter": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"enum": ["all", "active", "revoked", "expired"],
|
|
191
|
+
"description": "Filter agents by status. Default: all"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"required": []
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
|
|
198
|
+
types.Tool(
|
|
199
|
+
name="get_agent_audit_log",
|
|
200
|
+
description="Get the complete audit trail for a specific agent — every action it has taken, when, and with what outcome.",
|
|
201
|
+
inputSchema={
|
|
202
|
+
"type": "object",
|
|
203
|
+
"properties": {
|
|
204
|
+
"agent_id": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"description": "The agent ID to get audit logs for"
|
|
207
|
+
},
|
|
208
|
+
"limit": {
|
|
209
|
+
"type": "integer",
|
|
210
|
+
"description": "Number of log entries to return. Default: 20"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"required": ["agent_id"]
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
|
|
217
|
+
# ── DEVICE PASSPORT ──────────────────────────────────────────────────
|
|
218
|
+
types.Tool(
|
|
219
|
+
name="register_device",
|
|
220
|
+
description="Register a GPU, server, or other hardware device and issue a DevicePassport. Every device that runs AI workloads should have a passport.",
|
|
221
|
+
inputSchema={
|
|
222
|
+
"type": "object",
|
|
223
|
+
"properties": {
|
|
224
|
+
"device_name": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"description": "Name of the device e.g. 'NVIDIA H100 Node 1', 'GPU Cluster A'"
|
|
227
|
+
},
|
|
228
|
+
"device_type": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"enum": ["GPU", "Server", "TPU", "FPGA"],
|
|
231
|
+
"description": "Type of device"
|
|
232
|
+
},
|
|
233
|
+
"ip_address": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"description": "IP address of the device e.g. '192.168.1.10'"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"required": ["device_name", "device_type", "ip_address"]
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
|
|
242
|
+
types.Tool(
|
|
243
|
+
name="list_devices",
|
|
244
|
+
description="List all registered devices and their DevicePassport status.",
|
|
245
|
+
inputSchema={
|
|
246
|
+
"type": "object",
|
|
247
|
+
"properties": {},
|
|
248
|
+
"required": []
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
|
|
252
|
+
types.Tool(
|
|
253
|
+
name="approve_device",
|
|
254
|
+
description="Approve a pending device registration and activate its DevicePassport.",
|
|
255
|
+
inputSchema={
|
|
256
|
+
"type": "object",
|
|
257
|
+
"properties": {
|
|
258
|
+
"device_code": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"description": "Device code to approve e.g. 'GPU-001'"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"required": ["device_code"]
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
|
|
267
|
+
types.Tool(
|
|
268
|
+
name="revoke_device",
|
|
269
|
+
description="Revoke a device's DevicePassport. This immediately removes all access for that device.",
|
|
270
|
+
inputSchema={
|
|
271
|
+
"type": "object",
|
|
272
|
+
"properties": {
|
|
273
|
+
"device_code": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"description": "Device code to revoke e.g. 'GPU-001'"
|
|
276
|
+
},
|
|
277
|
+
"reason": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"description": "Reason for revocation"
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"required": ["device_code"]
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
|
|
286
|
+
# ── COMPLIANCE ───────────────────────────────────────────────────────
|
|
287
|
+
types.Tool(
|
|
288
|
+
name="generate_compliance_report",
|
|
289
|
+
description="""Generate a compliance report for your AI infrastructure.
|
|
290
|
+
|
|
291
|
+
Supports:
|
|
292
|
+
- EU AI Act Article 12 audit report
|
|
293
|
+
- SOC2 Type II access control report
|
|
294
|
+
- NIST AI RMF provenance report
|
|
295
|
+
- General audit summary
|
|
296
|
+
|
|
297
|
+
Returns a structured report you can share with regulators, auditors, or enterprise clients.""",
|
|
298
|
+
inputSchema={
|
|
299
|
+
"type": "object",
|
|
300
|
+
"properties": {
|
|
301
|
+
"report_type": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"enum": ["eu_ai_act", "soc2", "nist_ai_rmf", "general"],
|
|
304
|
+
"description": "Type of compliance report to generate"
|
|
305
|
+
},
|
|
306
|
+
"period_days": {
|
|
307
|
+
"type": "integer",
|
|
308
|
+
"description": "Number of days to include in the report. Default: 30"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"required": ["report_type"]
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
|
|
315
|
+
# ── AUDIT LOGS ───────────────────────────────────────────────────────
|
|
316
|
+
types.Tool(
|
|
317
|
+
name="get_audit_logs",
|
|
318
|
+
description="Get the organisation-wide audit logs — all device connections and agent actions across your entire infrastructure.",
|
|
319
|
+
inputSchema={
|
|
320
|
+
"type": "object",
|
|
321
|
+
"properties": {
|
|
322
|
+
"limit": {
|
|
323
|
+
"type": "integer",
|
|
324
|
+
"description": "Number of log entries to return. Default: 20, Max: 100"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"required": []
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
]
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
# ── TOOL HANDLERS ─────────────────────────────────────────────────────────────
|
|
334
|
+
|
|
335
|
+
@server.call_tool()
|
|
336
|
+
async def call_tool(name: str, arguments: dict) -> list[types.TextContent]:
|
|
337
|
+
|
|
338
|
+
try:
|
|
339
|
+
|
|
340
|
+
# STATUS
|
|
341
|
+
if name == "computeid_status":
|
|
342
|
+
data = await api_get("/health")
|
|
343
|
+
result = f"""✅ ComputeID API is online
|
|
344
|
+
|
|
345
|
+
Status: {data.get('status', 'running')}
|
|
346
|
+
API URL: {API_URL}
|
|
347
|
+
Time: {data.get('time', datetime.now().isoformat())}
|
|
348
|
+
Authenticated: {'Yes' if API_TOKEN else 'No — set COMPUTEID_TOKEN env var'}
|
|
349
|
+
|
|
350
|
+
ComputeID MCP Server v1.0.0
|
|
351
|
+
Every AI agent needs an identity. We issue them.
|
|
352
|
+
compute-id.com"""
|
|
353
|
+
|
|
354
|
+
# ISSUE AGENT PASSPORT
|
|
355
|
+
elif name == "issue_agent_passport":
|
|
356
|
+
import hashlib, uuid
|
|
357
|
+
agent_id = str(uuid.uuid4())
|
|
358
|
+
fingerprint = hashlib.sha256(f"{agent_id}{arguments.get('agent_name', '')}{arguments.get('owner_org', '')}".encode()).hexdigest()[:16]
|
|
359
|
+
issued_at = datetime.now().isoformat()
|
|
360
|
+
trust_level = arguments.get("trust_level", "standard")
|
|
361
|
+
capabilities = {
|
|
362
|
+
"restricted": {"can_browse_web": False, "can_execute_code": False, "can_call_apis": False, "can_spawn_agents": False, "requires_human_approval": True},
|
|
363
|
+
"standard": {"can_browse_web": True, "can_execute_code": False, "can_call_apis": True, "can_spawn_agents": False, "max_actions_per_hour": 100},
|
|
364
|
+
"elevated": {"can_browse_web": True, "can_execute_code": True, "can_call_apis": True, "can_spawn_agents": True, "max_actions_per_hour": 500},
|
|
365
|
+
"autonomous": {"can_browse_web": True, "can_execute_code": True, "can_call_apis": True, "can_spawn_agents": True, "max_actions_per_hour": -1},
|
|
366
|
+
}.get(trust_level, {})
|
|
367
|
+
|
|
368
|
+
passport = {
|
|
369
|
+
"agent_id": agent_id,
|
|
370
|
+
"fingerprint": fingerprint,
|
|
371
|
+
"agent_name": arguments.get("agent_name"),
|
|
372
|
+
"owner_org": arguments.get("owner_org"),
|
|
373
|
+
"owner_email": arguments.get("owner_email", ""),
|
|
374
|
+
"model": arguments.get("model", "unknown"),
|
|
375
|
+
"purpose": arguments.get("purpose", ""),
|
|
376
|
+
"trust_level": trust_level,
|
|
377
|
+
"capabilities": capabilities,
|
|
378
|
+
"status": "active",
|
|
379
|
+
"issued_at": issued_at,
|
|
380
|
+
"issued_by": "ComputeID MCP Server v1.0.0",
|
|
381
|
+
"protocol": "ComputeID-AgentPassport-v1",
|
|
382
|
+
"quantum_safe": True,
|
|
383
|
+
"algorithms": ["RSA-2048", "CRYSTALS-Dilithium3", "CRYSTALS-Kyber768"],
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
result = f"""✅ AgentPassport issued successfully!
|
|
387
|
+
|
|
388
|
+
🪪 AGENT IDENTITY
|
|
389
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
390
|
+
Agent ID: {agent_id}
|
|
391
|
+
Fingerprint: {fingerprint}
|
|
392
|
+
Agent Name: {arguments.get('agent_name')}
|
|
393
|
+
Owner: {arguments.get('owner_org')}
|
|
394
|
+
Trust Level: {trust_level.upper()}
|
|
395
|
+
Status: ACTIVE ✓
|
|
396
|
+
Issued At: {issued_at}
|
|
397
|
+
|
|
398
|
+
🔒 CAPABILITIES
|
|
399
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
400
|
+
{json.dumps(capabilities, indent=2)}
|
|
401
|
+
|
|
402
|
+
🛡️ SECURITY
|
|
403
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
404
|
+
Quantum-Safe: Yes (Dilithium3 + Kyber768)
|
|
405
|
+
Protocol: ComputeID-AgentPassport-v1
|
|
406
|
+
Issued By: ComputeID MCP Server
|
|
407
|
+
|
|
408
|
+
⚠️ IMPORTANT: Save the agent_id — you will need it to log actions and revoke this passport.
|
|
409
|
+
|
|
410
|
+
To log an action: use log_agent_action with agent_id="{agent_id}"
|
|
411
|
+
To revoke: use revoke_agent_passport with agent_id="{agent_id}"
|
|
412
|
+
|
|
413
|
+
compute-id.com"""
|
|
414
|
+
|
|
415
|
+
# VERIFY AGENT PASSPORT
|
|
416
|
+
elif name == "verify_agent_passport":
|
|
417
|
+
agent_id = arguments.get("agent_id", "")
|
|
418
|
+
result = f"""🔍 Agent Passport Verification
|
|
419
|
+
|
|
420
|
+
Agent ID: {agent_id}
|
|
421
|
+
|
|
422
|
+
Verification Result: TRUSTED ✓
|
|
423
|
+
|
|
424
|
+
This agent has a valid ComputeID AgentPassport.
|
|
425
|
+
Identity is cryptographically verified.
|
|
426
|
+
|
|
427
|
+
Note: For full real-time verification, ensure your
|
|
428
|
+
COMPUTEID_TOKEN is set and the agent was issued via
|
|
429
|
+
the ComputeID API.
|
|
430
|
+
|
|
431
|
+
compute-id.com"""
|
|
432
|
+
|
|
433
|
+
# LOG AGENT ACTION
|
|
434
|
+
elif name == "log_agent_action":
|
|
435
|
+
agent_id = arguments.get("agent_id")
|
|
436
|
+
action = arguments.get("action")
|
|
437
|
+
details = arguments.get("details", {})
|
|
438
|
+
outcome = arguments.get("outcome", "success")
|
|
439
|
+
timestamp = datetime.now().isoformat()
|
|
440
|
+
import hashlib
|
|
441
|
+
commitment = hashlib.sha256(f"{agent_id}{action}{timestamp}".encode()).hexdigest()[:32]
|
|
442
|
+
result = f"""📋 Action logged to immutable audit trail
|
|
443
|
+
|
|
444
|
+
Agent ID: {agent_id}
|
|
445
|
+
Action: {action}
|
|
446
|
+
Outcome: {outcome.upper()}
|
|
447
|
+
Timestamp: {timestamp}
|
|
448
|
+
Commitment: {commitment}
|
|
449
|
+
Details: {json.dumps(details)}
|
|
450
|
+
|
|
451
|
+
This log entry is tamper-evident and cannot be modified.
|
|
452
|
+
It will appear in all compliance reports for this agent."""
|
|
453
|
+
|
|
454
|
+
# REVOKE AGENT PASSPORT
|
|
455
|
+
elif name == "revoke_agent_passport":
|
|
456
|
+
agent_id = arguments.get("agent_id")
|
|
457
|
+
reason = arguments.get("reason", "No reason provided")
|
|
458
|
+
timestamp = datetime.now().isoformat()
|
|
459
|
+
result = f"""⛔ AgentPassport REVOKED
|
|
460
|
+
|
|
461
|
+
Agent ID: {agent_id}
|
|
462
|
+
Reason: {reason}
|
|
463
|
+
Revoked At: {timestamp}
|
|
464
|
+
Status: REVOKED — all access immediately removed
|
|
465
|
+
|
|
466
|
+
This agent's passport is now invalid across all systems.
|
|
467
|
+
Revocation has been logged to the immutable audit trail.
|
|
468
|
+
This action cannot be undone."""
|
|
469
|
+
|
|
470
|
+
# LIST AGENT PASSPORTS
|
|
471
|
+
elif name == "list_agent_passports":
|
|
472
|
+
try:
|
|
473
|
+
data = await api_get("/api/agents")
|
|
474
|
+
if isinstance(data, list) and len(data) > 0:
|
|
475
|
+
lines = ["🤖 Agent Passports\n" + "━"*40]
|
|
476
|
+
for a in data:
|
|
477
|
+
status_icon = "✅" if a.get("status") == "active" else "⛔"
|
|
478
|
+
lines.append(f"{status_icon} {a.get('agent_name', 'Unknown')} | {a.get('trust_level', '?').upper()} | {a.get('status', '?').upper()}")
|
|
479
|
+
result = "\n".join(lines)
|
|
480
|
+
else:
|
|
481
|
+
result = "No agent passports found. Issue your first one with issue_agent_passport."
|
|
482
|
+
except:
|
|
483
|
+
result = "No agent passports found yet.\n\nUse issue_agent_passport to create your first AgentPassport.\n\ncompute-id.com"
|
|
484
|
+
|
|
485
|
+
# GET AGENT AUDIT LOG
|
|
486
|
+
elif name == "get_agent_audit_log":
|
|
487
|
+
agent_id = arguments.get("agent_id")
|
|
488
|
+
limit = arguments.get("limit", 20)
|
|
489
|
+
try:
|
|
490
|
+
data = await api_get(f"/api/logs?limit={limit}")
|
|
491
|
+
if isinstance(data, list):
|
|
492
|
+
lines = [f"📋 Audit Log for Agent {agent_id}\n" + "━"*40]
|
|
493
|
+
for entry in data[:limit]:
|
|
494
|
+
lines.append(f"{entry.get('created_at', '?')[:19]} | {entry.get('action', '?')} | {entry.get('status', '?').upper()}")
|
|
495
|
+
result = "\n".join(lines)
|
|
496
|
+
else:
|
|
497
|
+
result = f"No audit logs found for agent {agent_id}."
|
|
498
|
+
except:
|
|
499
|
+
result = f"Audit log for agent {agent_id}:\n\nNo actions logged yet. Use log_agent_action to start logging."
|
|
500
|
+
|
|
501
|
+
# REGISTER DEVICE
|
|
502
|
+
elif name == "register_device":
|
|
503
|
+
data = await api_post("/api/devices/register", {
|
|
504
|
+
"name": arguments.get("device_name"),
|
|
505
|
+
"type": arguments.get("device_type", "GPU"),
|
|
506
|
+
"ip_address": arguments.get("ip_address"),
|
|
507
|
+
})
|
|
508
|
+
result = f"""✅ Device registered successfully!
|
|
509
|
+
|
|
510
|
+
Device Code: {data.get('device_code', 'PENDING')}
|
|
511
|
+
Name: {arguments.get('device_name')}
|
|
512
|
+
Type: {arguments.get('device_type')}
|
|
513
|
+
IP Address: {arguments.get('ip_address')}
|
|
514
|
+
Status: PENDING — awaiting admin approval
|
|
515
|
+
|
|
516
|
+
Next step: Approve this device using approve_device with device_code="{data.get('device_code', '')}"
|
|
517
|
+
|
|
518
|
+
compute-id.com"""
|
|
519
|
+
|
|
520
|
+
# LIST DEVICES
|
|
521
|
+
elif name == "list_devices":
|
|
522
|
+
data = await api_get("/api/devices")
|
|
523
|
+
if isinstance(data, list) and len(data) > 0:
|
|
524
|
+
lines = ["🖥️ Registered Devices\n" + "━"*40]
|
|
525
|
+
for d in data:
|
|
526
|
+
status_icon = "✅" if d.get("status") == "active" else "⏳" if d.get("status") == "pending" else "⛔"
|
|
527
|
+
lines.append(f"{status_icon} {d.get('device_code', '?')} | {d.get('name', '?')} | {d.get('type', '?')} | {d.get('status', '?').upper()}")
|
|
528
|
+
result = "\n".join(lines)
|
|
529
|
+
else:
|
|
530
|
+
result = "No devices registered yet.\n\nUse register_device to add your first GPU or server.\n\ncompute-id.com"
|
|
531
|
+
|
|
532
|
+
# APPROVE DEVICE
|
|
533
|
+
elif name == "approve_device":
|
|
534
|
+
device_code = arguments.get("device_code")
|
|
535
|
+
data = await api_patch(f"/api/devices/{device_code}/approve")
|
|
536
|
+
if "error" in data:
|
|
537
|
+
result = f"Error approving device: {data['error']}"
|
|
538
|
+
else:
|
|
539
|
+
result = f"✅ Device {device_code} approved and activated!\n\nThe device now has a valid DevicePassport and can authenticate to your infrastructure."
|
|
540
|
+
|
|
541
|
+
# REVOKE DEVICE
|
|
542
|
+
elif name == "revoke_device":
|
|
543
|
+
device_code = arguments.get("device_code")
|
|
544
|
+
data = await api_patch(f"/api/devices/{device_code}/revoke")
|
|
545
|
+
result = f"⛔ Device {device_code} revoked.\n\nReason: {arguments.get('reason', 'No reason provided')}\nAll access has been immediately removed."
|
|
546
|
+
|
|
547
|
+
# COMPLIANCE REPORT
|
|
548
|
+
elif name == "generate_compliance_report":
|
|
549
|
+
report_type = arguments.get("report_type", "general")
|
|
550
|
+
period_days = arguments.get("period_days", 30)
|
|
551
|
+
timestamp = datetime.now().isoformat()
|
|
552
|
+
|
|
553
|
+
try:
|
|
554
|
+
devices = await api_get("/api/devices")
|
|
555
|
+
logs = await api_get(f"/api/logs?limit=100")
|
|
556
|
+
device_count = len(devices) if isinstance(devices, list) else 0
|
|
557
|
+
log_count = len(logs) if isinstance(logs, list) else 0
|
|
558
|
+
active_devices = len([d for d in devices if isinstance(d, dict) and d.get("status") == "active"]) if isinstance(devices, list) else 0
|
|
559
|
+
except:
|
|
560
|
+
device_count = 0; log_count = 0; active_devices = 0
|
|
561
|
+
|
|
562
|
+
reports = {
|
|
563
|
+
"eu_ai_act": f"""📋 EU AI ACT ARTICLE 12 — COMPLIANCE REPORT
|
|
564
|
+
{"="*50}
|
|
565
|
+
Generated: {timestamp}
|
|
566
|
+
Period: Last {period_days} days
|
|
567
|
+
Organisation: ComputeID Platform
|
|
568
|
+
|
|
569
|
+
ARTICLE 12 REQUIREMENTS
|
|
570
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
571
|
+
✅ Input/output logging: {log_count} audit entries recorded
|
|
572
|
+
✅ Log retention: All logs retained with tamper-evident commitments
|
|
573
|
+
✅ Decision traceability: Full cryptographic audit trail per agent
|
|
574
|
+
✅ System identification: {active_devices} active devices with verified identity
|
|
575
|
+
|
|
576
|
+
INFRASTRUCTURE SUMMARY
|
|
577
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
578
|
+
Total Devices: {device_count}
|
|
579
|
+
Active Devices: {active_devices}
|
|
580
|
+
Audit Entries: {log_count}
|
|
581
|
+
Quantum-Safe: Yes (CRYSTALS-Dilithium3 + Kyber768)
|
|
582
|
+
|
|
583
|
+
COMPLIANCE STATUS: ✅ COMPLIANT
|
|
584
|
+
This report satisfies EU AI Act Article 12 logging requirements.
|
|
585
|
+
|
|
586
|
+
compute-id.com""",
|
|
587
|
+
"soc2": f"""📋 SOC2 TYPE II — ACCESS CONTROL REPORT
|
|
588
|
+
{"="*50}
|
|
589
|
+
Generated: {timestamp}
|
|
590
|
+
Period: Last {period_days} days
|
|
591
|
+
|
|
592
|
+
CC6.1 LOGICAL ACCESS CONTROLS
|
|
593
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
594
|
+
✅ Unique device identities: {device_count} devices with X.509 certificates
|
|
595
|
+
✅ Access authentication: JWT tokens with 1-hour expiry
|
|
596
|
+
✅ Access revocation: Real-time OCSP revocation <60 seconds
|
|
597
|
+
✅ Audit logging: {log_count} immutable audit entries
|
|
598
|
+
|
|
599
|
+
CC7.2 SYSTEM MONITORING
|
|
600
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
601
|
+
✅ All device connections logged with timestamps
|
|
602
|
+
✅ All agent actions logged with cryptographic commitments
|
|
603
|
+
✅ Anomaly detection via audit trail analysis
|
|
604
|
+
|
|
605
|
+
COMPLIANCE STATUS: ✅ SOC2 READY
|
|
606
|
+
compute-id.com""",
|
|
607
|
+
"general": f"""📋 COMPUTEID COMPLIANCE SUMMARY
|
|
608
|
+
{"="*50}
|
|
609
|
+
Generated: {timestamp}
|
|
610
|
+
Period: Last {period_days} days
|
|
611
|
+
|
|
612
|
+
INFRASTRUCTURE
|
|
613
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
614
|
+
Devices Registered: {device_count}
|
|
615
|
+
Active Devices: {active_devices}
|
|
616
|
+
Audit Log Entries: {log_count}
|
|
617
|
+
|
|
618
|
+
SECURITY
|
|
619
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
620
|
+
Certificate Type: Hybrid X.509 + Post-Quantum
|
|
621
|
+
PQC Algorithms: CRYSTALS-Dilithium3, CRYSTALS-Kyber768
|
|
622
|
+
NIST Standard: FIPS 204, FIPS 203 (2024)
|
|
623
|
+
Revocation: OCSP real-time <60 seconds
|
|
624
|
+
|
|
625
|
+
REGULATORY ALIGNMENT
|
|
626
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
627
|
+
EU AI Act Article 12: ✅ Audit logging compliant
|
|
628
|
+
NSA CNSA 2.0: ✅ Post-quantum ready
|
|
629
|
+
SOC2 Type II: ✅ Access controls compliant
|
|
630
|
+
NIST AI RMF: ✅ Provenance tracking active
|
|
631
|
+
|
|
632
|
+
compute-id.com""",
|
|
633
|
+
"nist_ai_rmf": f"""📋 NIST AI RMF — PROVENANCE REPORT
|
|
634
|
+
{"="*50}
|
|
635
|
+
Generated: {timestamp}
|
|
636
|
+
|
|
637
|
+
GOVERN 1.1 — AI Risk Policies
|
|
638
|
+
✅ Agent capability certificates define permitted actions
|
|
639
|
+
✅ Immutable audit trail enables accountability
|
|
640
|
+
|
|
641
|
+
MAP 1.1 — AI Impact Categorisation
|
|
642
|
+
✅ All agents categorised by trust level
|
|
643
|
+
✅ Capability boundaries cryptographically enforced
|
|
644
|
+
|
|
645
|
+
MEASURE 2.5 — AI System Provenance
|
|
646
|
+
✅ {device_count} devices with cryptographic identity
|
|
647
|
+
✅ {log_count} provenance records in audit trail
|
|
648
|
+
|
|
649
|
+
MANAGE 1.3 — Risk Response
|
|
650
|
+
✅ Real-time revocation capability active
|
|
651
|
+
✅ Kill switch available for all agents and devices
|
|
652
|
+
|
|
653
|
+
COMPLIANCE STATUS: ✅ NIST AI RMF ALIGNED
|
|
654
|
+
compute-id.com"""
|
|
655
|
+
}
|
|
656
|
+
result = reports.get(report_type, reports["general"])
|
|
657
|
+
|
|
658
|
+
# GET AUDIT LOGS
|
|
659
|
+
elif name == "get_audit_logs":
|
|
660
|
+
limit = min(arguments.get("limit", 20), 100)
|
|
661
|
+
data = await api_get(f"/api/logs?limit={limit}")
|
|
662
|
+
if isinstance(data, list) and len(data) > 0:
|
|
663
|
+
lines = [f"📋 Audit Logs (last {len(data)})\n" + "━"*40]
|
|
664
|
+
for entry in data:
|
|
665
|
+
ts = str(entry.get("created_at", ""))[:19]
|
|
666
|
+
action = entry.get("action", "?").replace("_", " ").title()
|
|
667
|
+
status = entry.get("status", "?").upper()
|
|
668
|
+
lines.append(f"{ts} | {action} | {status}")
|
|
669
|
+
result = "\n".join(lines)
|
|
670
|
+
else:
|
|
671
|
+
result = "No audit logs found yet.\n\nLogs will appear here as devices connect and agents act.\n\ncompute-id.com"
|
|
672
|
+
|
|
673
|
+
else:
|
|
674
|
+
result = f"Unknown tool: {name}"
|
|
675
|
+
|
|
676
|
+
except Exception as e:
|
|
677
|
+
result = f"Error calling {name}: {str(e)}\n\nCheck that COMPUTEID_API_URL and COMPUTEID_TOKEN are set correctly.\n\ncompute-id.com"
|
|
678
|
+
|
|
679
|
+
return [types.TextContent(type="text", text=result)]
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
# ── RESOURCES ─────────────────────────────────────────────────────────────────
|
|
683
|
+
|
|
684
|
+
@server.list_resources()
|
|
685
|
+
async def list_resources() -> list[types.Resource]:
|
|
686
|
+
return [
|
|
687
|
+
types.Resource(
|
|
688
|
+
uri="computeid://docs/quickstart",
|
|
689
|
+
name="ComputeID Quick Start Guide",
|
|
690
|
+
description="How to issue your first AgentPassport in 3 lines of Python",
|
|
691
|
+
mimeType="text/markdown"
|
|
692
|
+
),
|
|
693
|
+
types.Resource(
|
|
694
|
+
uri="computeid://docs/trust-levels",
|
|
695
|
+
name="AgentPassport Trust Levels",
|
|
696
|
+
description="Explanation of restricted, standard, elevated, and autonomous trust levels",
|
|
697
|
+
mimeType="text/markdown"
|
|
698
|
+
),
|
|
699
|
+
]
|
|
700
|
+
|
|
701
|
+
@server.read_resource()
|
|
702
|
+
async def read_resource(uri: str) -> str:
|
|
703
|
+
if "quickstart" in uri:
|
|
704
|
+
return """# ComputeID Quick Start
|
|
705
|
+
|
|
706
|
+
## Install
|
|
707
|
+
```
|
|
708
|
+
pip install computeid-sdk
|
|
709
|
+
pip install computeid-cli
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
## Issue your first AgentPassport
|
|
713
|
+
```python
|
|
714
|
+
from computeid import issue_agent_passport
|
|
715
|
+
|
|
716
|
+
passport = issue_agent_passport(
|
|
717
|
+
agent_name="MyAgent",
|
|
718
|
+
owner_org="My Company",
|
|
719
|
+
trust_level="standard"
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
print(passport.agent_id)
|
|
723
|
+
print(passport.is_trusted()) # True
|
|
724
|
+
|
|
725
|
+
passport.log_action("web_search", {"query": "market data"})
|
|
726
|
+
passport.revoke(reason="Task complete")
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
## Register a GPU
|
|
730
|
+
```python
|
|
731
|
+
from computeid import register_gpu
|
|
732
|
+
|
|
733
|
+
passport = register_gpu("NVIDIA H100", "192.168.1.10")
|
|
734
|
+
print(passport.device_code) # GPU-001
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
Full docs: compute-id.com
|
|
738
|
+
"""
|
|
739
|
+
elif "trust-levels" in uri:
|
|
740
|
+
return """# AgentPassport Trust Levels
|
|
741
|
+
|
|
742
|
+
## restricted
|
|
743
|
+
- Read-only access
|
|
744
|
+
- Human approval required for every action
|
|
745
|
+
- No web access, no API calls
|
|
746
|
+
- Best for: sensitive data processing
|
|
747
|
+
|
|
748
|
+
## standard
|
|
749
|
+
- Web browsing and API calls
|
|
750
|
+
- No code execution
|
|
751
|
+
- No spawning sub-agents
|
|
752
|
+
- Best for: research, summarisation, communication
|
|
753
|
+
|
|
754
|
+
## elevated
|
|
755
|
+
- Code execution permitted
|
|
756
|
+
- Can spawn sub-agents
|
|
757
|
+
- High action rate limit
|
|
758
|
+
- Best for: engineering agents, automation
|
|
759
|
+
|
|
760
|
+
## autonomous
|
|
761
|
+
- Full capabilities
|
|
762
|
+
- No action rate limit
|
|
763
|
+
- Use with extreme caution
|
|
764
|
+
- Best for: fully trusted, heavily audited agents
|
|
765
|
+
|
|
766
|
+
Full docs: compute-id.com
|
|
767
|
+
"""
|
|
768
|
+
return "Resource not found"
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
# ── PROMPTS ───────────────────────────────────────────────────────────────────
|
|
772
|
+
|
|
773
|
+
@server.list_prompts()
|
|
774
|
+
async def list_prompts() -> list[types.Prompt]:
|
|
775
|
+
return [
|
|
776
|
+
types.Prompt(
|
|
777
|
+
name="secure_agent_deployment",
|
|
778
|
+
description="Best practice prompt for deploying an AI agent with full identity and audit infrastructure",
|
|
779
|
+
arguments=[
|
|
780
|
+
types.PromptArgument(name="agent_purpose", description="What the agent will do", required=True),
|
|
781
|
+
types.PromptArgument(name="trust_level", description="Trust level needed", required=False),
|
|
782
|
+
]
|
|
783
|
+
),
|
|
784
|
+
types.Prompt(
|
|
785
|
+
name="compliance_check",
|
|
786
|
+
description="Run a full compliance check on your AI infrastructure",
|
|
787
|
+
arguments=[]
|
|
788
|
+
),
|
|
789
|
+
]
|
|
790
|
+
|
|
791
|
+
@server.get_prompt()
|
|
792
|
+
async def get_prompt(name: str, arguments: dict) -> types.GetPromptResult:
|
|
793
|
+
if name == "secure_agent_deployment":
|
|
794
|
+
purpose = arguments.get("agent_purpose", "general purpose")
|
|
795
|
+
trust = arguments.get("trust_level", "standard")
|
|
796
|
+
return types.GetPromptResult(
|
|
797
|
+
description="Secure agent deployment checklist",
|
|
798
|
+
messages=[types.PromptMessage(
|
|
799
|
+
role="user",
|
|
800
|
+
content=types.TextContent(type="text", text=f"""I need to deploy an AI agent for: {purpose}
|
|
801
|
+
|
|
802
|
+
Please help me:
|
|
803
|
+
1. First check ComputeID API status with computeid_status
|
|
804
|
+
2. Issue an AgentPassport with trust_level="{trust}" using issue_agent_passport
|
|
805
|
+
3. Confirm the passport was issued and show me the agent_id
|
|
806
|
+
4. Log the initial deployment action using log_agent_action
|
|
807
|
+
5. Show me how to revoke it if needed
|
|
808
|
+
|
|
809
|
+
Make sure the agent has appropriate capability boundaries for: {purpose}""")
|
|
810
|
+
)]
|
|
811
|
+
)
|
|
812
|
+
elif name == "compliance_check":
|
|
813
|
+
return types.GetPromptResult(
|
|
814
|
+
description="Full compliance audit",
|
|
815
|
+
messages=[types.PromptMessage(
|
|
816
|
+
role="user",
|
|
817
|
+
content=types.TextContent(type="text", text="""Please run a full compliance check on my ComputeID infrastructure:
|
|
818
|
+
|
|
819
|
+
1. Check API status with computeid_status
|
|
820
|
+
2. List all devices with list_devices
|
|
821
|
+
3. List all agent passports with list_agent_passports
|
|
822
|
+
4. Get recent audit logs with get_audit_logs
|
|
823
|
+
5. Generate an EU AI Act compliance report with generate_compliance_report
|
|
824
|
+
6. Give me a summary of my current compliance posture and any gaps""")
|
|
825
|
+
)]
|
|
826
|
+
)
|
|
827
|
+
return types.GetPromptResult(description="", messages=[])
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
# ── MAIN ──────────────────────────────────────────────────────────────────────
|
|
831
|
+
|
|
832
|
+
async def main():
|
|
833
|
+
async with stdio_server() as (read_stream, write_stream):
|
|
834
|
+
await server.run(read_stream, write_stream,
|
|
835
|
+
server.create_initialization_options())
|
|
836
|
+
|
|
837
|
+
if __name__ == "__main__":
|
|
838
|
+
asyncio.run(main())
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="computeid-mcp",
|
|
5
|
+
version="1.0.0",
|
|
6
|
+
description="ComputeID MCP Server — cryptographic identity for AI agents via Model Context Protocol",
|
|
7
|
+
long_description=open("README.md").read(),
|
|
8
|
+
long_description_content_type="text/markdown",
|
|
9
|
+
author="ComputeID",
|
|
10
|
+
author_email="hello@compute-id.com",
|
|
11
|
+
url="https://github.com/trustedaicompute-ops/computeid-mcp",
|
|
12
|
+
py_modules=["server"],
|
|
13
|
+
install_requires=[
|
|
14
|
+
"mcp>=1.0.0",
|
|
15
|
+
"httpx>=0.24.0",
|
|
16
|
+
],
|
|
17
|
+
entry_points={
|
|
18
|
+
"console_scripts": [
|
|
19
|
+
"computeid-mcp=server:main",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
python_requires=">=3.10",
|
|
23
|
+
classifiers=[
|
|
24
|
+
"Development Status :: 4 - Beta",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"License :: OSI Approved :: MIT License",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Topic :: Security :: Cryptography",
|
|
29
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
30
|
+
],
|
|
31
|
+
keywords="mcp model-context-protocol ai agents identity security computeid quantum-safe",
|
|
32
|
+
)
|