Skip to content

docs: add CLI smoke testing example for MCP servers#1635

Draft
jiezeng2004-design wants to merge 1 commit into
modelcontextprotocol:mainfrom
jiezeng2004-design:docs/cli-smoke-testing-example
Draft

docs: add CLI smoke testing example for MCP servers#1635
jiezeng2004-design wants to merge 1 commit into
modelcontextprotocol:mainfrom
jiezeng2004-design:docs/cli-smoke-testing-example

Conversation

@jiezeng2004-design

Copy link
Copy Markdown

Summary

Add a CLI smoke testing example document showing how to test MCP servers from the command line using the Inspector's CLI mode. The method is generic and applicable to any MCP server, with the reference server-everything and a local stdio server used as concrete examples.

Type of Change

  • Documentation update

Changes Made

  • New file docs/cli-smoke-testing-example.md describing a reusable smoke testing workflow built on the existing CLI mode (npx @modelcontextprotocol/inspector --cli ...):
    • The four-step connect / list / call / assert workflow.
    • A table of supported --method values and their required options (matching the CLI source).
    • Two runnable examples: the reference @modelcontextprotocol/server-everything and a local stdio server.
    • Guidance on asserting that outputs do not leak sensitive content, including both a generic block-list check and a server-side guard example.
    • Remote server (SSE / Streamable HTTP) usage and a minimal CI shell script.

The document does not introduce or depend on any external package; the local-server example notes that any MCP server built to a dist/index.js entry point can be substituted.

Testing

  • Manual testing performed

Ran prettier --check (the repo's documented formatter, see CONTRIBUTING.md and the lint-staged config) against the new file; it passes after prettier --write. No code or tests are touched, so npm test / npm run test:e2e are unaffected.

Checklist

  • Code follows the style guidelines (ran prettier --write on the new file)
  • Self-review completed
  • Documentation updated

Add a docs/cli-smoke-testing-example.md guide showing how to use the Inspector CLI mode to run smoke tests against any MCP server. Covers the connect/list/call/assert workflow, JSON assertions via jq, asserting safe output does not leak secrets, and a CI integration snippet. Uses the reference server-everything and a local stdio server as examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant