@agentguard47/mcp-server 0.1.0 → 0.2.0
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/LICENSE +1 -1
- package/README.md +54 -0
- package/dist/client.js +1 -1
- package/package.json +5 -3
package/LICENSE
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# AgentGuard MCP Server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server that connects AI coding agents to the AgentGuard Read API. Lets agents query their own traces, alerts, costs, and budget status.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `query_traces` | Search recent traces, filter by service/time range |
|
|
10
|
+
| `get_trace` | Get full event tree for a specific trace ID |
|
|
11
|
+
| `get_alerts` | Get guard alerts (loops, budget exceeded, errors) |
|
|
12
|
+
| `get_usage` | Check event quota usage and plan limits |
|
|
13
|
+
| `get_costs` | Get cost breakdown by model for the current month |
|
|
14
|
+
| `check_budget` | Quick pass/fail budget health check |
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
| Variable | Required | Description |
|
|
19
|
+
|----------|----------|-------------|
|
|
20
|
+
| `AGENTGUARD_API_KEY` | Yes | Bearer token for the Read API (`ag_...`) |
|
|
21
|
+
| `AGENTGUARD_URL` | No | API base URL (defaults to production) |
|
|
22
|
+
|
|
23
|
+
## Setup for Claude Code
|
|
24
|
+
|
|
25
|
+
Add to your Claude Code MCP config:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"agentguard": {
|
|
31
|
+
"command": "node",
|
|
32
|
+
"args": ["/path/to/agent47/mcp-server/dist/index.js"],
|
|
33
|
+
"env": {
|
|
34
|
+
"AGENTGUARD_API_KEY": "ag_your_key_here"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Build & Run
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm ci # Install dependencies
|
|
45
|
+
npm run build # Compile TypeScript
|
|
46
|
+
npm start # Run server (stdio transport)
|
|
47
|
+
npm run dev # Watch mode for development
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Architecture
|
|
51
|
+
|
|
52
|
+
- `src/index.ts` — Server entry point, tool registration (stdio transport)
|
|
53
|
+
- `src/client.ts` — HTTP client wrapping `/api/v1/` endpoints
|
|
54
|
+
- `src/tools.ts` — 6 MCP tool definitions and handlers
|
package/dist/client.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentguard47/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for AgentGuard — query traces, alerts, usage, and costs from AI coding agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc",
|
|
15
15
|
"dev": "tsc --watch",
|
|
16
|
-
"start": "node dist/index.js"
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
21
|
+
"zod": "^3.22.0"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
24
|
"@types/node": "^25.2.2",
|