api-testing-mcp

api-testing-mcp

Enables HTTP API testing (GET, POST, PUT, DELETE) via the Model Context Protocol, powered by Playwright.

Category
Visit Server

README

<p align="center"> <img src="./documentation/screen-shots/mcp-logo.png" alt="MCP LOGO" width=400 height=400> </p>

API Testing Using MCP Server (End User Guide)

A ready-to-use Model Context Protocol (MCP) server for HTTP API testing, powered by Playwright. This guide helps you install, configure, and run the MCP server locally as an npm package. <br> <br>

πŸ“‹ Table of Contents

🌟 Overview

The Playwright API MCP Server enables API testing via the Model Context Protocol. It supports GET, POST, PUT, and DELETE requests.

<br> <br>

πŸ“‹ Prerequisites

  • Node.js: v18.0.0 or higher.
  • npm: Comes with Node.js.
  • VS Code: MCP-compatible client.
  • Github Copilot: Make sure the GitHub Copilot extension is installed and enabled in VS Code.<br> Watch the video to understand how to enable Github Copilot: https://www.youtube.com/watch?v=etP5wq4Zl20
  • How to use Github Copilot for free Watch the Video: https://www.youtube.com/watch?v=X_Aet9ndh_Y <br> <br>

πŸš€ Setup

  1. Create a Node.js Project in VS Code:

    • Create a new folder with a meaningful name (e.g. my-project).
    • Open the folder in Visual Studio Code.
    • Launch the integrated terminal (via View > Terminal).
    • Choose your preferred shell (e.g. Git Bash, Command Prompt, or PowerShell).
    • Run the following command to initialise the project:
      npm init -y
      
    • This will generate a package.json file with default settings <br>
  2. Install the MCP Server Package

    • Now, run the below command to install the mcp server package.
      npm i @automate-io/api-testing-mcp@latest
      

<br>

βš™οΈ Configurations

  1. Open your project folder in VS Code

  2. If the mcp.json file does not already exist, create it inside the root/.vscode/ directory. If the file is already present, you can skip this step

  3. Add the api-testing-mcp configuration under the servers key in the mcp.json file, as shown below

    <img src="./documentation/screen-shots/mcp-client-config-v2.png" alt="MCP Client Config">

    {
      "servers": {
        "api-testing-mcp": {
          "type": "stdio",
          "command": "node",
          "args": ["node_modules/@automate-io/api-testing-mcp/dist/server.js"],
          "cwd": "${workspaceFolder}"
        }
      },
      "inputs": []
    }
    
  • ❗Important Note:If you are working in a monorepo, ensure the args field in your mcp.json file is correctly configured. Refer to the Monorepo MCP Configuration guide for detailed instructions.<br> If your test code resides in a standalone repository, no changes are needed, you are good to go. <br> <br>

πŸ“– Getting started with MCP testing

  1. Start the MCP Server
  • Click the highlighted start button in the mcp.json file as shown below to start the MCP server.

    <img src="./documentation/screen-shots/server-start-button-v2.png" alt="Server Start Button"> <br>

  1. Input the prompt
  • Open GitHub Copilot chat window in VS Code with Agent mode selected.
  • Enter a prompt that outlines the API you wish to test. <br> <br>

βœ… Example scenarios and prompts for MCP server usage

  • Scenario 1 : To test all endpoints in one go.<br>
  • Scenario 2 : To test a single endpoint. <br> <br>

⏭️ Upcoming enhancements

  • Implement schema validations for response payloads
  • Add reusable resources to support API testing workflows
  • Introduce predefined prompts to streamline common scenarios
  • Provide a sample HTML test report template to guide LLm about the layout and formatting
  • Refactor existing logic and implement robust error handling to improve reliability and maintainability <br> <br>

πŸ”§ Troubleshooting

  • Server not running?
    Double-check your MCP client configuration.

  • Module not found?
    Reinstall the package:

    npm i @automate-io/api-testing-mcp@latest
    

<br>

πŸ†˜ Support


<br>

πŸ‘ Enjoy exploring and validating your APIs !

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured