mcpbeat

API Testing

cosmicstack-labs/api-testing

REST and GraphQL testing, Postman/Insomnia patterns, contract testing, schema validation, and monitoring

449 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
365
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill api-testing

The instruction itself

7 sections, as written by the author

API Testing

Test REST and GraphQL APIs systematically.

Test Categories

| Category | What | Example |

|----------|------|---------|

| Functional | Does it work? | POST /users returns 201 |

| Validation | Input handling | Missing required field → 400 |

| Auth | Access control | No token → 401 |

| Edge Cases | Boundary conditions | Max page size, empty results |

| Contract | Schema conformance | Response matches OpenAPI spec |

| Performance | Within SLO | p95 < 500ms |

REST API Testing

Structure

describe('POST /users', () => {
  it('creates a user with valid data', async () => {
    const res = await request(app)
      .post('/api/users')
      .send({ name: 'Alice', email: '[email protected]' });
    expect(res.status).toBe(201);
    expect(res.body).toHaveProperty('id');
  });
  it('rejects duplicate email', async () => {
    const res = await request(app)
      .post('/api/users')
      .send({ name: 'Alice', email: '[email protected]' });
    expect(res.status).toBe(409);
  });
});

Contract Testing (Pact)

  • Provider publishes OpenAPI spec
  • Consumer tests verify against published spec
  • CI rejects PR if contract breaks
  • Prevents API drift between services

GraphQL Testing

  • Test queries and mutations independently
  • Validate against schema
  • Test error paths (partial failures, null propagation)

API Monitoring

  • Synthetic checks every 5 minutes
  • Assert status, response time, required fields
  • Alert on SLA breaches
  • Monitor from multiple regions

How to use it

Copy the folder

Take cosmicstack-labs/api-testing from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.