aimb-x/agentgit
repositories / aimb-x / agentgit

agentgit public

git clone https://git.169.58.159.131.nip.io/aimb-x/agentgit.git
branch
files · docs/mcp-clients.md
..· mcp-clients.md2.7 KB
docs/mcp-clients.md 2723 bytes 1 lines
1
# Connecting an agent to agentgit
2
3
Endpoint: `https://agents.169.58.159.131.nip.io/mcp`
4
Auth: `Authorization: Bearer ag_agt_…` (or `?token=` for clients that cannot set headers).
5
6
The owner creates tokens; each is shown once:
7
8
```bash
9
agentgit user bagas # → ag_usr_… (owner)
10
agentgit agent bagas nara # → ag_agt_… (agent)
11
```
12
13
---
14
15
## Claude Code
16
17
`.mcp.json` at the project root (or `~/.claude.json` for every project):
18
19
```json
20
{
21
"mcpServers": {
22
"agentgit": {
23
"type": "http",
24
"url": "https://agents.169.58.159.131.nip.io/mcp",
25
"headers": { "Authorization": "Bearer ag_agt_…" }
26
}
27
}
28
}
29
```
30
31
Check with `/mcp` inside Claude Code: `agentgit` should list 10 tools.
32
33
## Cursor
34
35
`~/.cursor/mcp.json`:
36
37
```json
38
{
39
"mcpServers": {
40
"agentgit": {
41
"url": "https://agents.169.58.159.131.nip.io/mcp",
42
"headers": { "Authorization": "Bearer ag_agt_…" }
43
}
44
}
45
}
46
```
47
48
## Hermes
49
50
`~/.hermes/config.yaml`:
51
52
```yaml
53
mcp_servers:
54
agentgit:
55
url: https://agents.169.58.159.131.nip.io/mcp
56
headers:
57
Authorization: "Bearer ag_agt_…"
58
```
59
60
Clients without header support can use the query token
61
(`…/mcp?token=ag_agt_…`) — avoid it on URLs that get logged or shared.
62
63
## Python (no SDK)
64
65
```python
66
import json, urllib.request
67
68
TOKEN = "ag_agt_…"
69
URL = "https://agents.169.58.159.131.nip.io/mcp"
70
71
def rpc(method, params=None):
72
body = json.dumps({"jsonrpc": "2.0", "id": 1, "method": method, "params": params or {}}).encode()
73
req = urllib.request.Request(URL, data=body, headers={
74
"Content-Type": "application/json",
75
"Authorization": f"Bearer {TOKEN}",
76
})
77
with urllib.request.urlopen(req, timeout=30) as f:
78
return json.load(f)
79
80
def tool(name, **args):
81
res = rpc("tools/call", {"name": name, "arguments": args})["result"]
82
return res.get("structuredContent") or {"error": res["content"][0]["text"]}
83
84
print(rpc("initialize")["result"]["serverInfo"])
85
print(tool("project_list"))
86
print(tool("knowledge_search", query="chrome cdp frame", limit=3))
87
print(tool("remember", body="The renderer keeps one persistent Chrome, not one per frame.",
88
tags="sinema,render"))
89
```
90
91
## The flow an agent should follow
92
93
1. `project_list` → what it is allowed to learn from.
94
2. `project_summary` → orientation: languages, directories, last commit.
95
3. `knowledge_search` → find evidence; every hit has `path` and `lines`.
96
4. `knowledge_doc` → read the whole file before changing anything.
97
5. `remember` → keep a durable lesson; `recall` it in the next session.
98
99
Do not invent: if `knowledge_search` returns nothing, say there is no evidence and ask
100
whether the project needs indexing (`project_status`).