# Gist — how to use (mcp.ai)

Connect your Gist account and use 20 tools for developer tools straight from your AI agent. Connect with your own API key. GitHub Gist is a service provided by GitHub that allows users to share code snippets, notes, and other text-based content. It supports both public and private gists, enabling easy sharing and collaboration.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_gist?ms=1787293500000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `gist_check_gist_star`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/gist`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/gist/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/gist/check/gist/star` — Check if the authenticated user has starred a specific gist. Returns True if the gist is starred, False if not starred or if the gist doesn't exist. This is a read-only, idempotent operation that requ
  - body: { gist_id: string }
- `POST https://api.mcp.ai/api/gist/create/gist` — Tool to create a new gist with one or more files. Use when you need to create a code snippet or text file to share. Note: Do not name your files 'gistfile' with a numerical suffix.
  - body: { files: object, public?: boolean, description?: string }
- `POST https://api.mcp.ai/api/gist/create/gist/comment` — Tool to create a comment on a gist. Use when you need to add a comment to an existing gist.
  - body: { body: string, gist_id: string }
- `POST https://api.mcp.ai/api/gist/delete/gist` — Tool to delete a gist. Use when you have a gist_id and want to permanently remove that gist. Example prompt: "Delete gist 'aa5a315d61ae9438b18d'".
  - body: { gist_id: string }
- `POST https://api.mcp.ai/api/gist/delete/gist/comment` — Tool to delete a comment on a gist. Use when you have both the gist_id and comment_id and want to remove that comment. Example prompt: "Delete comment 42 from gist 'aa5a315d61ae9438b18d'".
  - body: { gist_id: string, comment_id: integer }
- `POST https://api.mcp.ai/api/gist/fork/gist` — Tool to fork a gist. Use when you need to create a copy of an existing gist under your own account.
  - body: { gist_id: string }
- `POST https://api.mcp.ai/api/gist/get/gist` — Tool to retrieve a specific gist by its ID. Use when you have a gist_id and need complete gist details.
  - body: { gist_id: string }
- `POST https://api.mcp.ai/api/gist/get/gist/comment` — Tool to get a specific comment on a gist. Use when you need to retrieve details of a particular comment given gist_id and comment_id.
  - body: { gist_id: string, comment_id: integer }
- `POST https://api.mcp.ai/api/gist/get/gist/revision` — Tool to retrieve a specific gist revision. Use when you need details of a past state for an existing gist by commit SHA.
  - body: { sha: string, gist_id: string }
- `POST https://api.mcp.ai/api/gist/list/gist/comments` — Tool to list comments on a gist. Use after confirming the gist_id to retrieve comments for a specific gist. Example: 'List comments for gist abc123'.
  - body: { page?: integer, gist_id: string, per_page?: integer }
- `POST https://api.mcp.ai/api/gist/list/gist/commits` — Tool to list the commit history of a gist. Use after you have the gist ID to review its revisions.
  - body: { page?: integer, accept?: string, gist_id: string, per_page?: integer }
- `POST https://api.mcp.ai/api/gist/list/gist/forks` — Tool to list forks of a gist. Use after obtaining a gist_id to retrieve all forks for the gist.
  - body: { page?: integer, gist_id: string, per_page?: integer }
- `POST https://api.mcp.ai/api/gist/list/gists` — Tool to list the authenticated user's gists or all public gists if called anonymously. Use after setting a valid GitHub token in headers.
  - body: { page?: integer, since?: string, accept?: string, per_page?: integer }
- `POST https://api.mcp.ai/api/gist/list/public/gists` — Tool to list public gists sorted by most recently updated. Use when you need to discover recent public gists. Note: with pagination, you can fetch up to 3000 gists.
  - body: { page?: integer, since?: string, per_page?: integer }
- `POST https://api.mcp.ai/api/gist/list/starred/gists` — Tool to list the authenticated user's starred gists. Use when you need to retrieve all gists the user has starred.
  - body: { page?: integer, since?: string, accept?: string, per_page?: integer }
- `POST https://api.mcp.ai/api/gist/list/user/gists` — Tool to list public gists for a specified GitHub user. Use when you have a username and need their gists.
  - body: { page?: integer, since?: string, per_page?: integer, username: string }
- `POST https://api.mcp.ai/api/gist/star/gist` — Star a GitHub gist. This operation is idempotent and will succeed even if the gist is already starred.
  - body: { gist_id: string }
- `POST https://api.mcp.ai/api/gist/unstar/gist` — Unstar a GitHub gist. This operation is idempotent and will succeed even if the gist is not currently starred.
  - body: { gist_id: string }
- `POST https://api.mcp.ai/api/gist/update/gist` — Tool to update a gist's description and files. Use when you need to modify gist content, rename files, or delete files from a gist.
  - body: { files?: object, gist_id: string, description?: string }
- `POST https://api.mcp.ai/api/gist/update/gist/comment` — Tool to update a Gist comment. Updates an existing comment on a gist. You must be the author of the comment to update it.
  - body: { body: string, gist_id: string, comment_id: integer }

## Example prompts
- "What can I do in Gist?"
- "Show me a summary of my Gist account"

## More
- Page: https://mcp.ai/gist
- Agent spec (llms.txt): https://mcp.ai/gist/llms.txt
- Postman collection: https://mcp.ai/gist/postman.json
