api-testing-mcp
Enables HTTP API testing (GET, POST, PUT, DELETE) via the Model Context Protocol, powered by Playwright.
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
- Prerequisites
- Setup
- Configurations
- Usage
- Example scenarios and prompts for MCP server usage
- Upcoming enhancements
- Troubleshooting
- Support <br> <br>
π 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
-
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>
- Create a new folder with a meaningful name (e.g.
-
Install the MCP Server Package
- Now, run the below command to install the mcp server package.
npm i @automate-io/api-testing-mcp@latest
- Now, run the below command to install the mcp server package.
<br>
βοΈ Configurations
-
Open your project folder in VS Code
-
If the
mcp.jsonfile does not already exist, create it inside theroot/.vscode/directory. If the file is already present, you can skip this step -
Add the
api-testing-mcpconfiguration under theserverskey in themcp.jsonfile, 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 theargsfield in yourmcp.jsonfile is correctly configured. Refer to the Monorepo MCP Configuration guide for detailed instructions.<br> If your test code resides in astandalonerepository, no changes are needed, you are good to go. <br> <br>
π Getting started with MCP testing
- 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>
- 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
- Review this guide and your MCP client documentation.
- For issues, open GitHub Issues here.
- Consult Model Context Protocol Documentation.
<br>
π Enjoy exploring and validating your APIs !
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.