Welcome to MCPJam Inspector
This guide will help you get up to speed with the MCPJam Inspector codebase and start contributing effectively.Project Overview
MCPJam Inspector is a developer tool for testing and debugging Model Context Protocol (MCP) servers. Built with:Frontend
Vite + React + TypeScript
Backend
Hono.js (Node.js)
Desktop
Electron
Architecture
High-Level Structure
Key Technologies
Technology | Purpose | Location |
---|---|---|
React + Vite | Frontend UI | /client |
Hono.js | Backend API server | /server |
Electron | Desktop app wrapper | /src |
TypeScript | Type safety | Throughout |
Zustand | State management | /client/src/stores |
Shadcn/ui | UI components | /client/src/components/ui |
MCP SDK | MCP protocol implementation | Dependencies |
Core Concepts
1. MCP Server Connections
MCPJam Inspector supports multiple transport protocols:STDIO Transport
STDIO Transport
Bidirectional streaming with local processes. Used for local MCP servers running as command-line tools.Key files:
server/routes/mcp/stdio.ts
- STDIO connection handlingclient/src/hooks/use-stdio-connection.ts
- React hook for STDIO
SSE Transport
SSE Transport
Server-Sent Events for real-time updates. Used for remote MCP servers with SSE endpoints.Key files:
server/routes/mcp/sse.ts
- SSE connection handlingclient/src/hooks/use-sse-connection.ts
- React hook for SSE
HTTP Streamable
HTTP Streamable
HTTP with chunked transfer encoding. Used for HTTP-based MCP servers.Key files:
server/routes/mcp/streamable.ts
- HTTP streamable handlingclient/src/hooks/use-http-connection.ts
- React hook for HTTP
2. OAuth Flow
MCPJam Inspector implements a complete OAuth 2.0 flow with PKCE for secure authentication.OAuth Architecture Deep Dive
Learn about the OAuth implementation, state machine, and CORS proxy
architecture
3. State Management
We use Zustand for state management with the following stores:Store | Purpose | Location |
---|---|---|
Servers Store | MCP server connections | client/src/stores/servers |
Chat Store | LLM playground state | client/src/stores/chat |
Preferences | User settings | client/src/stores/preferences |
Evals Store | Evaluation results | client/src/stores/evals |
4. LLM Integration
MCPJam supports multiple LLM providers:- OpenAI (GPT-3.5, GPT-4)
- Anthropic (Claude 2, Claude 3)
- DeepSeek (DeepSeek R1)
- Ollama (Local models)
client/src/lib/llm-providers.ts
Development Workflow
Initial Setup
1
Clone Repository
2
Install Dependencies
bash npm install
3
Set Environment Variables
Create a
.env
file in the root directory with your API keys: bash OPENAI_API_KEY=your_key_here ANTHROPIC_API_KEY=your_key_here # Optional: Add other provider keys
4
Start Development Server
Code Style & Conventions
TypeScript
- Use strict mode (
strict: true
in tsconfig) - Define interfaces for all data structures
- Avoid
any
- useunknown
or proper types - Use type guards for runtime type checking
React
- Prefer functional components with hooks
- Use
useCallback
anduseMemo
for optimization - Keep components small and focused
- Co-locate component-specific code
File Naming
Type | Convention | Example |
---|---|---|
Components | kebab-case | mcp-sidebar.tsx |
Hooks | use-prefix | use-mcp-connection.ts |
Stores | kebab-case | servers-store.ts |
Types | PascalCase | ServerDefinition |
Utilities | kebab-case | format-date.ts |
Manual Testing
- Test with multiple MCP servers
- Verify all transport types work
- Check OAuth flow end-to-end
- Test LLM playground with different models
- Verify evals run successfully
Building & Deployment
Build for Production
Electron Distribution
Docker
Next Steps
Now that you understand the basics, dive into specific topics:- Explore the OAuth Architecture - Understand how authentication works
- Read the Contributing Guide - Learn our contribution workflow
- Pick a Good First Issue - Start contributing to the project
- Join Discord - Connect with other contributors
Ready to start contributing? Check out our Contributing Guide
for next steps!