containerize-mcp-server

containerize-mcp-server is a skill for Claude Code from pjt222/agent-almanac. It costs 86 tokens per session (1,782 once invoked), scanned C, original, MIT.

A guide to packaging an R-based MCP server in a Docker container. Docker bundles the server and its software dependencies so it can run without a local R installation.

In plain words
What is it for?
Use it to create the Dockerfile, install R packages, expose server ports, and choose standard input/output or HTTP communication.
Why use it?
It provides a repeatable way to run and share the server across machines and alongside other containerized services.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Part of the agent-almanac plugin — 122 skills, 77 agents shipped together

Good fit Use it to create the Dockerfile, install R packages, expose server ports, and choose standard input/output or HTTP communication.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pjt222/agent-almanac/containerize-mcp-server
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add pjt222/agent-almanac --skill containerize-mcp-server
Clone the repo
git clone --depth 1 https://github.com/pjt222/agent-almanac

Made for: Claude Code.

Or install agent-almanac, the plugin that ships this one along with the rest of its 122 skills, 77 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for containerize-mcp-server

README.md
[![agentmods](https://agentmods.dev/badge/skills/pjt222/agent-almanac/containerize-mcp-server/github.svg)](https://agentmods.dev/skills/pjt222/agent-almanac/containerize-mcp-server)
Your own site
<a href="https://agentmods.dev/skills/pjt222/agent-almanac/containerize-mcp-server"><img src="https://agentmods.dev/badge/skills/pjt222/agent-almanac/containerize-mcp-server/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for containerize-mcp-server

Your own site · 80×15
<a href="https://agentmods.dev/skills/pjt222/agent-almanac/containerize-mcp-server"><img src="https://agentmods.dev/badge/skills/pjt222/agent-almanac/containerize-mcp-server.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,782 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00086 $0.01782
Opus 5.5 $0.00034 $0.00713
Sonnet 5.5 $0.00017 $0.00356
Haiku 4.5 $0.00009 $0.00178

Measured 1mo ago against content hash 65e1cd3b712d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

containerize-mcp-server scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

&& rm -rf /var/lib/apt/lists/*

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl \
i18n/caveman-lite/skills/containerize-mcp-server/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Containerize MCP Server

Package an R MCP server into a Docker container for portable deployment.

When to Use

  • Deploying an R MCP server without requiring a local R installation
  • Creating a reproducible MCP server environment
  • Running MCP servers alongside other containerized services
  • Distributing an MCP server to other developers

Inputs

  • Required: R MCP server implementation (mcptools-based or custom)
  • Required: Docker installed and running
  • Optional: Additional R packages the server needs
  • Optional: Transport mode (stdio or HTTP)

Procedure

Step 1: Create Dockerfile for MCP Server

FROM rocker/r-ver:4.5.0

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libcurl4-openssl-dev \
    libssl-dev \
    libxml2-dev \
    libgit2-dev \
    libssh2-1-dev \
    git \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Install R packages
RUN R -e "install.packages(c( \
    'remotes', \
    'ellmer' \
    ), repos='https://cloud.r-project.org/')"

# Install mcptools
RUN R -e "remotes::install_github('posit-dev/mcptools')"

# Set working directory
WORKDIR /workspace

# Expose MCP server ports
EXPOSE 3000 3001 3002

# Environment variables
ENV R_LIBS_USER=/workspace/renv/library
ENV RENV_PATHS_CACHE=/workspace/renv/cache

# Default: start MCP server
CMD ["R", "-e", "mcptools::mcp_server()"]

Got: A Dockerfile exists in the project root with rocker/r-ver base image, system dependencies, mcptools installation, and the MCP server as the default command.

If fail: Verify the base image tag matches your R version. If remotes::install_github fails, check that git and libgit2-dev are in the system dependencies layer.

Step 2: Create docker-compose.yml

version: '3.8'

services:
  mcp-server:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: r-mcp-server
    image: r-mcp-server:latest

    volumes:
      - /path/to/projects:/workspace
      - renv-cache:/workspace/renv/cache

    stdin_open: true
    tty: true

    network_mode: "host"

    environment:
      - TERM=xterm-256color
      - R_LIBS_USER=/workspace/renv/library

    restart: unless-stopped

volumes:
  renv-cache:
    driver: local

Read the full file on GitHub · 226 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 226 lines · 86 tokens per session scan C 65e1cd3b712d

Subscribe to this mod's changes

containerize-mcp-server is a skill published in the GitHub repository pjt222/agent-almanac (42 stars, last pushed 2d ago), licensed MIT. It adds 86 tokens to every session and 1,782 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.