convez.ai
PluginDevOps & InfraestruturaIntermediário
mock-server

MockServer MCP

mock-server/mockserver-monorepo

Mock e proxy de APIs para testes, com suporte a IA e chaos testing

Ver no GitHub
ExcelentePluginScore · de 0 a 100

Servidor MCP que expõe MockServer, uma ferramenta completa para mockar APIs HTTP(S), gRPC, WebSockets e APIs de IA (OpenAI, Anthropic, Gemini). Permite criar respostas dinâmicas, proxying com inspeção de tráfego TLS, testes de caos e integra-se nativamente com assistentes de código como Claude.

Instalação

$npx convez-ai mock-server/mockserver-monorepo

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
5,0 mil
Forks
1,1 mil
Acompanhando
116
Saúde
100%
Último commit
há 1 dia
Versão
mockserver-9.3.0
Issues abertas
0
Contribuidores
138

Casos de uso

  • Mockar APIs indisponíveis ou incompletas durante desenvolvimento
  • Proxying e inspeção de tráfego HTTP/HTTPS em tempo real
  • Testes de resiliência injetando latência, erros e conexões lentas
  • Mockar APIs de IA (OpenAI, Anthropic, Gemini) para testes sem custo
  • Verificação de requisições recebidas e ordem de execução

Veredito

MockServer MCP é uma ferramenta profissional e madura para ambientes de teste. Excelente para simular dependências complexas e testar resiliência, especialmente relevante para quem trabalha com IA/LLMs. Requer familiaridade com conceitos de HTTP e proxying, mas oferece retorno significativo em qualidade de testes.

README

A tradução para o português deste README ainda está na fila.

MockServer            Build status GitHub license GitHub stars Artifact Hub

MockServer is an HTTP(S) mock server and proxy for testing, with support for HTTP/2, HTTP/3, gRPC, WebSockets, raw TCP, message brokers like Kafka and MQTT, and AI/LLM APIs such as OpenAI, Anthropic, and Gemini. Mock the APIs your application depends on to develop and test against systems that are unavailable, incomplete, or hard to reproduce; proxy real traffic to record, inspect, and modify requests in flight; and simulate dependencies both working normally and failing — injecting latency, dropped connections, and errors — to test how your application copes either way.

Main Features

  • Mock any API — HTTP/1.1, HTTPS, HTTP/2, HTTP/3, gRPC, gRPC-Web, JSON-RPC, WebSockets, raw TCP, and message brokers (Kafka, MQTT). Match requests on method, path, query, headers, cookies and body (JSON, XML, JSONPath, XPath, regex, OpenAPI) and return configured responses.
  • Proxy & record — port forwarding, web (HTTP) proxy, HTTPS tunneling (CONNECT) and SOCKS, with full visibility of even TLS-encrypted traffic.
  • Dynamic responses — response templating (Velocity, Mustache, JavaScript), class/closure callbacks and webhooks.
  • OpenAPI — generate expectations directly from an OpenAPI/Swagger specification.
  • Verification — assert which requests were received, in what order, and how many times.
  • Chaos & resilience testing — inject latency, dropped/slow connections and failures to test how your system copes with a misbehaving dependency.
  • LLM / AI mocking — mock chat-completion APIs for OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI and Ollama (including streaming), plus a built-in MCP server for AI coding assistants.
  • Live dashboard — watch requests, expectations and logs in real time at /mockserver/dashboard.
  • Clients & integrations — Java, JavaScript/Node, Python and Ruby clients, plus JUnit and Spring support.
  • Run anywhere — Docker, Helm/Kubernetes, JAR or WAR, with optional clustered state for multi-instance deployments.

See the changelog for what has shipped in each version.

Getting started in 60 seconds

Run MockServer with Docker, then mock an endpoint and call it:

# 1. Start MockServer
docker run -d --rm -p 1080:1080 mockserver/mockserver

# 2. Mock an endpoint: GET /hello -> 200 "Hello World"
#    (MockServer exposes a REST control plane on the same port)
curl -X PUT http://localhost:1080/mockserver/expectation \
  -H 'Content-Type: application/json' \
  -d '{
        "httpRequest":  { "method": "GET", "path": "/hello" },
        "httpResponse": { "statusCode": 200, "body": "Hello World" }
      }'

# 3. Call your mock
curl http://localhost:1080/hello
# -> Hello World

…or, on macOS / Linux, install it with Homebrew and run the mockserver command directly:

brew install mockserver
mockserver run --port 1080

One-command recipes

For common end-to-end setups, the examples/docker-compose recipes are a single docker compose up each — mock from an OpenAPI spec, a record/replay proxy, a contract-validating proxy, or a chaos proxy:

cd examples/docker-compose/mock-from-openapi
docker compose up
curl http://localhost:1080/pets

The same can be done from any client library or the dashboard at http://localhost:1080/mockserver/dashboard. For more configuration options see the Docker documentation.

For every way to run MockServer yourself — Docker, docker-compose recipes, the mockserver CLI, the JVM-less binary bundle, Helm/Kubernetes, the JAR, and Testcontainers — see the Self-Hosting MockServer guide.

Documentation

For usage guide please see: www.mock-server.com

Developer Documentation

Architecture, code structure, infrastructure, and operations documentation is available in the docs/ directory.

AI Integration

MockServer includes a built-in MCP server for AI coding assistant integration at /mockserver/mcp. See llms.txt and AI Integration docs.

Change Log

Please see: Change Log

Community

Requirements

Runtime: MockServer 6.x requires Java 17+. The minimum was raised from Java 11 as part of the Jakarta EE 10 / Spring 7 platform modernisation — see the Java 17 / Jakarta upgrade guide. If you are still on Java 11, pin to the 5.15.x line (no longer receiving security updates). The official Docker image already bundles a Java 17 runtime.

Building from source: requires JDK 17+; the produced bytecode targets Java 17.

Security Note: MockServer is a development and testing tool only. See SECURITY.md for important security considerations.

Versions

Maven Central mockserver

Maven Central contains the following MockServer artifacts under the org.mock-server groupId. Every artifact ships in two forms — -no-dependencies (shaded, zero transitive deps, recommended) and the plain form (transitive deps declared in the POM, for the rare case where you need to override versions yourself).

Server:

Java client:

Test framework integrations:

Build-tool plugin:

Tip: The -no-dependencies artifacts bundle all dependencies into a single JAR with packages relocated under shaded_package.*, so they declare zero transitive dependencies. This avoids classpath conflicts with versions of Netty / Jackson / Guava / Bouncy Castle that your project already uses, and it removes the noise from CVE scanners flagging unused transitive dependencies. See the Maven Central page for full coordinates, snapshot repository setup, and the executable jar-with-dependencies form for command-line use.

6.0.0 breaking change: the <classifier>shaded</classifier> form has been removed. Replace mockserver-netty:<version>:shaded with mockserver-netty-no-dependencies:<version> (and likewise for the other shaded artifacts). The replacement produces the same shaded bytes; only the coordinates change.

SNAPSHOT builds are published to the Sonatype Central Portal snapshot repository at https://central.sonatype.com/repository/maven-snapshots/org/mock-server/.

Node Module & Grunt Plugin

NPM Registry contains the following module:

Docker Hub

Docker Hub contains the following artifacts:

Homebrew Homebrew version

MockServer is available in Homebrew (homebrew-core), the package manager for macOS and Linux:

brew install mockserver   # then run: mockserver -serverPort 1080

See the Homebrew install page and the command-line usage guide.

Helm Chart
  • MockServer Helm Chart - installs MockServer into a Kubernetes cluster. The chart is published to the GitHub Container Registry as an OCI artifact (no helm repo add needed):

    helm upgrade --install --create-namespace --namespace mockserver --version 7.0.0 mockserver oci://ghcr.io/mock-server/charts/mockserver
    

    See the Install MockServer Helm Chart guide for all versions and configuration options. A legacy .tgz is also available from www.mock-server.com.

MockServer Clients
Community Tools
Previous Versions
VersionDateGit & Docker Tag / Git HashDocumentationJava APIREST API
7.0.0 (latest)06 Jun 2026mockserver-7.0.0 / 9755e9DocumentationJava API7.0.x REST API
6.1.027 May 2026mockserver-6.1.0 / 33c273DocumentationJava API6.1.x REST API
6.0.020 May 2026mockserver-6.0.0 / 6a254eDocumentationJava API6.0.x REST API
5.15.011 Jan 2023mockserver-5.15.0 / 7c071bDocumentationJava API5.15.x REST API
5.14.022 Aug 2022mockserver-5.14.0 / 808ebaDocumentationJava API5.14.x REST API
5.13.205 Apr 2022mockserver-5.13.2 / 81105bDocumentationJava API5.13.x REST API
5.13.102 Apr 2022mockserver-5.13.1 / 39d1ccDocumentationJava API5.13.x REST API
5.13.017 Mar 2022mockserver-5.13.0 / 604888DocumentationJava API5.13.x REST API
5.12.012 Feb 2022mockserver-5.12.0 / 61747fDocumentationJava API5.12.x REST API
5.11.208 Nov 2020mockserver-5.11.2 / eb84f2DocumentationJava API5.11.x REST API
5.11.122 Jul 2020mockserver-5.11.1 / 361e5cDocumentationJava API5.11.x REST API
5.11.008 Jul 2020mockserver-5.11.0 / 756758DocumentationJava API5.11.x REST API
5.10.024 Mar 2020mockserver-5.10.0 / 14124dDocumentationJava API5.10.x REST API
5.9.001 Feb 2020mockserver-5.9.0 / eacf07DocumentationJava API5.9.x REST API
5.8.123 Dec 2019mockserver-5.8.1 / f0e9abDocumentationJava API5.8.x REST API
5.8.001 Dec 2019mockserver-5.8.0 / 7c9fc5DocumentationJava API5.8.x REST API
5.7.216 Nov 2019mockserver-5.7.2 / 7c9fc5DocumentationJava API5.7.x REST API
5.7.109 Nov 2019mockserver-5.7.1 / 0ca353DocumentationJava API5.7.x REST API
5.7.001 Nov 2019mockserver-5.7.0 / b58bc5DocumentationJava API5.7.x REST API
5.6.121 Jul 2019mockserver-5.6.1 / aec1fbDocumentationJava API5.6.x REST API
5.6.021 Jun 2019mockserver-5.6.0 / 8f82dcDocumentationJava API5.6.x REST API
5.5.426 Apr 2019mockserver-5.5.4 / 4ffd31DocumentationJava API5.5.x REST API
5.5.129 Dec 2018mockserver-5.5.1 / 11d8a9DocumentationJava API5.5.x REST API
5.5.015 Nov 2018mockserver-5.5.0 / 06e6fdDocumentationJava API5.5.x REST API

Issues

If you have any problems, please check the project issues and avoid opening issues that have already been fixed. When you open an issue please provide the following information:

  • MockServer version (i.e. 7.0.0)
  • How your running the MockServer (i.e maven plugin, docker, etc)
  • MockServer log output, at INFO level (or higher)
  • What the error is
  • What you are trying to do

Contributions

Pull requests are, of course, very welcome! Please read our contributing to the project guide first. Then head over to the open issues to see what we need help with. Make sure you let us know if you intend to work on something. Also check out the project roadmap to see what is already in the backlog.

Feature Requests

Feature requests are submitted to GitHub issues and tracked on the project roadmap.

Maintainers

Ver o original no GitHub

Bom para

Relacionados