A Model Context Protocol (MCP) server for the Mayhem for API CLI (mapi)
Note
The code in this repository is provided as-is and is intended only for demonstration purposes. This project is not officially supported or actively maintained.
The MCP server for mapi supports the following capabilities:
Discover APIs running on a single host, multiple hosts, CIDR blocks, or domains.
Run a scan to check an API for defects.
MCP servers are designed to be used with AI applications like Claude, Cursor, or ChatGPT. This usage guide explains how to use this project with AI applications.
If necessary, follow the steps to authenticate to the GitHub Container registry with a personal access token (classic). Only the read:packages scope is required to use this project.
Note
To check login status, run docker login ghcr.io.
Visual Studio Code provides native support for MCP servers and this project includes a file (.vscode/mcp.json) that can be used to configure Visual Studio Code to use the MCP server for mapi.
Note
The next paragraph describes how to add the MCP server for mapi to a single project or a profile in Visual Studio Code. These steps are also outlined in the official documentation for using MCP servers with Visual Studio Code.
To add the MCP server for mapi to a single Visual Studio Code project, copy the .vscode/mcp.json file to the same location in the target project; or, if the target project is already configured to use other MCP servers, add the details from the .vscode/mcp.json file provided in this project to the .vscode/mcp.json file for the target project. To add the MCP server for mapi to all Visual Studio Code projects associated with a profile add the .vscode/mcp.json file to the target profile's directory; or, if the target profile is already configured to use other MCP servers, add the details from the .vscode/mcp.json file provided in this project to the mcp.json file for the target profile.
Once the MCP server for mapi has been added to a project or profile, open the Chat view and use the tool picker to enable the MCP server for mapi. These steps are outlined in the official documentation for using MCP servers with Visual Studio code.
Add the following to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for global access), replacing your-token-here with your Mayhem API token:
{ "mcpServers": { "mapi": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "MAYHEM_TOKEN", "ghcr.io/forallsecure/mcp-server-mapi:latest", "uv", "run", "mcp-server-mapi", "mcp" ], "env": { "MAYHEM_TOKEN": "your-token-here" } } } }A reference .cursor/mcp.json file is also included in this repository.
If you're using Claude Desktop you can hook the MCP server to it using the claude_desktop_config.json file - just make sure you include your API token in it.
This section describes how to acquire and run the code locally for development purposes.
Clone this repository:
git clone git@github.com:ForAllSecure/mcp-server-mapi.gitUse uv to run the MCP server for mapi:
MAYHEM_TOKEN=your-token-here uv run mcp-server-mapi mcp