Markdown 92.4%
JSON 7.6%

1. Overview & Introduction

Markdowncopyraw

PasteMyst MCP Server

What is it?

A Model Context Protocol (MCP) server that brings PasteMyst functionality to AI assistants like Claude. This allows you to create, read, update, and delete code pastes directly through natural language conversations.

Key Features

Paste Management

  • Create public or private pastes
  • Edit existing pastes
  • Delete pastes
  • View paste details
  • Multi-file paste support

👤 User Operations

  • Get user profiles
  • Check if users exist
  • View your own profile and pastes
  • Access starred pastes

🔧 Data & Utilities

  • Language detection by name or extension
  • Expiry time conversion
  • Support for 100+ programming languages

🔐 Authentication

  • Optional API token for advanced features
  • Works without auth for public pastes
  • Secure token handling via environment variables

Why Use It?

  • Seamless Integration: Share code directly from your AI conversations
  • Natural Language: No need to remember API endpoints or commands
  • Multi-file Support: Create pastes with multiple code files
  • Version Control: Edit and update pastes iteratively
  • Privacy Control: Choose between public and private pastes

2. Installation Guide

Markdowncopyraw

Installation & Setup

Prerequisites

  • Node.js (v16 or higher)
  • Bun package manager (recommended) or npm
  • Claude Desktop, Cursor, or VSCode with MCP support

Step 1: Clone/Download

git clone https://github.com/yourusername/pastemyst-mcp.git
cd pastemyst-mcp

Step 2: Install Dependencies

bun install
# or
npm install

Step 3: Build the Project

bun run build
# or
npm run build

This will:

  1. Compile TypeScript to JavaScript
  2. Create the build/ directory
  3. Set proper file permissions

Step 4: Configure MCP Client

For Claude Desktop

Windows: %AppData%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "pastemyst": {
      "command": "node",
      "args": ["C:/absolute/path/to/pastemyst-mcp/build/index.js"],
      "env": {
        "PASTEMYST_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

For Cursor/VSCode

Add to your MCP configuration file (.cursor/mcp.json or similar):

{
  "mcpServers": {
    "pastemyst": {
      "command": "node",
      "args": ["/absolute/path/to/pastemyst-mcp/build/index.js"],
      "env": {
        "PASTEMYST_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

Step 5: Get Your API Token (Optional)

  1. Go to PasteMyst
  2. Log in or create an account
  3. Navigate to Profile → Settings
  4. Copy your API token
  5. Add it to the config as shown above

Note: API token is optional. Without it, you can still:

  • Create public pastes
  • View public pastes
  • Get language information
  • Check if users exist

Step 6: Restart Your Client

Restart Claude Desktop, Cursor, or VSCode to load the new MCP server.

Verification

Test the installation by asking: "What language uses the .py extension?"

If you get a response about Python, you're all set! 🎉

3. Available Tools Reference

Markdowncopyraw

Available Tools & Functions

Paste Operations

get_paste

Retrieve a paste by its ID.

  • Auth Required: Only for private pastes
  • Parameters: id (string)
  • Returns: Paste details, code snippets, metadata

create_paste

Create a new paste on PasteMyst.

  • Auth Required: For private/tagged pastes
  • Parameters:
    • title (optional) - Paste title
    • expiresIn (optional) - never, 1h, 2h, 10h, 1d, 2d, 1w, 1m, 1y
    • isPrivate (optional) - Boolean
    • isPublic (optional) - Display on profile
    • tags (optional) - Array of strings
    • pasties (required) - Array of code snippets
  • Returns: Paste ID and URL

edit_paste

Edit an existing paste.

  • Auth Required: Yes
  • Parameters:
    • id (required) - Paste ID
    • title (optional) - New title
    • isPrivate (optional) - Update privacy
    • isPublic (optional) - Update profile visibility
    • tags (optional) - Update tags
    • pasties (optional) - Complete array of updated pasties
  • Returns: Success confirmation

delete_paste

Permanently delete a paste.

  • Auth Required: Yes
  • Parameters: id (string)
  • Returns: Confirmation
  • Warning: Irreversible!

User Operations

get_current_user

Get your own profile information.

  • Auth Required: Yes
  • Returns: Username, ID, stats, badges

get_user_pastes

List all your paste IDs.

  • Auth Required: Yes
  • Returns: Array of paste URLs

get_user

Get a user's public profile.

  • Auth Required: No
  • Parameters: username (string)
  • Returns: Public profile data

check_user_exists

Check if a username exists.

  • Auth Required: No
  • Parameters: username (string)
  • Returns: Boolean

Data & Utility Operations

get_language_by_name

Get programming language info by name.

  • Auth Required: No
  • Parameters: name (e.g., "Python", "JavaScript")
  • Returns: Mode, MIME types, extensions, color

get_language_by_extension

Identify language from file extension.

  • Auth Required: No
  • Parameters: extension (e.g., "py", "js", "ts")
  • Returns: Language information

convert_expires_in_to_unix_time

Convert expiry duration to timestamp.

  • Auth Required: No
  • Parameters:
    • createdAt - Unix timestamp
    • expiresIn - Duration string
  • Returns: Expiry timestamp and date

4. Usage Examples

Markdowncopyraw

Usage Examples

Basic Paste Creation

Prompt: "Create a paste with a Python hello world program"

Result:

✅ Paste created successfully!
ID: abc123
URL: https://paste.myst.rs/abc123

Multi-File Paste

Prompt: "Create a paste with a Python script and a requirements.txt file"

Result: Creates a paste with two pasties:

  1. main.py (Python code)
  2. requirements.txt (dependency list)

Private Paste

Prompt: "Create a private paste with my API keys configuration"

Note: Requires API token in config

Editing Pastes

Prompt: "Edit paste abc123 and change the title to 'Updated Code'"

Prompt: "Edit this paste to use async/await instead of callbacks"

Retrieving Pastes

Prompt: "Show me the paste with ID xyz789"

Prompt: "Get all my pastes"

Deleting Pastes

Prompt: "Delete paste abc123"

Warning: This is permanent!

Language Queries

Prompt: "What language uses the .ts extension?" Answer: TypeScript

Prompt: "Tell me about the Python language in PasteMyst"

User Queries

Prompt: "Does the user 'codemyst' exist?"

Prompt: "Show me information about user 'codemyst'"

Prompt: "What are my PasteMyst user details?"

Advanced Workflows

Prompt: "Prepare documentation for my project and create a paste"

Prompt: "Create a paste with all popular sorting algorithms"

Prompt: "Create a paste that expires in 1 week with this code: [code]"

Iterative Development

You: Create a paste with a Python fibonacci function
Claude: [Creates paste with basic fibonacci]

You: Edit it to use memoization
Claude: [Updates paste with optimized version]

You: Now add unit tests
Claude: [Adds test cases to the paste]

5. Configuration Guide

JSONcopyraw

6. API Details & Rate Limits

Markdowncopyraw

API Details & Rate Limits

Rate Limiting

Limit: 5 requests per second Response: HTTP 429 (Too Many Requests)

Best Practices:

  • Avoid rapid consecutive requests
  • The MCP server handles this automatically
  • If you hit the limit, wait a second before retrying

Authentication Modes

Without API Token

What you can do:

  • ✅ Create public pastes
  • ✅ View public pastes
  • ✅ Get language information
  • ✅ Check if users exist
  • ✅ View public profiles

What you cannot do:

  • ❌ Create private pastes
  • ❌ Edit/delete pastes
  • ❌ Add tags to pastes
  • ❌ View your profile
  • ❌ List your pastes

With API Token

Full access to all features!

Paste Expiry Options

  • never - Permanent (default)
  • 1h - 1 hour
  • 2h - 2 hours
  • 10h - 10 hours
  • 1d - 1 day
  • 2d - 2 days
  • 1w - 1 week
  • 1m - 1 month
  • 1y - 1 year

Supported Languages

100+ programming languages including:

  • Python, JavaScript, TypeScript, Java, C, C++, C#
  • Go, Rust, Ruby, PHP, Swift, Kotlin, Scala
  • HTML, CSS, SCSS, SQL, Shell, PowerShell
  • Markdown, JSON, YAML, XML, TOML
  • And many more!

Paste Structure

A paste consists of:

  • ID: Unique identifier (e.g., "abc123")
  • Title: Optional title
  • Tags: Array of strings (with auth)
  • Privacy: Public or private
  • Expiry: When it will be deleted
  • Pasties: Array of code snippets

Each pasty has:

  • Title: Optional filename
  • Language: Programming language
  • Code: The actual code content
  • ID: Unique identifier within the paste

7. Troubleshooting & FAQ

Markdowncopyraw

Troubleshooting & FAQ

Common Issues

MCP Server Not Showing Up

Problem: Claude/Cursor doesn't recognize the server

Solutions:

  1. Check the config file path is correct
  2. Ensure you used absolute paths (not relative)
  3. Restart Claude Desktop/Cursor completely
  4. Check for JSON syntax errors in config
  5. Verify the build/ directory exists

"Failed to get paste: Access denied"

Problem: Cannot access a paste

Causes:

  • Trying to access a private paste without auth
  • Invalid paste ID
  • Paste has been deleted

Solution:

  • Verify the paste ID is correct
  • Add API token to config for private pastes

"Invalid or expired token"

Problem: Authentication failing

Solutions:

  1. Re-generate token from PasteMyst settings
  2. Check token is correctly copied (no spaces)
  3. Ensure token is in the "env" section of config
  4. Restart the MCP client after updating token

"Rate limit exceeded"

Problem: HTTP 429 errors

Solution:

  • Wait 1 second before next request
  • Avoid rapid consecutive operations
  • This is a PasteMyst API limit (5 req/sec)

Build Errors

Problem: bun run build fails

Solutions:

  1. Delete node_modules and reinstall
  2. Check TypeScript version (should be 5.x)
  3. Verify all dependencies are installed
  4. Try bun install --force

FAQ

Q: Do I need an API token?

A: No, but you'll have limited functionality. Public paste creation and viewing works without auth.

Q: Can I edit pastes created without auth?

A: No, you need auth to edit/delete any paste, even public ones you created.

Q: How do I get my paste IDs?

A: Use get_user_pastes with auth, or check your PasteMyst profile.

Q: Can I create pastes with multiple files?

A: Yes! Add multiple objects to the pasties array.

Q: What happens when a paste expires?

A: It's permanently deleted from PasteMyst servers.

Q: Can I star pastes through MCP?

A: Not yet - this feature isn't in the current API wrapper.

Q: Is my API token secure?

A: Yes, it's stored locally in your config and only sent to PasteMyst servers.

Q: Can I use this with other AI assistants?

A: Yes! Any MCP-compatible client should work.

Q: How do I update the server?

A: Pull latest changes and run bun run build again.

Q: Where are logs stored?

A: Check your MCP client's logs (Claude Desktop logs in console).

Getting Help

  • PasteMyst API: https://paste.myst.rs/api-docs
  • MCP Documentation: https://modelcontextprotocol.io
  • Issues: File on GitHub repository

Debug Mode

To run in development mode:

bun run dev

This shows detailed error messages and API responses.

8. Project Structure

Markdowncopyraw

Project Structure

pastemyst-mcp/
├── src/
│   └── index.ts              # Main MCP server implementation
├── build/
│   ├── index.js              # Compiled JavaScript
│   └── index.d.ts            # TypeScript definitions
├── scripts/
│   └── fix-permissions.js    # Post-build script
├── package.json              # Dependencies and scripts
├── tsconfig.json             # TypeScript configuration
├── bun.lock                  # Lock file (bun)
├── README.md                 # Basic readme
├── EXAMPLES.md               # Usage examples
└── claude_desktop_config.example.json  # Config template

Key Files

src/index.ts

The main server implementation with:

  • MCP server setup
  • Tool definitions (15 tools)
  • API integration with pastemyst-ts
  • Error handling
  • Response formatting

package.json

Dependencies:

  • @modelcontextprotocol/sdk - MCP protocol implementation
  • pastemyst-ts - PasteMyst API wrapper
  • zod - Schema validation

Dev dependencies:

  • typescript - TypeScript compiler
  • @types/node - Node.js type definitions

tsconfig.json

TypeScript compiler options:

  • Target: ES2022
  • Module: ESNext
  • Output: build/
  • Strict mode enabled

Dependencies

Runtime:

  • Node.js 16+ (for MCP server)
  • @modelcontextprotocol/sdk ^1.0.4
  • pastemyst-ts ^1.1.0
  • zod ^3.23.8

Development:

  • TypeScript ^5.7.2
  • @types/node ^22.10.2
  • Bun (recommended) or npm

Building

The build process:

  1. TypeScript compilation (tsc)
  2. Permission fixing for Unix systems
  3. Outputs to build/ directory

Architecture

The server uses:

  • Stdio transport for MCP communication
  • Zod schemas for parameter validation
  • pastemyst-ts wrapper for API calls
  • Environment variables for authentication

All tools follow the MCP specification and return structured responses with proper error handling.

created at:

stats: 600 lines, 2090 words, 14.54kb