Skip to main content
Glama

mcpstub

실제 계약으로 생성되는 페이크 MCP 서버

mcpstubmcpdoctor 리포트나 작은 JSON 픽스처를 결정적(deterministic) stdio 서버로 변환합니다. 실전 자격 증명, 불안정한 API, 직접 작성한 JSON-RPC 연결 코드 없이 MCP 클라이언트, 게이트웨이, 에이전트 하네스를 테스트할 수 있습니다.

mcpstub은 계약을 결정적 모던 또는 레거시 테스트 서버로 변환합니다

$ mcpstub from mcpdoctor.json --out fixtures/docs.json
mcpstub: wrote fixtures/docs.json (14 tools)

$ mcpstub check fixtures/docs.json
✓ valid mcpstub fixture: fixtures/docs.json

$ mcpstub serve fixtures/docs.json
# speaks MCP on stdin/stdout until the client disconnects

유용한 루프

실제 서버를 한 번 검사하고, 계약을 검토한 다음, 로컬 스텁으로 테스트하세요:

# 1. Inventory the server. mcpdoctor never calls its tools.
npx --yes github:jovial-liu/mcpdoctor#v1 inspect \
  --format json --out mcpdoctor.json -- \
  npx -y @modelcontextprotocol/server-filesystem /tmp

# 2. Generate a safe starting fixture from the advertised contract.
npx --yes github:jovial-liu/mcpstub#v1 from mcpdoctor.json --out fixtures/files.json

# 3. Point an MCP client at the deterministic fixture server.
npx --yes github:jovial-liu/mcpstub#v1 serve fixtures/files.json

생성된 픽스처는 도구 이름, 설명, 스키마, 어노테이션, 리소스, 템플릿, 프롬프트, 서버 식별 정보를 보존합니다. 자리 표시자 결과를 생성합니다—실제 프로덕션 도구 출력은 절대 캡처하지 않습니다.

직접 작성한 시나리오

픽스처는 검토 가능한 일반 JSON입니다. 도구에 인자별 케이스를 직접 추가하세요:

{
  "schema": "mcpstub/v1",
  "server": { "name": "weather-fixture", "version": "1.0.0" },
  "tools": [
    {
      "name": "get_weather",
      "description": "Get a fixture forecast",
      "inputSchema": {
        "type": "object",
        "properties": { "city": { "type": "string" } },
        "required": ["city"]
      },
      "cases": [
        {
          "when": { "city": "Paris" },
          "result": { "content": [{ "type": "text", "text": "Paris: 21°C, clear" }] }
        },
        {
          "when": { "city": "Atlantis" },
          "error": { "code": -32004, "message": "Fixture city not found" }
        }
      ],
      "result": { "content": [{ "type": "text", "text": "Fixture forecast unavailable" }] }
    }
  ]
}

when은 인자 객체에 대한 재귀적 부분 집합 일치를 수행합니다. 객체 케이스는 무관한 인자를 무시할 수 있고, 배열은 길이와 위치로 일치합니다. 첫 번째로 일치하는 케이스가 우선하며, 일치하지 않을 때 result가 폴백입니다. 둘 다 없으면 mcpstub은 도구 이름과 인자를 포함하는 결정적 생성 결과를 반환합니다.

정식 관리 예시를 사용해 보세요:

npx --yes github:jovial-liu/mcpstub#v1 check examples/weather.json
npx --yes github:jovial-liu/mcpstub#v1 serve examples/weather.json

구현 기능

  • 모던 2026-07-28 server/discover, 결과 판별자, 캐시 메타데이터;

  • 레거시 initialize 협상, 기본값은 2025-11-25;

  • tools/list 및 결정적 tools/call 결과 또는 JSON-RPC 오류;

  • 리소스 및 리소스 템플릿 나열, 그리고 resources/read;

  • 프롬프트 나열 및 prompts/get;

  • ping, 알 수 없는 메서드 오류, 파싱 오류;

  • 스텁으로 전송된 호출의 선택적 JSONL 기록.

두 프로토콜 세대 모두 동일한 픽스처 프로세스에서 사용할 수 있습니다. 모던 클라이언트는 server/discover로 시작하고, 레거시 클라이언트는 initialize로 시작합니다.

선택적 호출 검증

테스트 대상 시스템이 스텁에 요청한 작업을 기록하세요:

mcpstub serve fixture.json --log calls.jsonl

로그에는 타임스탬프, 도구 이름, 인자가 포함됩니다. 인자에 비밀 또는 개인 데이터가 포함될 수 있으므로 옵트인 방식입니다. 검토하고 정리하기 전에는 호출 로그를 소스 제어에 저장하지 마세요.

CLI

mcpstub from <mcpdoctor.json> [--out mcpstub.json]
mcpstub check <fixture.json> [--json]
mcpstub serve <fixture.json> [--log calls.jsonl]
mcpstub --version

픽스처 형식은 schema/fixture.schema.json으로 버전 관리됩니다. check 또한 중복 이름과 잘못된 케이스를 안정적인 파인딩 코드로 거부합니다.

안전 및 제한 사항

mcpstub은 실제 MCP 서버를 시작하거나, 실제 도구를 호출하거나, 셸을 실행하거나, 환경 자격 증명을 로드하거나 네트워크 요청을 만들지 않습니다. 지정한 픽스처만 읽고, 명시된 출력 또는 로그 경로에만 씁니다.

이것은 프로토콜 픽스처일 뿐, 보안 샌드박스나 완전한 서버 에뮬레이터가 아닙니다:

  • stdio는 지원하며, Streamable HTTP 및 인증은 지원하지 않습니다;

  • 다중 왕복 요청, 구독, 샘플링, elicitation, 확장 기능은 시뮬레이트되지 않습니다;

  • 광고된 JSON Schema는 호출 인자 검증에 사용되지 않습니다;

  • 생성된 픽스처에는 계약과 자리 표시자 응답이 포함되며, 동작 기록은 포함되지 않습니다;

  • 악성 픽스처는 여전히 테스트 중인 클라이언트에 악성 텍스트를 반환할 수 있으므로, 제3자 픽스처를 코드와 같은 테스트 데이터로 검토하세요.

실시간 녹음 세션에는 카세트 스타일 레코더를 사용하세요. mcpstub은 의도적으로 계약 중심입니다: 작은 픽스처, 명시적 케이스, 결정적 결과.

개발

git clone https://github.com/jovial-liu/mcpstub.git
cd mcpstub
npm run check

Node.js 20+ 및 런타임 의존성이 없습니다. CONTRIBUTING.mdSECURITY.md를 참조하세요.

라이선스

MIT

-
license - not tested
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

  • Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.

  • Hosted AgentLux MCP server for marketplace, identity, creator, services, and social flows.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jovial-liu/mcpstub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server