MCPClientMock

io.github.Akkshay10由 GitHub 帳號 Akkshay10 發布v1.0.2更新於 Oct 24, 2026

MCP server for James Bloom MockServer - create expectations, verify requests, and manage mock state

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

針對 James Bloom MockServer 的 MCP 伺服器,讓助理建立模擬 HTTP 期望、驗證收到的請求,並清除或重設模擬狀態。

可以做什麼
  • 建立模擬 HTTP 期望,可設定請求比對條件(方法、路徑、查詢參數、標頭、內容)與回應(狀態碼、標頭、內容、延遲、次數、有效期限)
  • 驗證 MockServer 是否收到符合條件的請求,可指定至少、至多或精確次數
  • 依比對條件篩選並取得已記錄的請求
  • 依條件清除或全部清除期望與已記錄請求,並可整體重設 MockServer
  • 查看 MockServer 的連線狀態與設定
適用情境
適合在後端尚未就緒時開發或測試 HTTP 介面,或讓助理針對某個 MockServer 執行個體建立並檢查模擬端點,用於前端與整合測試。
執行需求
需要 Node.js 18 以上版本,透過 npx 或全域 npm 安裝執行。另需一個執行中的 MockServer 執行個體,以環境變數 MOCKSERVER_HOST(預設 localhost)與 MOCKSERVER_PORT(預設 1080)指定。僅支援桌面用戶端。
安裝前請注意
清除與重設工具會刪除目標 MockServer 上的期望與已記錄請求,未帶比對條件的重設會清空全部內容,應指向測試執行個體而非共用執行個體。建立期望會改變伺服器狀態。未宣告任何憑證,但主機設定可將其指向團隊共用伺服器。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MCPClientMock,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mockserver-mcp

An MCP (Model Context Protocol) server for interacting with James Bloom's MockServer. This enables AI assistants to create mock HTTP expectations, verify requests, clear state, and manage MockServer instances programmatically.

Prerequisites

You need a running MockServer instance:

bash
# Using Docker (easiest)docker run -d -p 1080:1080 mockserver/mockserver

Installation

Using npx (recommended)

bash
npx mockserver-mcp

Global installation

bash
npm install -g mockserver-mcpmockserver-mcp

Configuration

Environment Variables

VariableDescriptionDefault
MOCKSERVER_HOSTMockServer hostnamelocalhost
MOCKSERVER_PORTMockServer port1080

MCP Client Configuration

Add to your MCP client configuration file (e.g., Claude Desktop, Kiro, Cursor):

json
{  "mcpServers": {    "mockserver": {      "command": "npx",      "args": ["-y", "mockserver-mcp"],      "env": {        "MOCKSERVER_HOST": "localhost",        "MOCKSERVER_PORT": "1080"      }    }  }}

For shared team MockServer, change MOCKSERVER_HOST to your server's address.

Available Tools

mockserver_create_expectation

Create a mock HTTP expectation on MockServer.

Parameters:

  • httpRequest (required): Request matching criteria
    • method: HTTP method (GET, POST, PUT, DELETE, etc.)
    • path: URL path to match
    • queryStringParameters: Query parameters to match
    • headers: Headers to match
    • body: Body matcher with type (STRING, JSON, REGEX, XPATH, JSON_PATH) and value
  • httpResponse: Response configuration
    • statusCode: HTTP status code
    • headers: Response headers
    • body: Response body (string or object)
    • delay: Response delay with timeUnit and value
  • times: How many times to match (remainingTimes, unlimited)
  • timeToLive: Expectation lifetime (timeUnit, timeToLive)

Example:

json
{  "httpRequest": {    "method": "GET",    "path": "/api/users"  },  "httpResponse": {    "statusCode": 200,    "body": { "users": [] }  }}

mockserver_verify

Verify that requests matching criteria were received by MockServer.

Parameters:

  • httpRequest (required): Request matching criteria (same as create_expectation)
  • times: Expected request count
    • atLeast: Minimum number of requests
    • atMost: Maximum number of requests
    • exactly: Exact number of requests

Example:

json
{  "httpRequest": {    "method": "POST",    "path": "/api/orders"  },  "times": {    "atLeast": 1  }}

mockserver_clear

Clear expectations and recorded requests from MockServer.

Parameters:

  • httpRequest (optional): Request matcher to clear specific expectations. If not provided, clears all.

Example:

json
{  "httpRequest": {    "path": "/api/users"  }}

mockserver_reset

Perform a full reset of MockServer, clearing all expectations and recorded requests.

Parameters: None

mockserver_retrieve_requests

Retrieve recorded requests from MockServer.

Parameters:

  • httpRequest (optional): Request matcher to filter recorded requests

Example:

json
{  "httpRequest": {    "method": "GET"  }}

mockserver_status

Get MockServer connection status and configuration.

Parameters: None

Why Mocking?

API mocking enables early testing — start building and testing your frontend or integrations before the backend is ready. No more waiting. Ship faster.

Requirements

  • Node.js >= 18.0.0
  • A running MockServer instance

Links

License

MIT

來源:README.md,提交 d4bf387

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分