mocker-mcp

levchenkod/mocker-mcp

3.1

If you are the rightful owner of mocker-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

Mocker - FakerAPI MCP Server is a Model Context Protocol server that proxies the FakerAPI via the MCP protocol, providing predictable random data output.

Mocker - FakerAPI MCP Server

A Model Context Protocol (MCP) server that proxies the FakerAPI via the MCP protocol. Gives a predictable random data output

Demo

Getting Started

Installation

pnpm install

Configuration

Create a .env file in the root directory:

PORT=3000
API_BASE_URL=https://fakerapi.it/api/v1

Building

pnpm build

Running

pnpm start

For development

pnpm dev

Use with Cursor

Run server via Docker

Build image
  docker build -t mocker-mcp .
Run image (optional)
  docker run --rm -i mocker-mcp

Update mcp.json

Go to the Cursor Settings/MCP and click "Add new global MCP server"

{
  "mcpServers": {
    "mocker": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "mocker-mcp"],
    }
  }
}

Restart Cursor

After restart, go to the Cursor Settings/MCP and ensure that the mocker server and tools are available.

Usage

Prompt agent with something like:

Get 3 random persons

or

Get 3 random companies

Troubleshooting

If mocker server shows any errors, go to View/Output and select Cursor MCP

Usage with MCP Clients

import { Client } from "@modelcontextprotocol/sdk/client";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio";

const transport = new StdioClientTransport({
  command: "node",
  args: ["./dist/index.js"],
});

const client = new Client({
  name: "mocker-client",
  version: "1.0.0",
});

await client.connect(transport);

// Get a list of available tools
const tools = await client.listTools();
console.log(tools);

// Call tools
const persons = await client.callTool({
  name: "getPersons",
  arguments: { quantity: 3 },
});
console.log(persons);

// Disconnect
await client.disconnect();