◆ docs

API & automation

rickub exposes a token-authenticated JSON API and a hosted MCP endpoint, so scripts, services, and AI agents can drive it.

Get a token

Create a personal access token under Settings → Access tokens. Send it as a bearer token on every request.

Base URL & shape

The JSON API is versioned and lives under /api/v1. Requests and responses are JSON:

# Who am I?
curl -H "Authorization: Bearer $RICKUB_TOKEN" \
  https://rickub.com/api/v1/user

# Create a repository
curl -X POST \
  -H "Authorization: Bearer $RICKUB_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-project","visibility":"private"}' \
  https://rickub.com/api/v1/repos

# List a repository's merge requests
curl -H "Authorization: Bearer $RICKUB_TOKEN" \
  https://rickub.com/api/v1/repos/your-handle/my-project/merge-requests

Endpoints cover repositories, collaborators, merge requests, CI runs, organizations, code contents, and search — the same surface the CLI is built on.

Hosted MCP endpoint

For AI agents and integrations, rickub hosts a Model Context Protocol endpoint at /api/mcp. It uses the same bearer-token authentication as the JSON API, so an agent with a token can read and act on your repositories through a standard MCP client.

Point a config-file MCP client (e.g. Claude Desktop or Claude Code) at the remote endpoint, passing your token as a bearer credential:

{
  "mcpServers": {
    "rickub": {
      "url": "https://rickub.com/api/mcp",
      "headers": { "Authorization": "Bearer rickub_pat_xxx" }
    }
  }
}

Or drive it directly over Streamable HTTP (JSON-RPC 2.0) — list the tools, then call one:

# list the available tools
curl -sS https://rickub.com/api/mcp \
  -H "Authorization: Bearer $RICKUB_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# call a tool — here, read a repository's metadata
curl -sS https://rickub.com/api/mcp \
  -H "Authorization: Bearer $RICKUB_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call",
       "params":{"name":"get_repo","arguments":{"owner":"acme","repo":"api"}}}'

Tools cover the same surface as the API — e.g. get_repo, list_dir, get_file, create_merge_request, list_merge_requests, dispatch_workflow, get_run_logs, and search_repos.

Note

Treat tokens like passwords: scope them to what a script needs, store them in environment variables or a secret manager, and revoke any that leak.