MCP server for the homelab pastebin service
Find a file
Claude 35c982ef62 feat: optional bearer-token auth for streamable-http transport
Pure-ASGI middleware requiring Authorization: Bearer <MCP_API_KEY> on every HTTP
request when MCP_API_KEY is set; open/stdio behaviour preserved when unset.
Closes unauthenticated-MCP exposure (HOME-119 P1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:38:17 +00:00
mcp_server.py feat: optional bearer-token auth for streamable-http transport 2026-06-21 20:38:17 +00:00
pyproject.toml Initial commit 2026-06-02 23:07:29 +02:00
README.md Initial commit 2026-06-02 23:07:29 +02:00

pastebin-mcp

MCP server for the homelab pastebin service. Exposes create, read, list, and delete operations as MCP tools so agents can interact with pastebin programmatically.

Tools

Tool Auth required Description
create_paste No Create a paste; returns URL and ID
get_paste No Fetch full paste metadata + content
get_raw No Fetch raw paste text only
list_pastes Yes (API key) List recent pastes with pagination
delete_paste Yes (API key) Permanently delete a paste

Environment variables

Variable Default Description
PASTEBIN_URL http://192.168.0.242:3002 Pastebin service base URL
PASTEBIN_API_KEY (empty) API key for privileged operations
PASTEBIN_MCP_TRANSPORT stdio Transport: stdio, sse, or streamable-http
FASTMCP_HOST 127.0.0.1 Bind host for HTTP transports
FASTMCP_PORT 8000 Bind port for HTTP transports
FASTMCP_STREAMABLE_HTTP_PATH /mcp HTTP path for streamable-http transport

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Run (HTTP / MCP endpoint)

PASTEBIN_MCP_TRANSPORT=streamable-http \
FASTMCP_HOST=0.0.0.0 \
FASTMCP_PORT=8004 \
PASTEBIN_API_KEY=<key> \
python mcp_server.py

Run (stdio for Claude Desktop / claude mcp add)

PASTEBIN_API_KEY=<key> pastebin-mcp

Register globally (HTTP)

claude mcp add --transport http --scope user pastebin-mcp http://192.168.0.242:8004/mcp