Skip to main content
Glama
Simplicity MCP Server

Simplicity MCP Server

Simplicity MCP Server

AI-Native Development Environment for Simplicity Smart Contracts
Built with the Model Context Protocol for seamless integration with AI coding assistants

Tests Coverage License


🎯 Overview

The Simplicity MCP Server bridges the gap between AI-powered development tools and the Simplicity smart contract language on Liquid/Elements. It provides a complete toolkit for compiling, deploying, and interacting with Simplicity contracts directly through conversational AI interfaces like Cursor.

What Makes This Special

  • Zero Configuration - Works out of the box with Cursor IDE

  • No Docker Required - Direct connection to Liquid Testnet via Esplora API

  • Dual Binary Architecture - Intelligent selection between compilation and signing tools

  • Complete Workflow - From contract writing to blockchain deployment in natural language

  • Production Ready - Comprehensive test suite with 100% passing rate


Related MCP server: MIDL MCP Server

πŸš€ Quick Start

Prerequisites

  • Node.js 18+

  • Cursor IDE (or any MCP-compatible editor)

  • Rust/Cargo (for Simplicity tools)

Installation

# Clone the repository
git clone https://github.com/your-org/hackathon-satsconf-2025-mcp.git
cd hackathon-satsconf-2025-mcp

# Install dependencies
npm install

# Build and setup
npm run setup

# Restart Cursor

That's it! The MCP server is now available in Cursor.


πŸ’‘ Usage Examples

Deploy a Contract

Simply ask in Cursor:

"Deploy the empty contract from examples/ to Liquid Testnet"

The AI will:

  1. βœ… Compile the contract using simc

  2. βœ… Generate the contract address

  3. βœ… Request funds from the testnet faucet

  4. βœ… Verify the deployment

  5. βœ… Provide the transaction details

Check Blockchain Status

"What's the current block height on Liquid Testnet?"

Response: Block height: 2169092

Sign and Broadcast Transactions

"Create and sign a transaction to spend from this contract"

The AI will:

  1. βœ… Create a PSET (Partially Signed Elements Transaction)

  2. βœ… Add UTXO data

  3. βœ… Finalize with the Simplicity program

  4. βœ… Extract the signed transaction

  5. βœ… Broadcast to the network


πŸ› οΈ Core Features

Simplicity Tools Integration

Feature

Tool Used

Description

Compilation

simc

Compile .simf files to bytecode

Address Generation

hal-simplicity

Create Liquid addresses from programs

Transaction Signing

hal-simplicity-signer

PSET workflow for signing

Blockchain Queries

Esplora API

Real-time testnet data

Available MCP Tools (49 total)

Category

Count

Examples

Simplicity

17

compile_file, validate, decode

Elements

16

get_blockchain_info, get_transaction

PSET Signing

4

pset_create, pset_finalize, pset_extract

Testnet

2

faucet_request_funds, faucet_check_status

Helpers

10

check_tools, validate_address, list_examples


πŸ“¦ Example Contracts

The repository includes production-ready contract examples:

1. Empty Contract

Purpose: Simplest possible Simplicity program (always approves)
Use Case: Testing infrastructure, learning the basics

2. Timelock Contract

Purpose: Funds locked until a specific block height
Use Case: Vesting schedules, time-delayed payments

3. Hash Time Lock Contract (HTLC)

Purpose: Conditional payment with hash preimage and timeout
Use Case: Atomic swaps, Lightning Network, cross-chain trades

4. Pay-to-Multisig (P2MS)

Purpose: 2-of-3 multisignature wallet
Use Case: Corporate treasuries, joint accounts, DAOs

5. Vault Contract

Purpose: Time-delayed withdrawal protection
Use Case: Cold storage, theft protection


πŸ—οΈ Architecture

Intelligent Binary Selection

The server automatically selects the appropriate tool for each operation:

User Request β†’ MCP Server β†’ Tool Selection
                            β”œβ”€ simc (compilation)
                            β”œβ”€ hal-simplicity (general ops)
                            └─ hal-simplicity-signer (signing)

Example Flow:

  1. Parse program β†’ hal-simplicity (nums-key branch)

  2. Create PSET β†’ hal-simplicity-signer (pset-signer branch)

  3. Finalize PSET β†’ hal-simplicity-signer

  4. Broadcast β†’ Esplora API

No Docker, No Problem

Unlike traditional setups, this server connects directly to Blockstream's public Esplora API:

  • βœ… Instant setup - No blockchain sync required

  • βœ… Zero maintenance - No local node to manage

  • βœ… Always available - 99.9% uptime via Blockstream

  • βœ… Testnet ready - Perfect for development


πŸ“Š Technical Highlights

Code Quality

  • 3,500+ lines of TypeScript

  • 109 comprehensive tests (100% passing)

  • Zero linter errors

  • Type-safe throughout

  • Full test coverage of critical paths

Performance

  • < 2 seconds for contract compilation

  • < 1 second for blockchain queries

  • Instant tool responses via MCP

  • Efficient caching and memoization

Developer Experience

  • Natural language interface via AI

  • Automatic error recovery and helpful messages

  • Step-by-step guidance for complex operations

  • Detailed logging for debugging


πŸ“– Documentation

Getting Started

Advanced

Examples


πŸ”§ Advanced Setup

Install Simplicity Toolchain

# Install simc (Simplicity compiler)
cargo install --git https://github.com/BlockstreamResearch/SimplicityHL.git

# Install hal-simplicity (general operations)
cargo install --git https://github.com/apoelstra/hal-simplicity.git \
  --branch 2025-11/nums-key

# Install hal-simplicity-signer (PSET signing)
cargo install --git https://github.com/apoelstra/hal-simplicity.git \
  --branch 2025-10/pset-signer \
  --bin hal-simplicity

# Rename the signer binary
mv ~/.cargo/bin/hal-simplicity ~/.cargo/bin/hal-simplicity-signer

# Verify installations
simc --version
hal-simplicity --version
hal-simplicity-signer --version

The MCP server automatically detects and uses the appropriate binary for each operation.

See DUAL_BINARY_SETUP.md for detailed information.


πŸ§ͺ Development

Run Tests

npm test              # Run all tests
npm run test:watch    # Watch mode
npm run test:coverage # Coverage report

Build

npm run build         # Build TypeScript
npm run lint          # Check code quality
npm run format        # Format code

Project Structure

hackathon-satsconf-2025-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ config.ts              # Configuration management
β”‚   β”‚   β”œβ”€β”€ esplora-client.ts      # Esplora API client
β”‚   β”‚   β”œβ”€β”€ simplicity-tools.ts    # Simplicity toolchain
β”‚   β”‚   β”œβ”€β”€ handlers.ts            # MCP tool handlers
β”‚   β”‚   └── tools.ts               # MCP tool definitions
β”‚   β”œβ”€β”€ mcp-server.ts              # Main server entry point
β”‚   └── types.ts                   # TypeScript types
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ contracts/                 # Example Simplicity contracts
β”‚   └── witnesses/                 # Witness templates
β”œβ”€β”€ docs/                          # Documentation
└── scripts/                       # Setup scripts

πŸ” Real-World Use Cases

1. Smart Contract Development

Developers can write, compile, and test Simplicity contracts without leaving their IDE.

2. Educational Tool

Perfect for learning Simplicity - ask questions and get immediate feedback.

3. Rapid Prototyping

Test contract ideas quickly on testnet without complex setup.

4. Integration Testing

Validate contract behavior against real blockchain data.

5. Multi-Party Workflows

Enable collaborative development with PSET-based transaction signing.


πŸ› Troubleshooting

Server won't start or "No server info found" error

If you see errors like "No server info found" after restarting Cursor:

# Rebuild the project
cd /path/to/hackathon-satsconf-2025-mcp
npm run build

# Verify the configuration
cat ~/.cursor/mcp.json

The MCP configuration should look like this:

{
  "mcpServers": {
    "simplicity": {
      "command": "node",
      "args": [
        "/absolute/path/to/hackathon-satsconf-2025-mcp/dist/mcp-server.js"
      ],
      "env": {
        "ESPLORA_API_URL": "https://blockstream.info/liquidtestnet/api"
      }
    }
  }
}

If the configuration is incorrect, run:

npm run setup

Then completely restart Cursor (Cmd+Q or Ctrl+Q, then reopen).

Tools not showing in Cursor

  1. Check ~/.cursor/mcp.json exists and has the correct configuration

  2. Verify the server path is correct and file exists

  3. Restart Cursor completely (Cmd+Q or Ctrl+Q)

  4. Check Cursor's MCP logs for errors

API Connection Issues

The server uses Blockstream's public Esplora API. If you experience issues:

For more help, see QUICKSTART.md.


🌟 Innovation Highlights

First of Its Kind

  • First MCP server specifically designed for Simplicity

  • Pioneering AI-native smart contract development

  • Novel approach to blockchain tooling integration

Technical Achievement

  • Dual binary architecture with intelligent selection

  • Complete PSET workflow implementation

  • Zero-configuration deployment pipeline

Developer Impact

  • Reduces contract deployment time from hours to minutes

  • Eliminates need for Docker and local blockchain nodes

  • Makes Simplicity accessible to AI-assisted development


πŸ“„ License

MIT License - see LICENSE file for details.


πŸ™ Acknowledgments

Built for the Simplicity Hackathon at SatsConf 2025.

Special Thanks To

  • Blockstream Research - For creating Simplicity

  • Andrew Poelstra - For hal-simplicity development and guidance

  • Model Context Protocol Team - For the MCP framework

  • Elements Project - For the foundation

  • Simplicity Community - For support and feedback


πŸ”— Resources


Made with ⚑ for the future of Bitcoin smart contracts

Documentation β€’ Examples β€’ Issues

Available Tools

49 tools
analyze_simplicity_in_blockC

Analyze Simplicity usage in a block

Inputs: block_hash (required).

contract_deployB

Complete workflow: compile contract, get address, and optionally fund it

Inputs: contract_file (required), auto_fund.

contract_spendC

Spend funds from a Simplicity contract

Inputs: program (required), witness_file (required), utxo_txid, utxo_vout, +1 more.

decode_simplicity_transactionC

Extract and decode Simplicity programs from a transaction

Inputs: txid (required), output_index.

elements_decode_rawtransactionC

Decode a raw transaction hex

Inputs: hex (required).

elements_generate_blocksA

Generate blocks to a specific address (regtest/testnet only)

Inputs: address (required), nblocks (required).

elements_get_address_infoC

Get address information

Inputs: address (required).

elements_get_asset_infoC

Get asset information

Inputs: asset_id (required).

elements_get_balanceC

Get wallet balance

Inputs: account, minconf.

elements_get_blockC

Get block by hash or height

Inputs: hash, height.

elements_get_blockchain_infoC

Get blockchain information from Elements node

Inputs: no named parameters.

elements_get_block_countA

Get the current block height

Inputs: no named parameters.

elements_get_block_hashC

Get block hash by height

Inputs: height (required).

elements_get_new_addressC

Generate a new address

Inputs: label.

elements_get_pegin_addressC

Get a pegin address

Inputs: no named parameters.

elements_get_transactionC

Get transaction details

Inputs: txid (required), verbose.

elements_list_issuancesB

List all asset issuances

Inputs: no named parameters.

elements_list_transactionsC

List recent transactions

Inputs: skip, count, account.

elements_list_unspentC

List unspent transaction outputs

Inputs: address.

elements_send_to_addressC

Send amount to a given address

Inputs: amount (required), address (required), comment, comment_to.

estimate_simplicity_costC

Estimate execution cost of a Simplicity program

Inputs: program (required).

faucet_check_statusA

Check if Liquid testnet faucet is available

Inputs: no named parameters.

faucet_request_fundsC

Request LBTC from Liquid testnet faucet

Inputs: address (required), asset.

helper_extract_transactionC

Extract transaction hex from hal-simplicity output

Inputs: output (required).

helper_get_example_contractC

Get the content of an example contract

Inputs: name (required).

helper_list_example_contractsB

List available example contracts

Inputs: no named parameters.

helper_validate_addressC

Validate if a string is a valid Liquid address

Inputs: address (required).

pset_createB

Create an empty PSET (Partially Signed Elements Transaction). Uses hal-simplicity-signer (pset-signer branch). This is the first step to build and sign a Simplicity transaction.

Inputs: no named parameters.

pset_extractB

Extract the final signed transaction from a completed PSET. Uses hal-simplicity-signer (pset-signer branch). The resulting transaction can be broadcast to the network.

Inputs: pset (required).

pset_finalizeB

Finalize a PSET by attaching a Simplicity program and witness. Uses hal-simplicity-signer (pset-signer branch). This completes the signing process.

Inputs: pset (required), program (required), witness (required).

pset_update_inputA

Update a PSET input with UTXO data (txid, vout, amount, asset, scriptPubKey). Uses hal-simplicity-signer (pset-signer branch). Required before finalizing the PSET.

Inputs: pset (required), txid (required), vout (required), amount (required), +2 more.

simplicity_analyzeC

Analyze a Simplicity program's properties

Inputs: program (required).

simplicity_check_toolsA

Check if Simplicity tools (simc, hal-simplicity) are installed with detailed installation instructions

Inputs: no named parameters.

simplicity_compile_fileB

Compile a .simf file to Simplicity program using simc compiler

Inputs: file_path (required).

simplicity_compile_sourceC

Compile SimplicityHL source code to Simplicity program

Inputs: source (required).

simplicity_constructD

Construct a Simplicity expression

Inputs: expression (required), context.

simplicity_create_witnessC

Create witness template for a contract type

Inputs: contract_type (required).

simplicity_decodeC

Decode bytes to a Simplicity program

Inputs: data (required), format.

simplicity_decode_programC

Decode a Simplicity program to readable format

Inputs: program (required).

simplicity_encodeC

Encode a Simplicity program to bytes

Inputs: program (required), format.

simplicity_finalizeC

Finalize a ConstructNode to CommitNode

Inputs: construct (required).

simplicity_generate_exampleC

Generate a working Simplicity contract example based on a pattern (minimal, comparison, assertion)

Inputs: pattern (required).

simplicity_get_addressC

Get on-chain address for a Simplicity program using hal-simplicity

Inputs: program (required).

simplicity_get_featuresA

Get detailed information about supported and unsupported simc features, including working jets

Inputs: no named parameters.

simplicity_install_toolsB

Automatically install missing Simplicity tools (simc, hal-simplicity) via cargo

Inputs: no named parameters.

simplicity_suggest_fixB

Get helpful suggestions to fix a simc compilation error based on error message

Inputs: error_message (required).

simplicity_validateC

Validate a Simplicity program

Inputs: program (required).

simplicity_validate_syntaxB

Validate SimplicityHL source code syntax before compiling, with helpful error messages

Inputs: source (required).

verify_simplicity_scriptC

Verify a Simplicity script with optional witness

Inputs: program (required), witness.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.5/5.0

    Scored across 49 tools

    Disambiguation2/5

    Several tools overlap substantially: simplicity_decode vs simplicity_decode_program, simplicity_validate vs simplicity_validate_syntax vs verify_simplicity_script, and simplicity_analyze vs analyze_simplicity_in_block/estimate_simplicity_cost. Category prefixes help, but an agent must read descriptions closely to choose correctly, especially between core Simplicity, PSET, and contract workflows.

    Naming Consistency3/5

    Most tools use snake_case with category prefixes (simplicity_, elements_, pset_, contract_, faucet_, helper_), but several Simplicity transaction helpers break the pattern (decode_simplicity_transaction, verify_simplicity_script, estimate_simplicity_cost, analyze_simplicity_in_block). The prefixes are readable, but there is no single consistent verb_noun convention.

    Tool Count2/5

    49 tools is far beyond the well-scoped 3-15 range and includes many specialized variants and overlapping workflows. The breadth is real, but the set is heavy enough that selection, documentation, and maintenance all suffer.

    Completeness3/5

    The surface covers compile/validate/construct/finalize, address generation, PSET assembly, deploy, spend, faucet, and many Elements queries. However, there is no explicit transaction broadcast tool after PSET extraction, and some lifecycle operations such as contract listing or management are absent.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers