> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcpjam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run tests in CI/CD

> Copy a GitHub Actions workflow for your MCP server, MCP app, or eval suite.

> [card] [Check server health](https://docs.mcpjam.com/run-tests-in-ci-cd.md#check-server-health)
>
> Connect to your deployed server and list what it exposes.

> [card] [Check protocol conformance](https://docs.mcpjam.com/run-tests-in-ci-cd.md#check-protocol-conformance)
>
> Check your deployed server against the MCP spec.

> [card] [Check MCP Apps wiring](https://docs.mcpjam.com/run-tests-in-ci-cd.md#check-mcp-apps-wiring)
>
> Validate tool metadata and `ui://` resources.

> [card] [Test MCP tool responses](https://docs.mcpjam.com/run-tests-in-ci-cd.md#test-mcp-tool-responses)
>
> Call a tool with fixed inputs and check what it returns.

> [card] [Run a hosted eval suite](https://docs.mcpjam.com/run-tests-in-ci-cd.md#run-a-hosted-eval-suite)
>
> Grade model responses to prompts in a saved MCPJam suite.

## Before you start

* Enable GitHub Actions for your repository.

For the server health, protocol, and MCP Apps checks, deploy an MCP server with an HTTPS endpoint that accepts unauthenticated requests.

## Check server health

Save this as `.github/workflows/mcpjam-health.yml`. Replace `https://mcp.example.com/mcp` with your server’s HTTPS endpoint.

```yaml .github/workflows/mcpjam-health.yml theme={"theme":"css-variables"}
name: MCPJam health check
on: pull_request
permissions: {}

jobs:
  mcp-health:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: '24'
      - name: Check the MCP server
        env:
          MCP_SERVER_URL: https://mcp.example.com/mcp
        run: npx -y @mcpjam/cli@latest server doctor --url "$MCP_SERVER_URL" --format json
```

## Check protocol conformance

Save this as `.github/workflows/mcpjam-protocol.yml`. Replace `https://mcp.example.com/mcp` with your server’s HTTPS endpoint.

```yaml .github/workflows/mcpjam-protocol.yml theme={"theme":"css-variables"}
name: MCPJam protocol conformance
on: pull_request
permissions: {}

jobs:
  mcp-protocol:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: '24'
      - name: Check protocol conformance
        env:
          MCP_SERVER_URL: https://mcp.example.com/mcp
        run: npx -y @mcpjam/cli@latest protocol conformance --url "$MCP_SERVER_URL" --format human
```

## Check MCP Apps wiring

Save this as `.github/workflows/mcpjam-apps.yml`. Replace `https://mcp.example.com/mcp` with your MCP app server’s HTTPS endpoint.

```yaml .github/workflows/mcpjam-apps.yml theme={"theme":"css-variables"}
name: MCPJam Apps conformance
on: pull_request
permissions: {}

jobs:
  mcp-apps:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: '24'
      - name: Check MCP Apps wiring
        env:
          MCP_SERVER_URL: https://mcp.example.com/mcp
        run: npx -y @mcpjam/cli@latest apps conformance --url "$MCP_SERVER_URL" --format human
```

## Test MCP tool responses

1. Install the MCPJam SDK and the reference server with `npm install --save-dev @mcpjam/sdk @modelcontextprotocol/server-everything`.
2. [Create the tool test](#create-the-tool-test).
3. Add the test script with `npm pkg set 'scripts.test:mcp=node --test test/mcp-tools.test.mjs'`.
4. Save this as `.github/workflows/mcpjam-tests.yml`.

```yaml .github/workflows/mcpjam-tests.yml theme={"theme":"css-variables"}
name: MCPJam tool tests
on: pull_request
permissions:
  contents: read

jobs:
  mcp-tool-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '24'
      - run: npm ci
      - run: npm run test:mcp
```

### Create the tool test

Save this as `test/mcp-tools.test.mjs`. The test starts a reference MCP server, calls its `echo` tool, and checks the response.

```javascript test/mcp-tools.test.mjs theme={"theme":"css-variables"}
import assert from "node:assert/strict";
import { test } from "node:test";
import { MCPClientManager } from "@mcpjam/sdk";

test("echo returns the input message", async () => {
  const manager = new MCPClientManager({
    server: {
      command: "npx",
      args: ["--no-install", "@modelcontextprotocol/server-everything", "stdio"],
    },
  });
  await manager.connectToServer("server");
  try {
    const result = await manager.executeTool("server", "echo", {
      message: "works in CI",
    });
    assert.equal(result.isError ?? false, false);
    assert.deepEqual(result.content, [{ type: "text", text: "Echo: works in CI" }]);
  } finally {
    await manager.disconnectServer("server");
  }
});
```

To test your own stdio server, replace the launch command and arguments, tool name, inputs, and expected response.

Run `npm run test:mcp` locally, then commit the test file, `package.json`, and `package-lock.json` with the workflow.

## Run a hosted eval suite

1. Sign in to [MCPJam](https://app.mcpjam.com).
2. [Create and run an eval suite](https://docs.mcpjam.com/evaluate/run-your-first-eval.md).
3. Open [API Keys](https://app.mcpjam.com/settings/api-keys) in MCPJam and click **Create API key**. Name the key, select the organization that owns your suite, and create and copy the key.
4. In your GitHub repository, open **Settings**, then **Secrets and variables** → **Actions**. Click **New repository secret** and save the key as `MCPJAM_API_KEY`.
5. Save this as `.github/workflows/mcpjam-evals.yml`. Replace the project and suite names with yours.

```yaml .github/workflows/mcpjam-evals.yml theme={"theme":"css-variables"}
name: MCPJam hosted evals
on: pull_request
permissions:
  contents: read

jobs:
  mcp-evals:
    if: >-
      github.event.pull_request.head.repo.full_name == github.repository &&
      github.actor != 'dependabot[bot]' &&
      github.event.pull_request.user.login != 'dependabot[bot]'
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: MCPJam/inspector/actions/evals@evals-v1
        with:
          api-key: ${{ secrets.MCPJAM_API_KEY }}
          project: "My project"
          suite: "My eval suite"
```

## Run the workflow

1. Commit the workflow and open a pull request from a branch in the repository.
2. On the pull request, open **Checks** and select the job for the workflow you added.
3. Open the job log to read the test results. For the health check, look for `"status": "ready"`. For hosted evals, open the workflow run’s **Summary** to review failed cases.

## Good to know

* For a server that requires credentials, follow the [CLI authentication examples](https://docs.mcpjam.com/cli/ci.md#authentication).
* To test OAuth flows or save JUnit reports, use the [CLI CI/CD examples](https://docs.mcpjam.com/cli/ci.md).
* To set an eval pass threshold, follow [Run evals in CI](https://docs.mcpjam.com/evaluate/run-evals-in-ci.md#choose-how-to-run).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.