Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/alifanov/scopegate/add-apigit clone --depth 1 https://github.com/alifanov/scopegateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/alifanov/scopegate/add-api)<a href="https://agentmods.dev/commands/alifanov/scopegate/add-api"><img src="https://agentmods.dev/badge/commands/alifanov/scopegate/add-api.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00015 | $0.00985 |
| Opus 5 | $0.00008 | $0.00492 |
| Sonnet 5 | $0.00003 | $0.00197 |
| Haiku 4.5 | $0.00002 | $0.00098 |
Grade A, and why
add-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context
ScopeGate is an MCP gateway that connects AI agents to third-party APIs via OAuth. Each integration requires:
- An OAuth module (
src/lib/{provider}-oauth.ts) - OAuth route handlers (
src/app/api/oauth/{provider}/route.ts+callback/route.ts) - An MCP API wrapper (
src/lib/mcp/{provider}.ts) - MCP tool definitions (
src/lib/mcp/tools.ts) - Permission groups (
src/lib/mcp/permissions.ts) - UI updates for service connection (
src/components/)
The user will specify which API/service to add. Use $ARGUMENTS for the service name.
Your Task
Add a complete API integration for the specified service.
Steps
-
Research the API auth flow
- Search the web for the service's OAuth documentation
- Identify: auth URL, token URL, required scopes, token refresh mechanism
- Check if it uses OAuth 2.0, OAuth 1.0a, or API key auth
- Determine token expiration and refresh strategy
-
Study existing patterns
- Read a similar existing OAuth module (e.g.,
src/lib/threads-oauth.tsfor simple OAuth 2.0,src/lib/google-oauth.tsfor refresh token flows) - Read the corresponding callback route in
src/app/api/oauth/ - Read the MCP wrapper in
src/lib/mcp/ - Note the structure and follow it exactly
- Read a similar existing OAuth module (e.g.,
-
Implement OAuth module (
src/lib/{provider}-oauth.ts)buildAuthUrl()— construct OAuth authorization URL with correct scopesexchangeCodeForTokens()— exchange auth code for access (and refresh) tokensgetUserInfo()— fetch authenticated user info for the account labelgetValidAccessToken()— retrieve + auto-refresh token from DB- Add env vars:
{PROVIDER}_CLIENT_ID,{PROVIDER}_CLIENT_SECRET
-
Implement OAuth routes
src/app/api/oauth/{provider}/route.ts— initiate OAuth flow (redirect to auth URL)src/app/api/oauth/{provider}/callback/route.ts— handle callback, store tokens in DB
-
Implement MCP wrapper (
src/lib/mcp/{provider}.ts)- Create
{provider}Fetch()function that handles auth and API calls - Follow the pattern from existing wrappers (e.g.,
src/lib/mcp/twitter.ts)
- Create
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 80 lines · 15 tokens per session scan A fd026f8b23c5
add-api is a command published in the GitHub repository alifanov/scopegate (15 stars, last pushed yesterday), licensed MIT. It adds 15 tokens to every session and 985 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
awesome-chatgpt
Search awesome-ChatGPT-repositories for open-source GitHub repositories related to ChatGPT and LLMs.
test
Generate comprehensive tests.
commit
智能生成 Git 提交信息并提交.
init
Scaffold a new MindBase project (v2 layout). Usage: /mb:init [template] [-- mission ...].
pr
Handle the full workflow from current branch state to an open, CI-monitored pull request.
doctor.es
Diagnostica problemas de inferencia LLM en Mac: asiai doctor verifica el estado de los motores, conflictos de puertos, carga de modelos y estado de la GPU.