MCP server

Deploy Algebra MCP Server

Use this guide to run algebra-mcp-server from a published Docker image in GitHub Container Registry (ghcr.io).

Overview

The service exposes:

  • POST /mcp

  • GET /health

  • GET /metrics

By default, the container listens on port 8080.

Examples below use ghcr.io/cryptoalgebra/algebra-mcp-server. Replace the tag if you want to deploy a specific version.

Tooling

Free tools:

  • getTokens

  • approveTokens

  • getPrice

  • quoteSwap

  • getPools

  • getPoolAPR

  • addLiquidityToPool

  • removeLiquidityFromPool

  • getPositions

  • broadcastTx

Paid tools:

  • createPool

x402

createPool is protected with x402. The first unpaid call returns payment requirements. Retry the same request with the signed payment object in x402_payment.

Before You Start

Make sure the target machine has:

  • Docker installed

  • Network access to ghcr.io

  • A valid runtime .env file

You also need a GitHub token that can read packages.

Step 1: Authenticate to GHCR

To pull a private image from GitHub Container Registry, log in first.

Required token

Use a GitHub Personal Access Token (classic) with:

  • read:packages

The GitHub account that owns the token must also have access to the package itself.

Login command

Step 2: Prepare Environment Variables

Create a .env file on the deployment host.

Use .env.example as the source of truth for all supported variables and comments.

Step 3: Pull the Image

Pull the default image:

To pull a specific tag:

ARM hosts

On Apple Silicon or another ARM-based host, you may need to force the image platform if only amd64 is available:

Use --platform linux/amd64 if a normal docker pull or docker run fails because of an architecture mismatch.

Step 4: Run the Container

If you are pinning a specific tag:

ARM hosts: run with explicit platform

Alternative: pass variables inline

If you do not want to use an env file, you can pass variables with -e:

Step 5: Verify the Deployment

Check that the container is running:

Check health:

Expected response:

The MCP endpoint is available at:

References

Last updated