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) |<------------------------|
|<-----------------------| |- 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 anX-API-Keyheader.
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 server | REST API | |
|---|---|---|
| Consumer | AI assistants, autonomously | Your scripts and integrations |
| Interface | Four tools with model-readable descriptions | Documented HTTP endpoints and an OpenAPI spec |
| Defaults | Tuned for memory: never expiry, unlisted visibility | You choose everything per request |
| Errors | Model-visible text the assistant can react to | HTTP 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.