docs

MCP Servers — Overview

Every API mock adapter has a corresponding MCP server. MCP servers translate MCP tool calls into HTTP requests against the Mimic mock server.

textdata flow
AI Agent  —MCP—>  Mimic MCP Server  —HTTP—>  Mimic Mock Adapter
(Claude)           (adapter-stripe)              (Stripe mock routes)

This matters because many agent frameworks use MCP as their primary tool interface. Mimic MCP servers give agents realistic mock data through the same protocol they’ll use in production.

MCP Setup & Config

With Claude Code

bash
$ claude mcp add mimic-stripe -- npx -y @mimicai/adapter-stripe mcp
​
# With custom URL
$ claude mcp add --env MIMIC_BASE_URL=http://localhost:4100 mimic-stripe -- npx -y @mimicai/adapter-stripe mcp

With Cursor / VS Code

jsonMCP config
{
  "mcpServers": {
    "mimic-stripe": {
      "command": "npx",
      "args": ["-y", "@mimicai/adapter-stripe", "mcp"],
      "env": { "MIMIC_BASE_URL": "http://localhost:4100" }
    },
    "mimic-plaid": {
      "command": "npx",
      "args": ["-y", "@mimicai/adapter-plaid", "mcp"],
      "env": { "MIMIC_BASE_URL": "http://localhost:4100" }
    }
  }
}

With Mimic CLI

The simplest way — configure adapters in mimic.json with mcp: true and mimic host starts everything together:

jsonmimic.json
{
  "apis": {
    "stripe": { "enabled": true, "mcp": true },
    "plaid": { "enabled": true, "mcp": true }
  }
}
bash
$ mimic host
​
 Stripe API    → http://localhost:4101/stripe/v1
 Stripe MCP    → http://localhost:4201/mcp
 Plaid API     → http://localhost:4102/plaid
 Plaid MCP     → http://localhost:4202/mcp
 Ready in 1.4s

Available MCP Servers

All 9 shipped adapters include a full MCP server. Each can be run standalone via npx or started together via mimic host.

AdapterPackageStandalone MCP CommandStatus
Stripe@mimicai/adapter-stripenpx @mimicai/adapter-stripe mcpShipped
Plaid@mimicai/adapter-plaidnpx @mimicai/adapter-plaid mcpShipped
Paddle@mimicai/adapter-paddlenpx @mimicai/adapter-paddle mcpShipped
Chargebee@mimicai/adapter-chargebeenpx @mimicai/adapter-chargebee mcpShipped
GoCardless@mimicai/adapter-gocardlessnpx @mimicai/adapter-gocardless mcpShipped
Lemon Squeezy@mimicai/adapter-lemonsqueezynpx @mimicai/adapter-lemonsqueezy mcpShipped
Recurly@mimicai/adapter-recurlynpx @mimicai/adapter-recurly mcpShipped
RevenueCat@mimicai/adapter-revenuecatnpx @mimicai/adapter-revenuecat mcpShipped
Zuora@mimicai/adapter-zuoranpx @mimicai/adapter-zuora mcpShipped

Official Parity

Mimic MCP tools are designed to match the official MCP servers published by each platform — same tool names, same parameter shapes, same return format. The goal is zero code changes when you swap a Mimic MCP server for the real one.

AdapterBased onCoverage
Stripemcp.stripe.com official serverAll 26 official tools + 4 Mimic extras for payment lifecycle testing
PlaidPlaid API surfaceLink flow, accounts, transactions, balances, identity, auth, holdings, liabilities
PaddlePaddle Billing APIProducts, prices, subscriptions, customers, transactions, discounts
ChargebeeChargebee APISubscriptions, customers, invoices, plans, addons, events
GoCardlessGoCardless APIMandates, payments, customers, bank accounts, payouts, events
Lemon SqueezyLemon Squeezy APIProducts, variants, orders, subscriptions, customers, discounts
RecurlyRecurly APIAccounts, subscriptions, invoices, plans, add-ons, transactions
RevenueCatRevenueCat APISubscribers, entitlements, offerings, purchases, events
ZuoraZuora APIAccounts, subscriptions, orders, invoices, payments, products

Zero migration cost: Agent code that calls mimic-stripe MCP tools works unchanged against the real Stripe MCP server in production — no renames, no schema changes.

Environment Variables

VariableApplies toDescriptionDefault
MIMIC_BASE_URLStandalone binary onlyURL of the mock API server the standalone MCP binary will callhttp://localhost:4100

MIMIC_BASE_URL is only for standalone binary mode. When you run npx @mimicai/adapter-stripe mcp directly, it needs to know where your mock API server is listening. mimic host does not use this variable — it assigns ports internally and wires each MCP server to its own API server automatically.

Build an MCP Server

Each adapter’s MCP implementation lives in src/mcp.ts. The pattern is a registerMyPlatformTools function (used by both mimic host and the standalone binary) plus a startMyPlatformMcpServer function for the standalone path. A thin src/bin/mcp.ts entry point calls the start function.

typescriptsrc/mcp.ts
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
​
// Register tools on any McpServer instance — used by mimic host and standalone mode.
export function registerMyPlatformTools(server: McpServer, baseUrl: string): void {
  server.tool(
    'list_items',
    'List all items in the account.',
    {},
    async () => {
      const res = await fetch(`${baseUrl}/my-platform/items`);
      const data = await res.json();
      return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
    }
  );
​
  server.tool(
    'create_item',
    'Create a new item. Requires title. Optionally set priority.',
    {
      title: z.string().describe('Item title'),
      priority: z.enum(['low', 'medium', 'high']).optional(),
    },
    async (params) => {
      const res = await fetch(`${baseUrl}/my-platform/items`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(params),
      });
      const data = await res.json();
      return { content: [{ type: 'text', text: `Created item ${data.id}` }] };
    }
  );
}
​
// Standalone entry — called by src/bin/mcp.ts.
export async function startMyPlatformMcpServer(): Promise<void> {
  const baseUrl = process.env.MIMIC_BASE_URL ?? 'http://localhost:4100';
  const server = new McpServer({ name: 'mimic-my-platform', version: '0.1.0' });
  registerMyPlatformTools(server, baseUrl);
  const transport = new StdioServerTransport();
  await server.connect(transport);
}
typescriptsrc/bin/mcp.ts
#!/usr/bin/env node
import { startMyPlatformMcpServer } from '../mcp.js';
startMyPlatformMcpServer().catch(console.error);

The registerMyPlatformTools function is also what you pass to registerMcpTools in your adapter class — so mimic host can mount the same tools on its shared MCP server without spawning a separate process.

Tool design tip: Name tools to match the platform's vocabulary. Write descriptions for LLMs, not humans. Return human-readable summaries for write operations, full JSON for reads.

Troubleshooting