Skip to content

Conversation

@olaservo
Copy link
Member

Summary

Reference implementation of @modelcontextprotocol/inspector-core - a reusable core package for MCP client logic with no React dependencies.

  • MCP client lifecycle: createMcpClient, connectClient, disconnectClient, isClientConnected
  • Transport factory: createHttpTransport for Streamable HTTP connections
  • Handler creation: createSamplingHandler, createElicitationHandler with queue-based patterns
  • Repository interfaces: ServerConfigRepository, HistoryRepository, LogsRepository, TestingProfileRepository
  • Service interfaces: ConnectionService, ExecutionService for stateful operations
  • Memory implementations: In-memory stubs for all repositories/services (testing, CLI, TUI)
  • Type definitions: History entries with parent-child relationships, RFC 5424 log levels, testing profiles

Design Principles

  1. No React dependencies - Can be used in CLI, TUI, or test frameworks
  2. Interface-first data layer - Repository/service interfaces with swappable implementations
  3. Stubbable for testing - Memory implementations enable unit tests without I/O

Test Scripts

  • test-core.js - Unit tests for memory implementations (run with node core/test-core.js)
  • test-real-server.js - Integration tests with Everything MCP server

Test Plan

  • Unit tests pass: node core/test-core.js (all 21 tests)
  • Integration tests pass with Everything server running
  • Review feedback incorporated

Notes

This is a proposal/reference implementation for discussion. The architecture enables code sharing across web UI, CLI, and TUI implementations per the V2 package architecture spec.

Related: Issue #983 (data spec discussion)


🦉 Generated with Claude Code

Extracts reusable MCP client logic into a separate package that can be
shared across web UI, CLI, and TUI implementations.

Includes:
- MCP client lifecycle (createMcpClient, connectClient, disconnectClient)
- HTTP transport creation (createHttpTransport, createAuthenticatedTransport)
- Sampling/elicitation request handlers
- Data layer interfaces (repositories, services) with memory stubs
- Shared type definitions
@olaservo olaservo added the v2 label Jan 19, 2026
- test-core.js: Unit tests for memory implementations (repositories,
  services, type helpers)
- test-real-server.js: Integration tests with Everything MCP server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@olaservo
Copy link
Member Author

Recreating from upstream branch for proper stacked PR support

@olaservo olaservo closed this Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant