|
| 1 | +--- |
| 2 | +name: atxp-git |
| 3 | +description: Git repository hosting for ATXP-authenticated agents — create repos, get authenticated clone/push URLs, and manage repositories on code.storage |
| 4 | +compatibility: Requires Node.js >=18 and npx. Requires git for clone/push operations. |
| 5 | +tags: [git, repository, hosting, code-storage, version-control, source-code, agent-code] |
| 6 | +permissions: |
| 7 | + - network: "git.mcp.atxp.ai (HTTPS only), *.atxp.code.storage (Git over HTTPS)" |
| 8 | + - filesystem: "Cloned repositories are written to the local filesystem by git" |
| 9 | + - credentials: "ATXP_CONNECTION (required for all operations)" |
| 10 | +metadata: |
| 11 | + homepage: https://docs.atxp.ai |
| 12 | + source: https://github.com/atxp-dev/cli |
| 13 | + npm: https://www.npmjs.com/package/atxp |
| 14 | + requires: |
| 15 | + binaries: [node, npx, git] |
| 16 | + node: ">=18" |
| 17 | + env: |
| 18 | + - name: ATXP_CONNECTION |
| 19 | + description: Authentication token for the ATXP API. Required for all git operations. |
| 20 | + required: true |
| 21 | +--- |
| 22 | + |
| 23 | +# ATXP Git — Agent Repository Hosting |
| 24 | + |
| 25 | +ATXP Git gives each agent a private namespace for Git repositories on [code.storage](https://code.storage). Agents can create repos, get authenticated clone/push URLs, and interact with them using standard Git commands. The MCP server handles provisioning and access control — all file operations happen through native Git. |
| 26 | + |
| 27 | +## Ephemeral Remote URLs |
| 28 | + |
| 29 | +**This is the most important concept to understand when using this tool.** |
| 30 | + |
| 31 | +Remote URLs returned by `remote-url` contain a **time-limited JWT** embedded directly in the URL. This means: |
| 32 | + |
| 33 | +1. **URLs expire.** The default TTL is 1 hour (3600 seconds). After expiry, any `git clone`, `git push`, `git pull`, or `git fetch` using that URL will fail with an authentication error. |
| 34 | +2. **URLs are not persistent.** Do **not** store remote URLs in config files, environment variables, or long-lived scripts expecting them to work indefinitely. They are single-use credentials with a short lifespan. |
| 35 | +3. **Refresh when expired.** When a git operation fails with an auth error, get a fresh URL and update the remote: |
| 36 | + |
| 37 | +```bash |
| 38 | +# Get a new writable URL |
| 39 | +npx atxp@latest git remote-url my-project --writable |
| 40 | + |
| 41 | +# Update the existing remote with the new URL |
| 42 | +git remote set-url origin <new-url> |
| 43 | + |
| 44 | +# Retry the operation |
| 45 | +git push |
| 46 | +``` |
| 47 | + |
| 48 | +4. **No separate credential setup needed.** The URL embeds authentication — no `git credential` helper or SSH key configuration is required. |
| 49 | +5. **Read vs. write URLs.** Read-only URLs are free. Writable URLs cost $0.01 (this meters storage growth from pushes). Always request read-only unless you need to push. |
| 50 | + |
| 51 | +### Practical Workflow for Long-Running Tasks |
| 52 | + |
| 53 | +If your task involves multiple git operations over time: |
| 54 | + |
| 55 | +``` |
| 56 | +1. Get a writable URL at the start of your work session |
| 57 | +2. Clone and make changes |
| 58 | +3. Commit and push before the URL expires (within 1 hour) |
| 59 | +4. If you need to push again later, get a fresh URL first |
| 60 | +``` |
| 61 | + |
| 62 | +For tasks that may span multiple hours, request a new URL before each push rather than at the start. The `--ttl` flag can extend expiry up to the server maximum, but planning for refresh is more robust. |
| 63 | + |
| 64 | +## Security Model |
| 65 | + |
| 66 | +- **Repos are private by default** — only the owner can access them. |
| 67 | +- **Public repos** allow read-only access from other authenticated users via `remote-url` with `writable: false`. |
| 68 | +- **Write access** requires repo ownership. No collaborator model — repos are single-owner. |
| 69 | +- **URLs contain credentials** — treat `remote-url` output like a secret. Do not log, echo, or share writable URLs. |
| 70 | +- **Soft-delete** — deleted repos become immediately inaccessible but are permanently removed after 30 days. |
| 71 | + |
| 72 | +## Commands Reference |
| 73 | + |
| 74 | +| Command | Cost | Description | |
| 75 | +|---------|------|-------------| |
| 76 | +| `npx atxp@latest git create <repoName>` | $0.50 | Create a new repository | |
| 77 | +| `npx atxp@latest git list` | Free | List your repositories | |
| 78 | +| `npx atxp@latest git remote-url <repoName>` | Free | Get a read-only authenticated URL | |
| 79 | +| `npx atxp@latest git remote-url <repoName> --writable` | $0.01 | Get a writable authenticated URL | |
| 80 | +| `npx atxp@latest git delete <repoName>` | Free | Soft-delete a repository | |
| 81 | +| `npx atxp@latest git help` | Free | Show help | |
| 82 | + |
| 83 | +### Options |
| 84 | + |
| 85 | +| Option | Applies To | Description | |
| 86 | +|--------|-----------|-------------| |
| 87 | +| `--visibility <private\|public>` | create | Repository visibility (default: private) | |
| 88 | +| `--default-branch <name>` | create | Default branch name (default: main) | |
| 89 | +| `--writable` | remote-url | Request a push-capable URL ($0.01 instead of free) | |
| 90 | +| `--ttl <seconds>` | remote-url | URL expiry in seconds (default: 3600) | |
| 91 | +| `--limit <n>` | list | Max repos to return (default: 20, max: 100) | |
| 92 | +| `--cursor <token>` | list | Pagination cursor from a previous response | |
| 93 | + |
| 94 | +### Repo Naming |
| 95 | + |
| 96 | +Repository names must be lowercase alphanumeric with hyphens and underscores only (e.g., `my-project`, `agent_workspace`). |
| 97 | + |
| 98 | +## Typical Agent Workflow |
| 99 | + |
| 100 | +```bash |
| 101 | +# 1. Create a repository ($0.50) |
| 102 | +npx atxp@latest git create my-app |
| 103 | + |
| 104 | +# 2. Get a writable URL ($0.01) |
| 105 | +npx atxp@latest git remote-url my-app --writable |
| 106 | +# Returns: https://t:eyJ...@atxp.code.storage/userid/my-app.git |
| 107 | + |
| 108 | +# 3. Clone, work, push (standard git) |
| 109 | +git clone <url> |
| 110 | +cd my-app |
| 111 | +# ... make changes ... |
| 112 | +git add . && git commit -m "initial commit" && git push |
| 113 | + |
| 114 | +# 4. Later — URL expired? Get a fresh one |
| 115 | +npx atxp@latest git remote-url my-app --writable |
| 116 | +git remote set-url origin <new-url> |
| 117 | +git push |
| 118 | +``` |
| 119 | + |
| 120 | +## Error Responses |
| 121 | + |
| 122 | +| Scenario | Error message | |
| 123 | +|----------|---------------| |
| 124 | +| Not authenticated | `"ATXP authentication required"` | |
| 125 | +| Repo doesn't exist (or private + not owner) | `"Repository not found"` | |
| 126 | +| Write to another user's repo | `"Permission denied"` | |
| 127 | +| Repo name already taken | `"Repository already exists"` | |
| 128 | +| Service unavailable | `"Service temporarily unavailable. Please retry in a few seconds."` | |
| 129 | +| Git ref conflict | `"Conflict: ... Re-read the current state and retry."` | |
| 130 | + |
| 131 | +## Visibility |
| 132 | + |
| 133 | +| Mode | Owner | Other authenticated users | |
| 134 | +|------|-------|---------------------------| |
| 135 | +| **Private** | Full read/write | No access | |
| 136 | +| **Public** | Full read/write | Read-only (via `remote-url` with read-only default) | |
| 137 | + |
| 138 | +## Rate Limits |
| 139 | + |
| 140 | +- **Per-client:** 120 requests/minute |
| 141 | +- **Per-IP:** 10,000 requests/minute |
| 142 | + |
| 143 | +Exceeding limits returns HTTP 429 with a `Retry-After` hint. |
| 144 | + |
0 commit comments