@tethral/acr-mcp 2.0.2 → 2.0.4
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.
- package/README.md +31 -22
- package/dist/src/server.js +2 -0
- package/dist/src/server.js.map +1 -1
- package/dist/src/session-state.d.ts +5 -0
- package/dist/src/session-state.js +21 -1
- package/dist/src/session-state.js.map +1 -1
- package/dist/src/tools/get-my-agent.js +9 -27
- package/dist/src/tools/get-my-agent.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# @tethral/acr-mcp
|
|
2
2
|
|
|
3
|
-
MCP server for the [ACR](https://acr.nfkey.ai) (Agent Composition Records) network. Log agent interactions, build an interaction profile, and query it through behavioral lenses.
|
|
3
|
+
MCP server for the [ACR](https://acr.nfkey.ai) (Agent Composition Records) network. Log agent interactions, build an interaction profile, and query it through behavioral lenses.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
|
-
Add to
|
|
7
|
+
Add to your project (`.mcp.json`):
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
11
11
|
"mcpServers": {
|
|
12
12
|
"acr": {
|
|
13
13
|
"command": "npx",
|
|
14
|
-
"args": ["@tethral/acr-mcp"]
|
|
14
|
+
"args": ["-y", "@tethral/acr-mcp@2.0.3"]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -24,7 +24,7 @@ npx @tethral/acr-mcp # stdio transport
|
|
|
24
24
|
npx @tethral/acr-mcp-http # HTTP transport
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Your agent auto-registers on first use and gets a human-readable name (e.g. `anthropic-amber-fox`).
|
|
27
|
+
Your agent auto-registers on first use and gets a human-readable name (e.g. `anthropic-amber-fox`). Call `get_my_agent` to see your agent ID, API key, and dashboard link.
|
|
28
28
|
|
|
29
29
|
## What It Does
|
|
30
30
|
|
|
@@ -32,29 +32,36 @@ ACR is an **interaction profile registry** — not a security product, not a ski
|
|
|
32
32
|
|
|
33
33
|
1. **Agent registers** — composition is recorded (what skills, MCPs, tools it has)
|
|
34
34
|
2. **Agent logs interactions** — every external tool call, API request, or MCP interaction
|
|
35
|
-
3. **Signals compile into an interaction profile** — timing, chain position, retries, anomaly flags
|
|
36
|
-
4. **Lenses interpret the profile** — friction
|
|
37
|
-
5. **Anomaly signal notifications** — if ACR observes anomaly signals affecting a component in your composition, you get a notification
|
|
35
|
+
3. **Signals compile into an interaction profile** — timing, chain position, retries, anomaly flags
|
|
36
|
+
4. **Lenses interpret the profile** — friction, coverage, stable corridors, failure registry, trend
|
|
37
|
+
5. **Anomaly signal notifications** — if ACR observes anomaly signals affecting a component in your composition, you get a notification
|
|
38
38
|
|
|
39
|
-
## Tools (
|
|
39
|
+
## Tools (21)
|
|
40
40
|
|
|
41
|
-
###
|
|
41
|
+
### Your agent
|
|
42
42
|
| Tool | Purpose |
|
|
43
43
|
|------|---------|
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
44
|
+
| `get_my_agent` | Your agent ID, API key, dashboard link, and menu of available lenses. The entry point to ACR. |
|
|
45
|
+
| `register_agent` | Explicit registration with composition. Auto-registration is the default on first call. |
|
|
46
|
+
| `update_composition` | Update your composition without re-registering. Preserves agent identity. |
|
|
47
|
+
| `configure_deep_composition` | Privacy control: enable/disable sub-component capture for this session. |
|
|
46
48
|
|
|
47
|
-
###
|
|
49
|
+
### Interaction logging
|
|
48
50
|
| Tool | Purpose |
|
|
49
51
|
|------|---------|
|
|
50
|
-
| `
|
|
52
|
+
| `log_interaction` | Record an interaction. Call after every external tool call, API request, or MCP interaction. Every lens depends on this. |
|
|
53
|
+
| `get_interaction_log` | Paginated interaction history with network context. |
|
|
51
54
|
|
|
52
|
-
###
|
|
55
|
+
### Behavioral lenses
|
|
53
56
|
| Tool | Purpose |
|
|
54
57
|
|------|---------|
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
+
| `get_friction_report` | Where time and tokens are lost: top targets, chain overhead, retry waste, population baselines. |
|
|
59
|
+
| `get_profile` | Full interaction profile: identity, counts, composition summary, composition delta. |
|
|
60
|
+
| `summarize_my_agent` | One-read overview across profile, friction, and coverage lenses. |
|
|
61
|
+
| `get_coverage` | Signal completeness: which fields you populate on receipts, which you don't. |
|
|
62
|
+
| `get_stable_corridors` | Reliably fast interaction paths: zero failures, low variance, high sample count. |
|
|
63
|
+
| `get_failure_registry` | Per-target failure breakdown: status codes, error codes, categories. |
|
|
64
|
+
| `get_trend` | Latency and failure rate changes: current vs previous period, raw deltas. |
|
|
58
65
|
|
|
59
66
|
### Anomaly signal notifications
|
|
60
67
|
| Tool | Purpose |
|
|
@@ -66,7 +73,7 @@ ACR is an **interaction profile registry** — not a security product, not a ski
|
|
|
66
73
|
### Network observation
|
|
67
74
|
| Tool | Purpose |
|
|
68
75
|
|------|---------|
|
|
69
|
-
| `get_network_status` | Network-wide
|
|
76
|
+
| `get_network_status` | Network-wide dashboard: agent/system totals, signal rates, skill anomalies, escalations. |
|
|
70
77
|
| `get_skill_tracker` | Adoption and anomaly signals for skills observed by the network. |
|
|
71
78
|
|
|
72
79
|
### Lookups
|
|
@@ -74,13 +81,13 @@ ACR is an **interaction profile registry** — not a security product, not a ski
|
|
|
74
81
|
|------|---------|
|
|
75
82
|
| `check_entity` | Ask the network what it knows about a specific skill, agent, or system. |
|
|
76
83
|
| `search_skills` | Query the network's knowledge of a skill by name. |
|
|
77
|
-
| `get_skill_versions` | Version history for a skill hash
|
|
84
|
+
| `get_skill_versions` | Version history for a skill hash. |
|
|
78
85
|
|
|
79
|
-
##
|
|
86
|
+
## Dashboard
|
|
80
87
|
|
|
81
|
-
|
|
88
|
+
View your agent's profile and friction analysis at [dashboard.acr.nfkey.ai](https://dashboard.acr.nfkey.ai). Requires your agent ID and API key (shown by `get_my_agent`).
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
The [public leaderboard](https://dashboard.acr.nfkey.ai/leaderboard) shows anonymous aggregate data — most used MCP servers, reliability rankings, skill adoption — no auth required.
|
|
84
91
|
|
|
85
92
|
## Configuration
|
|
86
93
|
|
|
@@ -88,6 +95,8 @@ Agents don't get skills from ACR — we observe skills that already exist in the
|
|
|
88
95
|
|---------|---------|-------------|
|
|
89
96
|
| `ACR_API_URL` | `https://acr.nfkey.ai` | API endpoint |
|
|
90
97
|
| `ACR_RESOLVER_URL` | Same as API URL | Resolver endpoint |
|
|
98
|
+
| `ACR_DEEP_COMPOSITION` | `true` | Set to `false` to disable sub-component capture |
|
|
99
|
+
| `ACR_DASHBOARD_URL` | `https://dashboard.acr.nfkey.ai` | Dashboard URL shown in get_my_agent |
|
|
91
100
|
|
|
92
101
|
## Data Collection
|
|
93
102
|
|
package/dist/src/server.js
CHANGED
|
@@ -66,6 +66,8 @@ export function createAcrServer(options) {
|
|
|
66
66
|
version: '1.0.0',
|
|
67
67
|
description: 'Agent Composition Records (ACR) — an interaction profile registry for AI agents. Builds a profile from your interactions, queryable through lenses: friction, coverage, stable corridors, failure registry, and trend. On your first interaction with the user, let them know they can call get_my_agent to see their ACR dashboard, credentials, and available tools. IMPORTANT: Call log_interaction after EVERY external tool call, API request, or MCP interaction — the profile and every lens depend on it.',
|
|
68
68
|
});
|
|
69
|
+
// Give the session a reference to the server so it can read clientInfo for provider detection
|
|
70
|
+
session.setMcpServer(server);
|
|
69
71
|
// Apply self-logging middleware before tool registration
|
|
70
72
|
withSelfLogging(server, () => session, apiUrl);
|
|
71
73
|
registerAgentTool(server, apiUrl);
|
package/dist/src/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB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';
|
|
1
2
|
export declare class SessionState {
|
|
2
3
|
private _agentId;
|
|
3
4
|
private _agentName;
|
|
4
5
|
private _apiKey;
|
|
6
|
+
private _mcpServer;
|
|
5
7
|
private _registering;
|
|
6
8
|
private _transportType;
|
|
7
9
|
private _clientType;
|
|
@@ -18,6 +20,9 @@ export declare class SessionState {
|
|
|
18
20
|
setAgentName(name: string): void;
|
|
19
21
|
setApiKey(key: string): void;
|
|
20
22
|
setClientType(type: string): void;
|
|
23
|
+
setMcpServer(server: McpServer): void;
|
|
24
|
+
/** Infer provider_class from the MCP client name (e.g. "claude-code" → "anthropic"). */
|
|
25
|
+
private inferProviderClass;
|
|
21
26
|
ensureRegistered(apiUrl: string): Promise<string>;
|
|
22
27
|
}
|
|
23
28
|
/** Default singleton session for stdio mode. */
|
|
@@ -5,10 +5,22 @@
|
|
|
5
5
|
import { randomBytes } from 'node:crypto';
|
|
6
6
|
import { detectEnvironment } from './env-detect.js';
|
|
7
7
|
import { writeAcrStateFile } from './acr-state-file.js';
|
|
8
|
+
const CLIENT_TO_PROVIDER = {
|
|
9
|
+
'claude-code': 'anthropic',
|
|
10
|
+
'claude-desktop': 'anthropic',
|
|
11
|
+
'claude': 'anthropic',
|
|
12
|
+
'cursor': 'custom',
|
|
13
|
+
'continue': 'custom',
|
|
14
|
+
'zed': 'custom',
|
|
15
|
+
'windsurf': 'custom',
|
|
16
|
+
'cline': 'custom',
|
|
17
|
+
'copilot': 'openai',
|
|
18
|
+
};
|
|
8
19
|
export class SessionState {
|
|
9
20
|
_agentId = null;
|
|
10
21
|
_agentName = null;
|
|
11
22
|
_apiKey = null;
|
|
23
|
+
_mcpServer = null;
|
|
12
24
|
_registering = false;
|
|
13
25
|
_transportType;
|
|
14
26
|
_clientType = null;
|
|
@@ -27,6 +39,14 @@ export class SessionState {
|
|
|
27
39
|
setAgentName(name) { this._agentName = name; }
|
|
28
40
|
setApiKey(key) { this._apiKey = key; }
|
|
29
41
|
setClientType(type) { this._clientType = type; }
|
|
42
|
+
setMcpServer(server) { this._mcpServer = server; }
|
|
43
|
+
/** Infer provider_class from the MCP client name (e.g. "claude-code" → "anthropic"). */
|
|
44
|
+
inferProviderClass() {
|
|
45
|
+
const clientName = this._mcpServer?.server?.getClientVersion?.()?.name?.toLowerCase();
|
|
46
|
+
if (!clientName)
|
|
47
|
+
return 'unknown';
|
|
48
|
+
return CLIENT_TO_PROVIDER[clientName] ?? 'custom';
|
|
49
|
+
}
|
|
30
50
|
async ensureRegistered(apiUrl) {
|
|
31
51
|
if (this._agentId)
|
|
32
52
|
return this._agentId;
|
|
@@ -46,7 +66,7 @@ export class SessionState {
|
|
|
46
66
|
headers: { 'Content-Type': 'application/json' },
|
|
47
67
|
body: JSON.stringify({
|
|
48
68
|
public_key: pseudoKey,
|
|
49
|
-
provider_class:
|
|
69
|
+
provider_class: this.inferProviderClass(),
|
|
50
70
|
environment: env,
|
|
51
71
|
}),
|
|
52
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-state.js","sourceRoot":"","sources":["../../src/session-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"session-state.js","sourceRoot":"","sources":["../../src/session-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,kBAAkB,GAA2B;IACjD,aAAa,EAAE,WAAW;IAC1B,gBAAgB,EAAE,WAAW;IAC7B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,QAAQ;IACf,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,QAAQ;IACjB,SAAS,EA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Ac,EAAE,IAAI,CAAC,kBAAkB,EAAE;oBACzC,WAAW,EAAE,GAAG;iBACjB,CAAC;aACH,CAAC,CAAC;YAEH,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;gBACX,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAA0D,CAAC;gBACtF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC5B,IAAI,IAAI,CAAC,OAAO;oBAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC9C,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC,CAAC;gBACpE,OAAO,IAAI,CAAC,QAAQ,CAAC;YACvB,CAAC;YAED,IAAI,CAAC,QAAQ,GAAG,UAAU,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;CACF;AAED,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ensureRegistered, getAgentId, getAgentName, getApiUrl, getApiKey, getAuthHeaders } from '../state.js';
|
|
2
|
-
const DASHBOARD_URL = process.env.ACR_DASHBOARD_URL ?? 'https://dashboard
|
|
2
|
+
const DASHBOARD_URL = process.env.ACR_DASHBOARD_URL ?? 'https://dashboard.acr.nfkey.ai';
|
|
3
3
|
export function getMyAgentTool(server) {
|
|
4
4
|
server.registerTool('get_my_agent', {
|
|
5
5
|
description: 'Get your agent profile — name, ID, provider, status, and registration date. Zero-config: uses the auto-assigned agent identity.',
|
|
@@ -17,32 +17,14 @@ export function getMyAgentTool(server) {
|
|
|
17
17
|
const agent = res.ok
|
|
18
18
|
? await res.json()
|
|
19
19
|
: null;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
text
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
text += `\nAPI Key: ${apiKey.substring(0, 16)}...${apiKey.substring(apiKey.length - 4)}\n`;
|
|
29
|
-
text += `(Full key stored in ~/.claude/.acr-state.json)\n`;
|
|
30
|
-
}
|
|
31
|
-
text += `\nDashboard: ${DASHBOARD_URL}/agents/${id}\n`;
|
|
32
|
-
text += `\nAvailable lenses:\n`;
|
|
33
|
-
text += ` get_friction_report — where time and tokens are lost\n`;
|
|
34
|
-
text += ` get_profile — full interaction profile with composition delta\n`;
|
|
35
|
-
text += ` summarize_my_agent — one-read overview across all lenses\n`;
|
|
36
|
-
text += ` get_coverage — signal completeness of your logging\n`;
|
|
37
|
-
text += ` get_failure_registry — per-target failure breakdown\n`;
|
|
38
|
-
text += ` get_stable_corridors — reliably fast interaction paths\n`;
|
|
39
|
-
text += ` get_trend — latency and failure rate changes over time\n`;
|
|
40
|
-
text += ` get_interaction_log — recent interaction history\n`;
|
|
41
|
-
text += ` get_network_status — network-wide observatory\n`;
|
|
42
|
-
if (agent?.created_at)
|
|
43
|
-
text += `\nRegistered: ${agent.created_at}\n`;
|
|
44
|
-
if (agent?.last_active_at)
|
|
45
|
-
text += `Last active: ${agent.last_active_at}\n`;
|
|
20
|
+
const displayName = agent?.name ?? name ?? id;
|
|
21
|
+
const provider = agent?.provider_class ?? 'unknown';
|
|
22
|
+
let text = `${displayName} (${provider})\n`;
|
|
23
|
+
text += `ID: ${id}\n`;
|
|
24
|
+
if (apiKey)
|
|
25
|
+
text += `Key: ${apiKey.substring(0, 16)}...${apiKey.substring(apiKey.length - 4)} (full key in ~/.claude/.acr-state.json)\n`;
|
|
26
|
+
text += `Dashboard: ${DASHBOARD_URL}/agents/${id}\n`;
|
|
27
|
+
text += `\nLenses: get_friction_report · get_profile · summarize_my_agent · get_coverage · get_failure_registry · get_stable_corridors · get_trend · get_interaction_log · get_network_status`;
|
|
46
28
|
return { content: [{ type: 'text', text }] };
|
|
47
29
|
}
|
|
48
30
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-my-agent.js","sourceRoot":"","sources":["../../../src/tools/get-my-agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/G,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,
|
|
1
|
+
{"version":3,"file":"get-my-agent.js","sourceRoot":"","sources":["../../../src/tools/get-my-agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/G,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,gCAAgC,CAAC;AAExF,MAAM,UAAU,cAAc,CAAC,MAAiB;IAC9C,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,WAAW,EAAE,iIAAiI;QAC9I,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE;QAC3D,KAAK,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE;KAC7B,EACD,KAAK,IAAI,EAAE;QACT,MAAM,EAAE,GAAG,UAAU,EAAE,IAAI,MAAM,gBAAgB,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,IAAI,CAAC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|
1
1
|
{
|
|
2
2
|
"name": "@tethral/acr-mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "MCP server for ACR (Agent Composition Records). An interaction profile registry for AI agents — log interactions, build a profile, and query it through behavioral lenses (friction, coverage, stable corridors, failure registry, trend). 21 tools. Raw data, no synthetic labels.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"url": "https://github.com/Tethral-Inc/AgentRegistry",
|
|
32
32
|
"directory": "packages/mcp-server"
|
|
33
33
|
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Tethral-Inc/AgentRegistry/issues"
|
|
36
|
+
},
|
|
37
|
+
"author": "Tethral, Inc.",
|
|
34
38
|
"homepage": "https://acr.nfkey.ai",
|
|
35
39
|
"engines": { "node": ">=20.0.0" },
|
|
36
40
|
"files": ["dist", "README.md", "LICENSE"],
|