Skip to content

Core concepts

How Pastepile MCP works

Architecture of the Pastepile MCP server: a stateless, zero-dependency stdio process that maps four tools onto the public REST API.

2 min read · Updated

The Model Context Protocol is an open standard that lets AI applications call external tools. The Pastepile server (@pastepile/mcp on npm) is the thinnest possible implementation of it: a single stateless process that translates tool calls into requests against the public REST API.

The request flow

your AI client            @pastepile/mcp             pastepile.com
(Claude, Cursor, ...)     (local process)            (REST API)
       |                        |                         |
       |  JSON-RPC over stdio   |                         |
       |----------------------->|                         |
       |     tools/call         |   one HTTPS request     |
       |                        |------------------------>|
       |                        |    JSON response        |
       |   tool result (JSON)   |<------------------------|
       |<-----------------------|                         |
Every tool call is exactly one HTTPS request. The server holds no state between calls.
  • Transport: newline-delimited JSON-RPC 2.0 over stdio, protocol version 2025-06-18. Implemented methods: initialize, tools/list, tools/call, ping.
  • Runtime: pure Node.js 18+, zero dependencies, no build step. The package ships readable source: one transport file and one pure dispatcher.
  • Statelessness: nothing is written to disk and nothing is cached. All persistence is your pastes; kill and restart the process freely.
  • Identification: every request carries a pastepile-mcp/<version> User-Agent, and your API key travels as an X-API-Key header.

Capabilities: tools only, by design

MCP defines three capability types: tools, resources, and prompts. This server implements tools only. Its four tools (save, get, search, list) cover the read and write paths an assistant needs for durable memory, and each maps to one documented REST endpoint. Resources and prompts are not implemented; when that changes, it will be documented here first.

MCP server vs REST API

MCP serverREST API
ConsumerAI assistants, autonomouslyYour scripts and integrations
InterfaceFour tools with model-readable descriptionsDocumented HTTP endpoints and an OpenAPI spec
DefaultsTuned for memory: never expiry, unlisted visibilityYou choose everything per request
ErrorsModel-visible text the assistant can react toHTTP status codes and JSON bodies

Capabilities are identical because the MCP server IS the REST API, packaged for a different consumer. Anything you can automate over HTTP, an assistant can do through MCP.

Related documentation