Back to Browse

Opengist MCP Server

by Ni C
Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Read, create, update and delete gists on a self-hosted Opengist instance

About

Read, create, update and delete gists on a self-hosted Opengist instance

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (5/5 approved).

5 files analyzed ยท 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

What You'll Need

Set these up before or after installing:

Base URL of the Opengist instance, e.g. https://gist.example.comOptional

Environment variable: OPENGIST_URL

Opengist Personal Access Token (starts with og_), created under Settings -> Access TokensRequired

Environment variable: OPENGIST_TOKEN

Set to true to not register any write tools (create, update, delete, fork, like)Optional

Environment variable: OPENGIST_READ_ONLY

Set to true to accept self-signed TLS certificates (scoped to the Opengist connection)Optional

Environment variable: OPENGIST_INSECURE_TLS

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-ni-c-opengist-mcp": {
      "env": {
        "OPENGIST_URL": "your-opengist-url-here",
        "OPENGIST_TOKEN": "your-opengist-token-here",
        "OPENGIST_READ_ONLY": "your-opengist-read-only-here",
        "OPENGIST_INSECURE_TLS": "your-opengist-insecure-tls-here"
      },
      "args": [
        "-y",
        "opengist-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

opengist-mcp

CI npm version npm downloads node container docs license

A Model Context Protocol (MCP) server for Opengist, the self-hosted pastebin powered by Git.

Lets MCP clients like Claude Code, Claude Desktop or Codex read, search, create, update and delete gists on your own Opengist instance: file contents and revisions, commit history, forks and likes, plus your user account.

๐Ÿ“– Full documentation at opengist-mcp.ni-c.de

Architecture

Note: this server talks to the Opengist REST API under /api, which is available in recent Opengist releases and enabled by default (api.enabled). A running instance serves its own OpenAPI spec at GET /api/openapi.yaml โ€” compare it against your version if a tool behaves unexpectedly.

Requirements

  • Node.js 22 or newer

  • An Opengist instance with the REST API enabled

  • An Opengist Personal Access Token (Settings โ†’ Access Tokens). Scopes:

    • gist:read โ€” read gists, including your private and unlisted ones
    • gist:write โ€” create, update, delete and fork gists
    • user:read โ€” read your own account
    • user:write โ€” only needed for set_gist_like

    A token without gist:read still works, but the API then silently returns only public gists instead of failing.

Configuration

VariableRequiredDescription
OPENGIST_URLyesBase URL of your instance, e.g. https://gist.example.com. A trailing /api is accepted and stripped.
OPENGIST_TOKENyesPersonal Access Token, starts with og_
OPENGIST_READ_ONLYnotrue registers only the read tools; the write tools do not exist at all in that session
OPENGIST_INSECURE_TLSnotrue accepts self-signed certificates, scoped to the Opengist connection (never process-wide)

The token is read once at startup and then removed from process.env, so it is not visible to child processes. Use https:// for anything but a loopback address โ€” over plain http the token and every gist travel in cleartext.

If your instance's external-url is not configured, the URLs Opengist reports (and this server passes through) point at localhost. Set external-url / OG_EXTERNAL_URL on the instance so links are usable.

Installation

Claude Code

claude mcp add opengist -s user \
  -e OPENGIST_URL=https://gist.example.com \
  -e OPENGIST_TOKEN=og_your_token \
  -- npx -y opengist-mcp

Claude Desktop

claude_desktop_config.json:

{
  "mcpServers": {
    "opengist": {
      "command": "npx",
      "args": ["-y", "opengist-mcp"],
      "env": {
        "OPENGIST_URL": "https://gist.example.com",
        "OPENGIST_TOKEN": "og_your_token"
      }
    }
  }
}

Codex

~/.codex/config.toml:

[mcp_servers.opengist]
command = "npx"
args = ["-y", "opengist-mcp"]
env = { OPENGIST_URL = "https://gist.example.com", OPENGIST_TOKEN = "og_your_token" }

Docker

docker run --rm -i \
  -e OPENGIST_URL=https://gist.example.com \
  -e OPENGIST_TOKEN=og_your_token \
  ghcr.io/ni-c/opengist-mcp:latest

-i is required โ€” the transport is stdio. Do not add -t; a TTY corrupts the protocol stream.

From source

git clone https://github.com/ni-c/opengist-mcp.git
cd opengist-mcp
npm install
npm run build

Tools

Reading

ToolDescription
list_gistsList gists: your own, another user's, all public ones, or liked/forked ones (scope + optional username)
search_gistsFind gists by title, description, topics or owner โ€” a bounded client-side scan (Opengist has no search API)
get_gistGet one gist with its file contents, optionally at a revision; commits and forks on request
get_gist_fileGet the raw content of a single file, at a revision and from an offset โ€” for large or truncated files
list_gist_commitsCommit history of a gist, newest first
list_gist_forksForks of a gist
get_userYour own account, or another user by username or userId
check_gist_likeWhether you liked a gist; distinguishes "not liked" from "not visible to you"

Writing

ToolDescription
create_gistCreate a gist from a list of files. visibility is required; public/unlisted needs a confirmation
update_gistChange title/description/visibility and write or rename files. Cannot delete files
delete_gist_filesDelete files from a gist โ€” needs a confirmation token bound to exactly those filenames
delete_gistDelete a gist permanently โ€” needs a confirmation token
fork_gistFork a gist; reports whether a new fork was created or one already existed
set_gist_likeLike or unlike a gist idempotently (reads the current state first, so a repeat call is not a toggle)

Safety

  • Irreversible actions need a server-generated token. delete_gist, delete_gist_files and widening a gist's visibility refuse the first call and return a random, single-use token that expires after five minutes. A plain confirm: true flag could be set by the model on its own, or be talked into it by text inside a gist; a token that only ever appeared in a previous tool result cannot. The token for delete_gist_files is bound to the exact set of filenames, so a confirmation for one file cannot be replayed to delete another.
  • Publishing content needs the same token. Creating a public or unlisted gist, and writing files into a gist that already is one, are disclosure events: whatever the model has in its context becomes readable by others and cannot be withdrawn from anyone who already saw it. Both refuse the first call. The token is bound to the exact content, so a confirmation for one file cannot be replayed with a second one attached. A call that makes the gist private in the same breath is not a disclosure and needs no token.
  • Confirmations are checked after validation. A call that could not succeed anyway is reported as the input error it is, rather than first costing a confirmation round-trip.
  • Confirmation prompts never quote gist text. Titles, descriptions, topics and filenames are user-supplied and could carry instructions aimed at manufacturing a confirmation, so refusals show only server-side metadata (visibility, file count, dates).
  • update_gist cannot delete a file. The Opengist API deletes a file when its entry is null or carries neither content nor filename โ€” exactly the shape a sloppily built object has. This server therefore never exposes the raw file map; it accepts explicit write/rename operations and asserts before sending that no entry could be read as a deletion. Files you do not mention are left untouched.
  • Typos cannot silently duplicate a file. A write to a filename that does not exist is refused unless allowCreate: true is passed, and the refusal names a case-insensitive near match (readme.md vs README.md).
  • Gist content is untrusted input. Every response that carries file content is tagged with a note saying so. Treat gist text as data, never as instructions.
  • Results are bounded. File contents are capped per file and against an overall budget, commits and forks are omitted by default, binary files are not dumped as text, and every truncation is reported together with the call that fetches the rest. search_gists states how much it scanned and marks incomplete results explicitly.
  • Requests are hardened. Redirects are refused so the bearer token cannot be replayed to another host, every request carries a timeout, path parameters reject ./.. and are URL-encoded, and upstream error bodies are truncated with HTML error pages dropped entirely.
  • Residual risk: OPENGIST_READ_ONLY and the confirmation tokens are client-side guards. The real boundary is the scope of your access token and the permission prompts of your MCP host. A token limited to gist:read/user:read cannot write, whatever the model attempts.

Development

npm install
npm run build
npm test
npm run lint

Releasing

Bump the version in package.json and server.json, move the ## [Unreleased] section of CHANGELOG.md to the new version, commit, then push a tag:

git tag -a v0.1.0 -m "v0.1.0"
git push origin main v0.1.0

The release workflow verifies that the tag matches the package version, publishes to npm via OIDC trusted publishing (no long-lived token), waits for the container image to appear on GHCR, registers the release in the MCP registry and creates a GitHub release from the changelog section.

If the registry step fails, fix it on main and dispatch mcp-registry.yml โ€” never re-run the tagged job, which checks out the immutable tag.

Documentation

The full guide, tool reference and security notes live at opengist-mcp.ni-c.de (source in docs/).

License

MIT

Reviews

No reviews yet

Be the first to review this server!