MCPJam Inspector

repository·main·Indexed 24 days ago

https://github.com/mcpjam/inspector

A development and debugging platform for Model Context Protocol (MCP) servers, apps, and ChatGPT apps. It includes @mcpjam/cli for inspecting connectivity, invoking tools, and validating OAuth conformance, as well as @mcpjam/chat-ui for rendering AI SDK-style chat messages and interactive tool blocks.

Tokens
253.3K
Snippets
381
Records
1.2K
Agent score
82%

What's inside MCPJam

  1. Overview of MCP Apps (SEP-1865)

    main
    MCP Apps is an extension to the Model Context Protocol (MCP) that allows servers to deliver interactive user interfaces (UIs) to hosts. It provides a standardized way for servers to declare UI resources using the ui:// URI scheme and associate them with specific tools via metadata. This enables rich, interactive experiences (like HTML-based interfaces) that go beyond plain text, while maintaining the security and bidirectional communication patterns of the core MCP protocol.
  2. Overview of the Jammy Wammy Reservation MCP App

    main
    The Jammy Wammy Reservation MCP App is a demonstration application designed to showcase Model Context Protocol (MCP) capabilities for restaurant reservations. It provides a combination of server-side tools and a React-based interactive UI to facilitate user interactions like viewing menus and confirming table reservations.
  3. Overview of @mcpjam/mcp

    main
    The @mcpjam/mcp package is a remote MCP (Model Context Protocol) server hosted on Cloudflare Workers. Unlike standard npm packages, it is not published to npm; instead, clients connect to it remotely via a URL. It acts as a thin adapter over the shared platform operation catalog in @mcpjam/sdk/platform, meaning every tool call hits the Platform API (/api/v1) using the caller's own AuthKit JWT to ensure project access permissions are respected.
  4. Overview of MCPJam surfaces

    main

    MCPJam provides four distinct surfaces for developing and testing MCP servers, MCP apps, and ChatGPT apps:

    1. Inspector: An IDE-style workspace for MCP development. Features include chatting with frontier models, manual tool invocation, widget rendering, and side-by-side comparison of hosts and models.
    2. CLI: A stateless tool designed for connectivity checks, OAuth, conformance testing, and tool execution. Includes JUnit/JSON reporters for CI integration.
    3. SDK (@mcpjam/sdk): A TypeScript toolkit for writing unit tests, end-to-end (e2e) tests, and evaluations. It is compatible with Jest and Vitest.
    4. Hosted: A browser-based version at app.mcpjam.com that allows you to share servers and sessions with your team.
  5. Overview of the Sip Cocktails MCP App

    main

    The Sip Cocktails MCP App is a demonstration application that serves cocktail recipes through a Model Context Protocol (MCP) interface. It features an interactive React UI widget and uses Convex for data storage and image management.

    Key Capabilities:

    • Interactive UI: A React-based cocktail recipe widget displaying images, instructions, nutrition, and ingredient measurements.
    • MCP Tools: Provides tools to fetch specific cocktail details and list all available cocktail IDs and names.
    • Data Backend: Uses Convex queries and mutations for managing cocktails, ingredients, and image storage.
    • Data Seeding: Includes scripts for populating the database and uploading images.
  6. Overview of MCPJam Inspector Capabilities

    main

    MCPJam provides a comprehensive suite of tools for developing and testing Model Context Protocol (MCP) projects:

    • App Builder: Debug servers against models with tool calls, chat, and a Chrome DevTools-style widget emulator.
    • Chat: Multi-server chat on frontier models with Trace and Raw views to compare up to 3 models side-by-side.
    • OAuth Debugger: Guided conformance checks for MCP OAuth protocol versions (03-26, 06-18, 11-25), including DCR and CIMD.
    • MCP Server Debugging: Manually execute tools, resources, templates, and prompts with full JSON-RPC observability.
    • Skills: Extend models with local, reusable behaviors (local filesystem only).
    • Workspaces: Shared server groups with real-time team synchronization.
    • Evals: Define test cases with expected tool calls and track accuracy metrics across LLMs.
    • CLI: Probe servers, run OAuth checks, and execute evals from the terminal.
    • SDK: Programmatic access for custom tooling and automated testing.
    • CI/CD: Integration with GitHub Actions and other pipelines to gate PRs on regressions.
  7. What is an MCP Client in MCPJam

    main

    An MCP Client is a named, reusable configuration that defines how MCPJam connects to and communicates with your MCP servers. It acts as a host emulator, allowing you to bundle model settings, system prompts, attached servers, protocol-level configurations, and MCP App sandbox controls into a single selectable profile.

    Key Benefits

    • Reproducibility: Capture a snapshot of all settings (model, prompt, servers) so runs can be shared and repeated with identical conditions.
    • Host Emulation: Configure the inspector to mimic specific environments like Claude Desktop, ChatGPT, or Cursor to verify how your server or MCP App behaves under their specific sandbox policies and capabilities.
    • Faster Iteration: Switch between complex configurations (e.g., different protocol versions or CSP modes) with a single click.
  8. Configure mcpjam CLI output formats

    main

    The CLI automatically detects the output format based on the environment:

    • Interactive terminal: Defaults to --format human (pretty-printed JSON or human-readable summaries).
    • Piped/Redirected (CI, | jq, agents): Defaults to --format json (full structured result).

    Key behaviors:

    • Explicitly passing --format <format> (where format is json or human) always overrides auto-detection.
    • For programmatic parsing by agents, use --quiet --format json to ensure only the raw JSON is returned.
    • Conformance commands in CI support --reporter junit-xml and --reporter json-summary.

    Handling large payloads: Use files or stdin to avoid shell escaping issues. For tools call, use --tool-args-stdin as a shorthand for --tool-args -.

    echo '{"key":"value"}' | mcpjam tools call --url $URL --access-token $TOKEN \
      --tool-name my_tool --tool-args - --quiet --format json
  9. Understand the Claude Code host lifecycle

    main

    When you run a turn using the Claude Code host, the following sequence occurs:

    1. Pre-flight Check: The server verifies harness availability (broker credentials, computer data plane configuration, supported MCPJam models, and host settings). If any check fails, the turn returns an error immediately without opening a stream.
    2. Computer Wake: The host's project Computer is reserved, woken, or provisioned. Harness hosts require a Computer; there is no local fallback.
    3. Credential Delivery: Convex mints a short-lived model lease and installs it into the E2B egress transform outside the VM. The CLI uses dummy credentials that point to the MCPJam model proxy, which verifies the lease and meters usage.
    4. MCP Delivery: Selected MCP servers are written to the session's .mcp.json, using MCPJam's per-server proxy tunnel.
    5. Turn Execution: Claude Code's agent loop executes. Native tools run in the sandbox, and file changes are written to the Computer's disk. If tool approval is enabled, side-effecting built-in tools will pause the turn for your decision.
  10. Theming MCP Apps with CSS Variables

    main

    MCP Apps can use a standardized set of CSS variables provided by the host to ensure consistent theming. To ensure graceful degradation when a host does not provide all variables, apps should always define fallback values in their :root or local scope.

    Best Practices:

    • Use the light-dark() CSS function for theme-aware values.
    • Use utilities like applyHostStyleVariables or the useHostStyleVariables React hook to populate variables.
    • Use applyDocumentTheme or useDocumentTheme to respond to Host Context theme changes.

    Example CSS usage:

    .container {
      background: var(--color-background-primary);
      color: var(--color-text-primary);
      font-family: var(--font-sans);
    }
    :root {
      --color-text-primary: light-dark(#171717, #000000);
      --border-radius-small: 8px;
    }
  11. Inspect PromptResult from HostRunner.run()

    main

    The PromptResult class wraps every response returned by HostRunner.run(). It is the primary object used to inspect the outcome of an agent execution, including text responses, tool calls, errors, performance metrics, and conversation history.

    Note: You do not import PromptResult directly; it is returned by the agent.run() method.

    // PromptResult is returned by HostRunner.run()
    // You don't import it directly
    
    const result = await agent.run("...");
    // result is a PromptResult
  12. Understand host image support via HostCompatProfile

    main

    Every market host in @mcpjam/sdk includes an imageSupport field within its HostCompatProfile. This describes how the host handles MCP tool-result images across three specific sources:

    1. toolImageContent: Direct MCP image blocks.
    2. embeddedResourceImages: Image blobs inside MCP resources.
    3. resourceLinkImages: Image links resolved via resources/read.

    Each source tracks:

    • model: Whether the image is passed to the LLM.
    • ui: Whether the host UI renders the image.
    • placement: Where the preview appears ("inline" | "collapsed" | "none").

    New exported types from @mcpjam/sdk/host-compat:

    • HostImageSupport
    • ImageSourceSupport
    • ImagePlacement