MeterSphere API Testing MCP server

Bridges AI systems with MeterSphere's testing platform, enabling natural language control of API testing, debugging, and documentation generation without leaving conversation context.
Back to servers
Setup instructions
Provider
MeterSphere
Release date
May 09, 2025
Stats
11 stars

MeterSphere MCP Server enables LLM clients (like VS Code, Claude, or Cursor) to call testing services, fetch API definitions, execute test cases, and receive results through a standardized Model Context Protocol (MCP) implementation specifically designed for API testing.

Installation

To install and run the MeterSphere MCP Server:

git clone https://github.com/metersphere/metersphere-mcp-server.git
cd metersphere-mcp-server
mvn clean install

Available Tools

API Testing Tools

  • api-doc-synchronizer: Synchronizes API documentation
  • api-test-executor: Executes API interface test cases
  • code-test-generator: Generates test cases based on code
  • code-test-synchronizer: Synchronizes code cases with the testing platform
  • test-result-analyzer: Performs intelligent analysis of test results

Test Resource Management Tools

  • test-case-fetcher: Retrieves test cases from the testing platform
  • issue-test-linker: Associates defects with test cases

Client Configuration

VS Code Configuration

Add the following to your .vscode/settings.json file:

{
  "servers": {
    "ms-mcp-server-sse": {
      "type": "sse",
      "url": "http://localhost:8000/sse",
      "headers": {
        "accessKey": "your-access-key",
        "signature": "your-signature",
        "meterSphereUrl": "http://your-metersphere-url"
      }
    },
    
    "ms-mcp-server-docker": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run", 
        "-i", 
        "--rm", 
        "-p", 
        "8000:8000", 
        "-e", "accessKey=${env:accessKey}",
        "-e", "signature=${env:signature}",
        "-e", "meterSphereUrl=${env:meterSphereUrl}",
        "metersphere-mcp-server"
      ],
      "env": {
        "accessKey": "your-access-key", 
        "signature": "your-signature",
        "meterSphereUrl": "http://your-metersphere-url"
      }
    }
  }
}

Claude Client Configuration

{
  "mcp_providers": {
    "metersphere-sse": {
      "protocol": {
        "type": "sse",
        "baseUrl": "http://localhost:8000",
        "path": "/sse"
      },
      "auth": {
        "type": "header",
        "headers": {
          "accessKey": "your-access-key",
          "signature": "your-signature",
          "meterSphereUrl": "http://your-metersphere-url"
        }
      },
      "defaults": {
        "env": "dev"
      }
    },

    "metersphere-docker": {
      "protocol": {
        "type": "stdio",
        "command": "docker run -i --rm -p 8000:8000 metersphere-mcp-server"
      },
      "env": {
        "accessKey": "your-access-key",
        "signature": "your-signature",
        "meterSphereUrl": "http://your-metersphere-url"
      },
      "defaults": {
        "env": "staging"
      }
    }
  },

  "default_provider": "metersphere-sse"
}

Server Configuration

You can configure the MCP server with the following parameters:

  • PORT: HTTP port (default: 8000)
  • MCP_TPYE: Connection type (http-sse | stdio | docker)
  • AK/SK: Authentication keys
  • MeterSphereURL: The URL of your deployed MeterSphere platform

Security and Permissions

The server supports:

  • AK/SK authentication
  • Role-based permission management, allowing only authorized roles to call sensitive tools (such as project data retrieval and processing)

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "ms-mcp-server-sse" '{"type":"sse","url":"http://localhost:8000/sse","headers":{"accessKey":"your-access-key","signature":"your-signature","meterSphereUrl":"http://your-metersphere-url"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "ms-mcp-server-sse": {
            "type": "sse",
            "url": "http://localhost:8000/sse",
            "headers": {
                "accessKey": "your-access-key",
                "signature": "your-signature",
                "meterSphereUrl": "http://your-metersphere-url"
            }
        },
        "ms-mcp-server-docker": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-p",
                "8000:8000",
                "-e",
                "accessKey=${env:accessKey}",
                "-e",
                "signature=${env:signature}",
                "-e",
                "meterSphereUrl=${env:meterSphereUrl}",
                "metersphere-mcp-server"
            ],
            "env": {
                "accessKey": "your-access-key",
                "signature": "your-signature",
                "meterSphereUrl": "http://your-metersphere-url"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "ms-mcp-server-sse": {
            "type": "sse",
            "url": "http://localhost:8000/sse",
            "headers": {
                "accessKey": "your-access-key",
                "signature": "your-signature",
                "meterSphereUrl": "http://your-metersphere-url"
            }
        },
        "ms-mcp-server-docker": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-p",
                "8000:8000",
                "-e",
                "accessKey=${env:accessKey}",
                "-e",
                "signature=${env:signature}",
                "-e",
                "meterSphereUrl=${env:meterSphereUrl}",
                "metersphere-mcp-server"
            ],
            "env": {
                "accessKey": "your-access-key",
                "signature": "your-signature",
                "meterSphereUrl": "http://your-metersphere-url"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later