MCP Tools Documentation
Facilitates real-time tool discovery and documentation retrieval for command-line tools within a VSCode extension, using Express and SSE for secure and dynamic content streaming.
patelnav
README
MCP Tools Documentation
A VSCode/Cursor extension that provides an integrated MCP server and UI panel for retrieving and displaying command-line tool documentation. The extension automatically detects tools in your workspace and provides their documentation through a WebView panel.
Core Features
-
š Built-in MCP Server
- Express + SSE server (ports 54321-54421)
- Secure origin validation
- Automatic port selection
- Connection management and cleanup
- Real-time event streaming
-
š Tool Discovery
- Package scripts (npm, yarn, pnpm)
- Local binaries (node_modules/.bin)
- Global tools (git, npm, yarn, pnpm)
- Monorepo workspace support
-
š Documentation Retrieval
- Help command execution (-h, --help)
- Version information fetching
- Secure command validation
- Error handling
-
š» VS Code Integration
- React-based WebView panel
- Status bar integration
- Command palette support
- Workspace path detection
Architecture
1. VS Code Extension (Backend)
Extension Host (src/extension.ts)
āāā Activates when VS Code starts
āāā Creates MCP Server
ā āāā Express + SSE Server (54321-54421 port range)
āāā Creates WebView Panel
2. MCP Server (Middle Layer)
MCP Server (src/server/*)
āāā SSE Event Stream
ā āāā Real-time tool discovery updates
ā āāā Documentation streaming
ā āāā Connection state management
ā
āāā Tool Discovery System
āāā path-scanner.ts
ā āāā Finds tools in workspace (bin/, node_modules/.bin)
āāā package-scanner.ts
āāā Scans package.json for available tools
3. WebView Panel (Frontend)
React WebView (src/panel/*)
āāā UI Components
ā āāā Shows available tools and their docs
ā
āāā SSE Client
āāā Requests available tools
āāā Streams tool documentation
Project Structure
my-tools-mcp/
āāā src/ # Source code
ā āāā extension.ts # Extension entry point
ā āāā env.ts # Environment configuration
ā āāā server/ # Built-in MCP server
ā ā āāā index.ts # Server setup and SSE handling
ā ā āāā controllers/ # Tool discovery and execution
ā ā āāā docs/ # Documentation controllers
ā ā āāā path-scanner.ts # Tool discovery
ā ā āāā package-scanner.ts # Package.json scanning
ā āāā panel/ # WebView UI (React)
ā ā āāā index.tsx # WebView entry point
ā ā āāā App.tsx # Main React component
ā ā āāā components/ # UI components
ā āāā types/ # Shared TypeScript types
ā āāā lib/ # Shared utilities
āāā dist/ # Compiled output
āāā src/__tests__/ # Test files
Development Setup
- Install dependencies:
pnpm install
- Start development:
# Start webpack in watch mode
pnpm run dev
# Or build for production
pnpm run build
- Launch the extension:
- Press F5 in VSCode to start debugging
- The extension will start both the MCP server and WebView panel
Usage
- Open the command palette (Cmd/Ctrl + Shift + P)
- Type "MCP Tools" and select the command
- The WebView panel will open and display available tools
- Select a tool to view its documentation
Technical Details
Tool Discovery
-
Package Scripts
- Automatically detects npm/yarn/pnpm scripts
- Shows script source and working directory
- Supports monorepo workspaces
- Validates script existence
-
Binary Tools
- Finds tools in node_modules/.bin
- Detects global tools (git, npm, yarn, pnpm)
- Validates tool existence and permissions
- Handles path resolution
Documentation Retrieval
- Executes help commands (-h, --help)
- Fetches version information
- Handles command execution errors
- Validates tool names and arguments
- Implements proper timeouts
SSE Communication
- Real-time tool discovery updates
- Secure origin validation
- Connection management and cleanup
- Error handling and reporting
- Automatic reconnection support
- Event-based streaming
- Bi-directional message passing
Security Features
- Tool name validation
- Command injection prevention
- Origin validation for SSE connections
- Proper error handling and reporting
- Resource cleanup
- Connection state management
Testing
The extension includes comprehensive tests:
- Integration tests for server functionality
- VS Code extension tests
- Tool discovery tests
- Security validation tests
- SSE communication tests
License
ISC
Recommended Servers
E2B
Using MCP to run code via e2b.
React MCP
react-mcp integrates with Claude Desktop, enabling the creation and modification of React apps based on user prompts
AIO-MCP Server
š All-in-one MCP server with AI search, RAG, and multi-service integrations (GitLab/Jira/Confluence/YouTube) for AI-enhanced development workflows. Folk from
Supabase MCP Server (used by Deploya.dev)
Enables Cursor and Windsurf to safely interact with Supabase databases by providing tools for database management, SQL query execution, and Supabase Management API access with built-in safety controls.
OpenRouter MCP Server
Provides integration with OpenRouter.ai, allowing access to various AI models through a unified interface.
Any OpenAI Compatible API Integrations
Integrate Claude with Any OpenAI SDK Compatible Chat Completion API - OpenAI, Perplexity, Groq, xAI, PyroPrompts and more.
Exa MCP
A Model Context Protocol server that enables AI assistants like Claude to perform real-time web searches using the Exa AI Search API in a safe and controlled manner.
Aindreyway Codex Keeper
Serves as a guardian of development knowledge, providing AI assistants with curated access to latest documentation and best practices.
MySQL Server
Allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
Browser Use (used by Deploya.dev)
AI-driven browser automation server that implements the Model Context Protocol to enable natural language control of web browsers for tasks like navigation, form filling, and visual interaction.