← Back to Docs

Build an MCP Server

What is MCP?

The Model Context Protocol (MCP) lets AI agents connect to external services through standardized tool interfaces. An MCP server exposes tools that any compatible AI IDE (Claude Code, Cursor, Windsurf) can discover and invoke.

Quick Start with FastMCP

# server.py
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("my-server")

@mcp.tool()
async def analyze_logs(
    path: str,
    severity: str = "ERROR"
) -> str:
    """Search log files for entries matching severity level."""
    # Your implementation here
    return f"Found 42 {severity} entries in {path}"

@mcp.tool()
async def get_metrics(
    service: str,
    period: str = "1h"
) -> str:
    """Fetch service metrics for a given time period."""
    # Your implementation here
    return f"Metrics for {service} over {period}: ..."

if __name__ == "__main__":
    mcp.run(transport="stdio")

Project Structure

mcp-my-server/
├── server.py           # FastMCP server (entry point)
├── manifest.json       # Package metadata + pricing
├── requirements.txt    # Python dependencies
├── Dockerfile          # Container for distribution
├── install.sh          # One-click install script
├── test_server.py      # Tests for each tool
├── LICENSE             # Commercial license
└── README.md           # Marketplace listing

Containerize

# Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY server.py .
CMD ["python", "server.py"]

$ docker build -t mikep/my-server-mcp .

$ docker push mikep/my-server-mcp

Install Script

Make it dead simple for buyers to install:

#!/bin/bash
# install.sh — One-click MCP server install
claude mcp add my-server -- docker run -i mikep/my-server-mcp
echo "Installed! Restart Claude Code to use."

Pricing Guidelines

Recommended MCP server pricing:

  • Simple utility server (1-3 tools): $19-29 one-time
  • Professional server (5-10 tools): $39-69 one-time
  • Enterprise server (10+ tools, SLA): $99-299/month

You receive 70% of every sale.

Use the Scaffold Skill

The fastest way to create a new MCP server is with our built-in scaffold:

$claude "Use mcp-product-scaffold to create a DevOps MCP server"

Generated: mcp-devops-server/ with 6 tools, Dockerfile, tests, and README