ScriptsMay 12, 2026·2 min read

AIMock — Mock LLM, MCP, A2A, Vector APIs

AIMock is a mock server for AI app testing: it simulates LLM providers, MCP tools, A2A agents, and vector/search APIs so tests avoid real paid endpoints.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Stage only · 29/100Stage only
Agent surface
Any MCP/CLI agent
Kind
Script
Install
Single
Trust
Trust: Established
Entrypoint
README.md
Universal CLI install command
npx tokrepo install 84631ebc-4610-44f0-a551-734d42f5d904
Intro

AIMock is a mock server for AI app testing: it simulates LLM providers, MCP tools, A2A agents, and vector/search APIs so tests avoid real paid endpoints.

  • Best for: teams writing agent tests who need deterministic fixtures, record/replay, and one-port mocks
  • Works with: Node.js projects, test runners (Jest/Vitest), OpenAI-compatible SDKs via OPENAI_BASE_URL
  • Setup time: 10 minutes

Practical Notes

  • Mocks many surfaces from one port (LLM APIs, MCP, A2A, vector/search/rerank, etc.)
  • Supports 12 LLM providers (per project docs) and streaming behaviors for realistic tests
  • GitHub stars/forks (verified): see Source & Thanks

AIMock pays for itself the first time you avoid a flaky test or a surprise token bill.

Use it in three steps:

  1. Start llmock (fixtures-first) or the full suite via --config.
  2. Point your SDK to the mock by setting OPENAI_BASE_URL (and a dummy key if the SDK requires it).
  3. Record real traces once (optional), then replay deterministically in CI forever.

Two good guardrails:

  • Keep fixtures in version control and review them like code.
  • Add a CI check that fails if your tests accidentally talk to real endpoints (base URL not patched).

FAQ

Q: What does it mock? A: LLM APIs plus agent protocols like MCP/A2A and common infra like vector DBs, search, and rerank.

Q: Can it record real responses? A: Yes — it supports record & replay so you can capture and replay fixtures deterministically.

Q: How do I adopt it safely? A: Patch base URLs via env vars in tests and add a CI guard to prevent real endpoint calls.

🙏

Source & Thanks

Source: https://github.com/CopilotKit/aimock > License: MIT > GitHub stars: 581 · forks: 37

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets