Labsco
stampchain-io logo

Stampchain MCP Server

from stampchain-io

Interact with Bitcoin Stamps data via the Stampchain API, allowing queries for stamps, collections, and blockchain information.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Stampchain MCP Server

A Model Context Protocol (MCP) server for interacting with Bitcoin Stamps and SRC-20 token data via the Stampchain API. This server provides MCP-compatible clients with tools to query Bitcoin Stamps, collections, and SRC-20 tokens.

Features

  • Bitcoin Stamps Tools: Get stamp details, search stamps, and retrieve recent stamps
  • Stamp Collections: Query collections and search through collection data
  • SRC-20 Tokens: Get token information and search through SRC-20 tokens
  • Type-safe: Built with TypeScript and Zod validation
  • Comprehensive Testing: Full test coverage with CI validation
  • Configurable: Flexible configuration options for different environments
  • Cross-platform: Works on Ubuntu, Windows, and macOS with Node.js 18+

Available Tools

Bitcoin Stamps

  • get_stamp - Get detailed information about a specific stamp by ID
  • search_stamps - Search stamps with various filters (creator, collection, etc.)
  • get_recent_stamps - Get the most recently created stamps

Stamp Collections

  • get_collection - Get detailed information about a specific collection
  • search_collections - Search collections with filters

SRC-20 Tokens

  • get_token_info - Get detailed information about a specific SRC-20 token
  • search_tokens - Search SRC-20 tokens with various filters

Development

Scripts

  • npm run dev - Start development server with hot reload
  • npm run build - Build the TypeScript project
  • npm run test - Run all tests
  • npm run test:watch - Run tests in watch mode
  • npm run test:coverage - Run tests with coverage report
  • npm run typecheck - TypeScript type checking
  • npm run format - Format code with Prettier
  • npm run validate - Full validation suite

Testing

The project includes comprehensive test coverage:

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run in watch mode during development
npm run test:watch

Project Structure

src/
โ”œโ”€โ”€ api/           # API client and related utilities
โ”œโ”€โ”€ config/        # Configuration management
โ”œโ”€โ”€ interfaces/    # TypeScript interfaces
โ”œโ”€โ”€ protocol/      # MCP protocol handlers
โ”œโ”€โ”€ schemas/       # Zod validation schemas
โ”œโ”€โ”€ tools/         # MCP tool implementations
โ”œโ”€โ”€ utils/         # Utility functions
โ”œโ”€โ”€ index.ts       # Main entry point
โ””โ”€โ”€ server.ts      # Server implementation

API Reference

Tool Parameters

All tools accept various parameters for filtering and pagination:

  • limit - Number of results to return (default: 10, max: 100)
  • page - Page number for pagination (default: 1)
  • sort - Sort field and direction (e.g., "created_desc")

Response Format

All tools return structured data with:

  • success - Boolean indicating if the request was successful
  • data - The requested data (stamps, collections, tokens)
  • pagination - Pagination information when applicable
  • error - Error details if the request failed

Development

Test Coverage

This project maintains comprehensive test coverage across multiple areas:

  • โœ… Unit Tests - Core utilities and helper functions
  • โœ… Integration Tests - MCP server functionality
  • โœ… API Validation - Ensures v2.3 API compatibility
  • โœ… Schema Validation - TypeScript and Zod schema alignment
  • โœ… Cross-platform - Tested on Ubuntu, Windows, and macOS
  • โœ… Multi-version - Node.js 18.x, 20.x, and 22.x support
  • โœ… Real API Testing - Validates against live Stampchain API v2.3

Detailed Testing Commands

# Run specific test suites
npm run test:unit         # Unit tests for utilities and helpers
npm run test:integration  # Integration tests for MCP server
npm run test:api         # API validation tests (v2.3 compatibility)
npm run test:tools       # Tool functionality tests
npm run test:schemas     # Schema validation tests

# Advanced testing options
npm run test:ui          # Run tests in UI mode (interactive)
npm run test:ci          # CI test run (includes coverage)
npm run validate         # Full validation (schema + typecheck + format + tests)

Development Workflow

  1. Install dependencies: npm install
  2. Start development server: npm run dev
  3. Run tests in watch mode: npm run test:watch
  4. Validate before commit: npm run validate

Support

Changelog

v0.2.0

  • Stampchain API v2.3 Compatibility: Updated schemas and validation for latest API
  • Enhanced Testing: Comprehensive test suite with cross-platform CI validation
  • Improved Documentation: Professional README with status badges and better organization
  • Simplified Development: Streamlined validation pipeline (TypeScript + Prettier)
  • Bug Fixes: Resolved CI issues and schema validation improvements

v0.1.0

  • Initial release
  • Basic Bitcoin Stamps, Collections, and SRC-20 tools
  • MCP client integration
  • Comprehensive test suite