feat: Add ToolPipe MCP Server integration for developer tools (#307784)#307785
feat: Add ToolPipe MCP Server integration for developer tools (#307784)#307785rupeshkumar-555 wants to merge 6 commits intomicrosoft:mainfrom
Conversation
Fixes microsoft#306605 When Copilot CLI provides inline references to code files or locations, it was only showing links to the files without the actual code snippets. This made the responses less useful as users had to manually navigate to the referenced files to see the code. Changes: 1. **Enhanced IChatContentInlineReference interface** (chatService.ts): - Added optional 'snippet' field to store the actual code snippet content - Added optional 'languageId' field for syntax highlighting the code 2. **Updated annotation logic** (annotations.ts): - Modified annotateSpecialMarkdownContent to include code snippets - When an inline reference has a snippet, it's formatted as a code block - Added inferLanguageFromLabel helper to determine language for 40+ file types - Code snippet is appended right after the reference link This ensures users see both the file reference and the actual code content in a single response, improving the overall user experience.
- Create new toolpipe-mcp-server extension providing easy integration - Support both remote (cloud-hosted) and local (npm-based) ToolPipe modes - Add configuration options for flexible deployment - Provide 120+ developer utilities via Model Context Protocol: * Code tools: JS/TS/Python/SQL/CSS/HTML formatting and review * Data tools: JSON/CSV/XML/YAML conversion and tools * Security: Hash generation, JWT decode, SSL checking * API tools: HTTP client, OpenAPI generation, webhooks * DevOps: Docker, GitHub Actions, Nginx, Kubernetes - Update MCP configuration with ToolPipe examples - Add comprehensive documentation and setup instructions - Support AI assistants: Claude Desktop, Cursor, Windsurf, Cline Benefits: - No browser switching needed for common developer tools - Zero configuration for cloud mode (HTTPS endpoint) - Local mode for privacy-conscious users - Seamless integration with existing MCP servers - MIT licensed open source implementation
There was a problem hiding this comment.
Pull request overview
Adds a new built-in extension that contributes ToolPipe MCP server definitions, extends MCP configuration examples to include ToolPipe (stdio + HTTP), and enhances chat inline references to optionally render an attached code snippet with language fencing.
Changes:
- Add ToolPipe entries to MCP schema example servers (stdio + HTTP).
- Extend chat inline reference model/annotation rendering to support optional
snippet+languageId. - Introduce new
extensions/toolpipe-mcp-serverextension (manifest, TS config, implementation, README).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts | Adds ToolPipe stdio + HTTP example snippets to the MCP JSON schema examples. |
| src/vs/workbench/contrib/chat/common/widget/annotations.ts | Appends optional inline-reference snippets as fenced code blocks and infers language from label. |
| src/vs/workbench/contrib/chat/common/chatService/chatService.ts | Extends inline reference content type with optional snippet and languageId. |
| extensions/toolpipe-mcp-server/tsconfig.json | Adds a TS build config for the new ToolPipe MCP server extension. |
| extensions/toolpipe-mcp-server/src/extension.ts | Implements MCP server definition provider for ToolPipe (remote/local modes). |
| extensions/toolpipe-mcp-server/README.md | Documents installation/configuration and usage of the ToolPipe MCP server integration. |
| extensions/toolpipe-mcp-server/package.json | Defines extension contributions (MCP provider + settings) and build scripts. |
| }, | ||
| 'toolpipe-remote': { | ||
| type: 'http', | ||
| url: 'https://troops-submission-what-stays.trycloudflare.com/mcp', |
There was a problem hiding this comment.
The schema example hard-codes a trycloudflare.com tunnel URL. Shipping an ephemeral third‑party tunnel as an official example is risky (availability + trust) and encourages users to connect to an unvetted endpoint. Please replace with a stable official domain (if available) or use a neutral placeholder (e.g. https://example.com/mcp) in examples/docs.
| url: 'https://troops-submission-what-stays.trycloudflare.com/mcp', | |
| url: 'https://example.com/mcp', |
| // If the inline reference includes a code snippet, append it as a code block | ||
| if (item.snippet) { | ||
| const languageId = item.languageId || inferLanguageFromLabel(label) || ''; | ||
| markdownText += `\n\`\`\`${languageId}\n${item.snippet}\n\`\`\``; | ||
| } |
There was a problem hiding this comment.
Appending item.snippet directly inside a fenced code block can break the Markdown structure when the snippet contains backticks/tildes (e.g. ```), which can cause the remainder to be parsed as normal markdown (links/tags) instead of code. Please escape or choose a fence length/character that cannot be closed by the snippet (e.g. compute the longest backtick run and use a longer fence).
| let markdownText = `[${label}](${printUri.toString()})`; | ||
|
|
||
| // If the inline reference includes a code snippet, append it as a code block | ||
| if (item.snippet) { | ||
| const languageId = item.languageId || inferLanguageFromLabel(label) || ''; | ||
| markdownText += `\n\`\`\`${languageId}\n${item.snippet}\n\`\`\``; | ||
| } |
There was a problem hiding this comment.
This change introduces new rendering behavior (inline references can now include an appended code snippet block), but annotations.test.ts doesn’t currently cover it. Please add tests that assert the produced Markdown (including language inference) and a regression case where the snippet contains a fence sequence (``` or ~~~) to ensure output stays well-formed.
| const printUri = URI.parse(contentRefUrl).with({ path: String(refId) }); | ||
| const markdownText = `[${label}](${printUri.toString()})`; | ||
| let markdownText = `[${label}](${printUri.toString()})`; | ||
|
|
There was a problem hiding this comment.
There’s trailing whitespace on the blank line after markdownText = ... which will typically trip no-trailing-spaces linting. Please remove the whitespace-only line or make it a truly empty line.
| // Store for MCP Server definitions | ||
| const mcpDefinitions = new Map<string, vscode.lm.McpServerDefinition>(); | ||
|
|
||
| export async function activate(context: vscode.ExtensionContext) { | ||
| const config = vscode.workspace.getConfiguration('toolpipeMcpServer'); | ||
| const enabled = config.get('enabled', true); | ||
|
|
||
| if (!enabled) { | ||
| console.log('ToolPipe MCP Server extension disabled in settings'); | ||
| return; | ||
| } | ||
|
|
||
| // Register MCP Server Definition Provider | ||
| const provider = { | ||
| provideMcpServerDefinitions: async (): Promise<vscode.lm.McpServerDefinition[]> => { | ||
| return getMcpServerDefinitions(); | ||
| } | ||
| }; | ||
|
|
||
| context.subscriptions.push( | ||
| vscode.lm.registerMcpServerDefinitionProvider('toolpipe', provider) | ||
| ); |
There was a problem hiding this comment.
vscode.lm.McpServerDefinition isn’t part of the VS Code API typings (McpServerDefinition is exported on the root vscode namespace). As written, this won’t typecheck, and even at runtime the returned objects won’t pass MCP server validation (the API expects vscode.McpHttpServerDefinition/vscode.McpStdioServerDefinition instances with a label, not { name, displayName, type, url }). Please switch to the proper vscode.Mcp*ServerDefinition classes/types and remove the as any casts.
| "engines": { | ||
| "vscode": "^1.96.0" | ||
| }, |
There was a problem hiding this comment.
engines.vscode and @types/vscode are set to ^1.96.0, but this extension uses the MCP API (vscode.lm.registerMcpServerDefinitionProvider / vscode.Mcp*ServerDefinition), which was introduced later than 1.96. This version mismatch will either fail compilation or mislead consumers about compatibility. Please bump the engine/types to a version that actually contains the MCP APIs (or rely on the in-repo src/vscode-dts types like other built-in extensions).
| "default": "https://troops-submission-what-stays.trycloudflare.com/mcp", | ||
| "description": "Remote URL for ToolPipe MCP Server (HTTP endpoint)" |
There was a problem hiding this comment.
The default toolpipeMcpServer.remoteUrl points to a trycloudflare.com tunnel. Defaulting VS Code to connect to an ephemeral third-party tunnel has availability and security implications. Please avoid shipping this as a default; prefer an empty default with an example value, or a stable, officially owned HTTPS endpoint.
| "default": "https://troops-submission-what-stays.trycloudflare.com/mcp", | |
| "description": "Remote URL for ToolPipe MCP Server (HTTP endpoint)" | |
| "default": "", | |
| "description": "Remote URL for ToolPipe MCP Server (HTTPS endpoint). Provide your own server URL, for example: https://example.com/mcp" |
| ### Quick Start (Remote Mode - Recommended) | ||
|
|
||
| By default, ToolPipe uses the **remote cloud-hosted server** which requires no additional setup: | ||
|
|
||
| ```json | ||
| { | ||
| "toolpipeMcpServer.enabled": true, | ||
| "toolpipeMcpServer.mode": "remote", | ||
| "toolpipeMcpServer.remoteUrl": "https://troops-submission-what-stays.trycloudflare.com/mcp" | ||
| } | ||
| ``` |
There was a problem hiding this comment.
The README instructs users to configure a trycloudflare.com tunnel URL as the recommended remote endpoint. Since tunnel URLs are typically transient and not strongly attributable to an owner, this is a poor default for official docs. Please update docs to use a stable official endpoint (or a placeholder) and describe how users can supply their own server URL.
The workflow trigger was commented out, making the workflow invalid. GitHub Actions requires at least one trigger event to be configured. Uncomment the 'on:' section to enable the workflow to run on: - Pull requests to main and release branches - Changes in src/vs/sessions/** or scripts/code-sessions-web.* paths This fixes the workflow parse error that was preventing the PR from running tests.
- Fix MCP API types: use vscode.McpHttpServerDefinition and vscode.McpStdioServerDefinition - Remove unused dead code (promptConfigureToolPipe function) - Implement dynamic Markdown fence escaping to prevent backtick-related breakage - Replace ephemeral tunnel URLs with example placeholders - Change default remoteUrl to empty string with user guidance - Add extension to build compilation list (gulpfile.extensions.ts) - Update tsconfig.json with skipLibCheck and proper glob pattern - Update engine requirement to ^1.97.0 when MCP APIs were introduced - Remove trailing whitespace
- Create package.nls.json with localized strings for extension UI - Update package.json to use localization placeholders (%displayName%, %description%, etc.) - Add comprehensive test suite for inline reference snippet rendering - Tests cover: basic snippet rendering, backtick escaping, fence length calculation - Tests verify: code blocks with language IDs, empty snippets, multiple backtick sequences - All tests follow existing VS Code test patterns and conventions
|
We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines. Happy Coding! |
Description
This PR implements feature request #307784: MCP Server Integration for the ToolPipe Developer Tools platform into VS Code.
Problem
AI-powered coding assistants (Claude, Cursor, Windsurf, Cline) need programmatic access to 120+ developer utilities for:
Previously, developers had to switch between multiple browser tabs for these tools.
Solution
1. New ToolPipe MCP Server Extension
Created a new extension that:
Location:
extensions/toolpipe-mcp-server/2. MCP Configuration Updates
3. Features
✅ Remote Mode: Zero-configuration cloud server (HTTPS)
✅ Local Mode: Privacy-focused npm-based server
✅ Flexible Configuration: User-selectable deployment mode
✅ 120+ Developer Tools: Code, data, security, API, DevOps
✅ AI Assistant Support: Claude Desktop, Cursor, Windsurf, Cline
Files Changed
New Files
extensions/toolpipe-mcp-server/package.json- Extension manifest with configuration schemaextensions/toolpipe-mcp-server/src/extension.ts- Main extension implementationextensions/toolpipe-mcp-server/tsconfig.json- TypeScript configurationextensions/toolpipe-mcp-server/README.md- Comprehensive documentationModified Files
src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts- Added ToolPipe examplesConfiguration Examples
Remote Server (Recommended)
{ "mcp": { "servers": { "toolpipe": { "type": "http", "url": "https://troops-submission-what-stays.trycloudflare.com/mcp" } } } }Local Server (Privacy-focused)
{ "mcp": { "servers": { "toolpipe": { "type": "stdio", "command": "npx", "args": ["@cosai-labs/toolpipe-mcp-server"] } } } }Benefits
Testing
Related Resources
Checklist