openmcp-client
CLAUDE.md751 starsChanged 19 months agoApache-2.0View on GitHub
All communication flows through MessageBridge class in renderer/src/api/message-bridge.ts.
The file
We split this CLAUDE.md into the rules it gives an agent
12 rules. About 0 are common, 2 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 72
All communication flows through MessageBridge class in renderer/src/api/message-bridge.ts.
- Very specific: line 129
Service Layer: Add controller in service/src/mcp/
- Very specific: line 130
Router Registration: Add to ModuleControllers in service/src/common/router.ts
- Very specific: line 131
Frontend Integration: Add API calls in renderer/src/api/
- Very specific: line 132
UI Components: Create components in renderer/src/components/
- Distinctive: line 136
Validation: Test tools/resources in respective panels
- Distinctive: line 137
Integration: Verify LLM interaction in chat interface
- Very specific: line 141
Build Dependencies: Run npm run build to build all modules
- Very specific: line 142
Prepare Extension: Run npm run vscode:prepublish to bundle extension code
- Very specific: line 143
Create Package: Run vsce package to generate .vsix file
- Very specific: line 144
Install Locally: Use code --install-extension openmcp-x.x.x.vsix for testing
- Very specific: line 145
Publish: Run vsce publish (requires marketplace publisher account)
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Development Commands
Setup and Installation
npm run setup # Install dependencies and prepare OCR resourcesDevelopment
npm run serve # Start all services in development mode (uses Turbo)
npm run build # Build all modules
npm run build:all # Build all modules (alias)
npm run build:electron # Build only Electron appService Development
cd service
npm run serve # Start service with hot reload (nodemon + tsx)
npm run build # Compile TypeScript to dist/
npm run debug # Start with Node.js inspector
npm run typecheck # Type checking without emitRenderer Development
cd renderer
npm run serve # Start Vite dev server
npm run build # Build for production
npm run serve:website # Start in website mode
npm run type-check # Vue TypeScript checkingVSCode Extension
npm run vscode:prepublish # Prepare for VSCode publishing (Rollup build)
npm run compile # Compile TypeScript
npm run watch # Watch mode compilation
vsce package # Create VSIX package for distribution
vsce publish # Publish to VSCode Marketplace (requires auth)Quality Assurance
npm run lint # ESLint for TypeScript files
npm run pretest # Run compile and lint
npm run test # Run testsArchitecture Overview
Multi-Module Structure
OpenMCP follows a layered modular architecture with three main deployment targets:
- VSCode Extension (
src/extension.ts) - IDE integration - Service Layer (
service/) - Node.js backend handling MCP protocol - Renderer Layer (
renderer/) - Vue.js frontend for UI
Key Architectural Patterns
Message Bridge Communication
The system uses a message bridge pattern for cross-platform communication:
- VSCode: Uses
vscode.postMessageAPI - Electron: Uses IPC communication
- Web: Uses WebSocket connections
- Node.js: Uses EventEmitter for SDK mode
All communication flows through MessageBridge class in renderer/src/api/message-bridge.ts.
MCP Client Management
- Connection Management:
service/src/mcp/connect.service.tshandles multiple MCP server connections - Client Pooling:
clientMapmaintains active MCP client instances with UUID-based identification - Transport Abstraction: Supports STDIO, SSE, and StreamableHTTP transports
- Auto-reconnection:
McpServerConnectMonitorhandles connection monitoring
Request/Response Flow
Frontend (Vue) → MessageBridge → Service Router → MCP Controllers → MCP SDK → External MCP ServersImportant Service Patterns
Preprocessing Commands
service/src/mcp/connect.service.ts includes automatic environment setup:
- Python projects: Auto-runs
uv syncand installs MCP CLI - Node.js projects: Auto-runs
npm installif node_modules missing - Path resolution: Handles
~/home directory expansion
OCR Integration
Built-in OCR using Tesseract.js:
- Images from MCP responses are automatically processed
- Base64 images saved to temp files and queued for OCR
- Results delivered via worker threads
Frontend Architecture (Vue 3)
State Management
- Panel System: Tab-based interface in
renderer/src/components/main-panel/ - Reactive Connections: MCP connection state managed reactively
- Multi-language: Vue i18n with support for 9 languages
Core Components
- Chat Interface:
main-panel/chat/- LLM interaction with MCP tools - Tool Testing:
main-panel/tool/- Direct MCP tool invocation - Resource Browser:
main-panel/resource/- MCP resource exploration - Prompt Manager:
main-panel/prompt/- System prompt templates
Build System
Turbo Monorepo
Uses Turbo for coordinated builds across modules:
- Dependency ordering: Renderer builds before Electron
- Parallel execution: Service and Renderer can build concurrently
- Task caching: Disabled for development iterations
Rollup Configuration
VSCode extension uses Rollup for optimal bundling:
- ES modules: Output as ESM format
- External dependencies: VSCode API marked as external
- TypeScript: Direct compilation without webpack
Development Workflow
Adding New MCP Features
- Service Layer: Add controller in
service/src/mcp/ - Router Registration: Add to
ModuleControllersinservice/src/common/router.ts - Frontend Integration: Add API calls in
renderer/src/api/ - UI Components: Create components in
renderer/src/components/
Testing MCP Servers
- Connection: Configure in connection panel (STDIO/SSE/HTTP)
- Validation: Test tools/resources in respective panels
- Integration: Verify LLM interaction in chat interface
Packaging VSCode Extension
- Build Dependencies: Run
npm run buildto build all modules - Prepare Extension: Run
npm run vscode:prepublishto bundle extension code - Create Package: Run
vsce packageto generate.vsixfile - Install Locally: Use
code --install-extension openmcp-x.x.x.vsixfor testing - Publish: Run
vsce publish(requires marketplace publisher account)
Platform-Specific Considerations
- VSCode: Uses webview API, limited to extension context
- Electron: Full desktop app capabilities, local service spawning
- Web: Requires external service, WebSocket limitations
- SDK: Embedded in other Node.js applications
Important Files
Configuration
turbo.json- Monorepo build orchestrationrollup.config.js- VSCode extension bundlingservice/package.json- Backend dependencies and scriptsrenderer/package.json- Frontend dependencies and scripts
Core Architecture
src/extension.ts- VSCode extension entry pointservice/src/main.ts- Service WebSocket serverservice/src/common/router.ts- Request routing systemrenderer/src/api/message-bridge.ts- Cross-platform communicationservice/src/mcp/client.service.ts- MCP client implementation
Development Reminders
- Service Startup:
- 不要自行启动服务器,run serve只能由用户操作
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

