agentgate-mcp 0.3.0 → 0.3.1
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 +11 -0
- package/package.json +1 -1
- package/src/cli.js +28 -0
- package/src/mcp-server.js +14 -7
package/README.md
CHANGED
|
@@ -37,9 +37,20 @@ Opens Chromium — sign into Google, close the browser. Done.
|
|
|
37
37
|
|
|
38
38
|
## Add to Claude Code
|
|
39
39
|
|
|
40
|
+
```bash
|
|
41
|
+
agentgate setup
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
One command — registers the MCP server and auto-approves all tools so Claude never pauses for confirmation.
|
|
45
|
+
|
|
46
|
+
<details>
|
|
47
|
+
<summary>Manual setup</summary>
|
|
48
|
+
|
|
40
49
|
```bash
|
|
41
50
|
claude mcp add agentgate -- agentgate serve
|
|
51
|
+
claude config add allowedTools "mcp__agentgate__*"
|
|
42
52
|
```
|
|
53
|
+
</details>
|
|
43
54
|
|
|
44
55
|
## MCP Tools
|
|
45
56
|
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --disable-warning=ExperimentalWarning
|
|
2
2
|
|
|
3
3
|
import process from 'node:process';
|
|
4
|
+
import { execSync } from 'node:child_process';
|
|
4
5
|
import { BrowserSession } from './browser-session.js';
|
|
5
6
|
import { config, ensureDirs, fileExists } from './config.js';
|
|
6
7
|
import { KeyDatabase } from './db.js';
|
|
@@ -41,16 +42,43 @@ async function main() {
|
|
|
41
42
|
await runDoctor({ db });
|
|
42
43
|
break;
|
|
43
44
|
|
|
45
|
+
case 'setup':
|
|
46
|
+
runSetupClaude();
|
|
47
|
+
break;
|
|
48
|
+
|
|
44
49
|
default:
|
|
45
50
|
process.stderr.write(`Unknown command: ${command}\n\n`);
|
|
46
51
|
process.stderr.write('Usage:\n');
|
|
47
52
|
process.stderr.write(' agentgate login Sign in with Google (opens browser)\n');
|
|
53
|
+
process.stderr.write(' agentgate setup Add to Claude Code + auto-approve tools\n');
|
|
48
54
|
process.stderr.write(' agentgate serve Start MCP server\n');
|
|
49
55
|
process.stderr.write(' agentgate doctor Health check\n\n');
|
|
50
56
|
process.exitCode = 1;
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
|
|
60
|
+
function runSetupClaude() {
|
|
61
|
+
const steps = [
|
|
62
|
+
{ cmd: 'claude mcp add agentgate -- agentgate serve', label: 'Adding MCP server to Claude Code' },
|
|
63
|
+
{ cmd: 'claude config add allowedTools "mcp__agentgate__*"', label: 'Auto-approving AgentGate tools' }
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
for (const { cmd, label } of steps) {
|
|
67
|
+
process.stdout.write(`${label}...\n`);
|
|
68
|
+
try {
|
|
69
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
70
|
+
} catch {
|
|
71
|
+
process.stderr.write(`Failed: ${cmd}\n`);
|
|
72
|
+
process.stderr.write('Make sure Claude Code CLI is installed: https://claude.ai/claude-code\n');
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
process.stdout.write('\nDone! AgentGate is ready. Tools will run without approval prompts.\n');
|
|
79
|
+
process.stdout.write('Next: agentgate login\n\n');
|
|
80
|
+
}
|
|
81
|
+
|
|
54
82
|
async function runDoctor({ db }) {
|
|
55
83
|
const checks = {};
|
|
56
84
|
|
package/src/mcp-server.js
CHANGED
|
@@ -28,7 +28,8 @@ const TOOL_DEFS = [
|
|
|
28
28
|
service: { type: 'string', description: 'Service name, e.g. "openai", "twelvelabs"' }
|
|
29
29
|
},
|
|
30
30
|
required: ['service']
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
annotations: { title: 'Check cached API key', readOnlyHint: true, destructiveHint: false, openWorldHint: false }
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
35
|
name: 'open_browser',
|
|
@@ -42,7 +43,8 @@ const TOOL_DEFS = [
|
|
|
42
43
|
url: { type: 'string', description: 'URL to navigate to' }
|
|
43
44
|
},
|
|
44
45
|
required: ['url']
|
|
45
|
-
}
|
|
46
|
+
},
|
|
47
|
+
annotations: { title: 'Open browser', readOnlyHint: false, destructiveHint: false, openWorldHint: true }
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
name: 'browser_action',
|
|
@@ -80,7 +82,8 @@ const TOOL_DEFS = [
|
|
|
80
82
|
}
|
|
81
83
|
},
|
|
82
84
|
required: ['action']
|
|
83
|
-
}
|
|
85
|
+
},
|
|
86
|
+
annotations: { title: 'Browser action', readOnlyHint: false, destructiveHint: false, openWorldHint: true }
|
|
84
87
|
},
|
|
85
88
|
{
|
|
86
89
|
name: 'save_key',
|
|
@@ -92,7 +95,8 @@ const TOOL_DEFS = [
|
|
|
92
95
|
api_key: { type: 'string', description: 'The API key value to store' }
|
|
93
96
|
},
|
|
94
97
|
required: ['service', 'api_key']
|
|
95
|
-
}
|
|
98
|
+
},
|
|
99
|
+
annotations: { title: 'Save API key', readOnlyHint: false, destructiveHint: false, openWorldHint: false }
|
|
96
100
|
},
|
|
97
101
|
{
|
|
98
102
|
name: 'close_browser',
|
|
@@ -100,7 +104,8 @@ const TOOL_DEFS = [
|
|
|
100
104
|
inputSchema: {
|
|
101
105
|
type: 'object',
|
|
102
106
|
properties: {}
|
|
103
|
-
}
|
|
107
|
+
},
|
|
108
|
+
annotations: { title: 'Close browser', readOnlyHint: false, destructiveHint: false, openWorldHint: false }
|
|
104
109
|
},
|
|
105
110
|
{
|
|
106
111
|
name: 'list_my_keys',
|
|
@@ -108,7 +113,8 @@ const TOOL_DEFS = [
|
|
|
108
113
|
inputSchema: {
|
|
109
114
|
type: 'object',
|
|
110
115
|
properties: {}
|
|
111
|
-
}
|
|
116
|
+
},
|
|
117
|
+
annotations: { title: 'List API keys', readOnlyHint: true, destructiveHint: false, openWorldHint: false }
|
|
112
118
|
},
|
|
113
119
|
{
|
|
114
120
|
name: 'revoke_key',
|
|
@@ -119,7 +125,8 @@ const TOOL_DEFS = [
|
|
|
119
125
|
service: { type: 'string', description: 'Service name to revoke' }
|
|
120
126
|
},
|
|
121
127
|
required: ['service']
|
|
122
|
-
}
|
|
128
|
+
},
|
|
129
|
+
annotations: { title: 'Revoke API key', readOnlyHint: false, destructiveHint: true, openWorldHint: false }
|
|
123
130
|
}
|
|
124
131
|
];
|
|
125
132
|
|