@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
77
88/**
99 * ToolPipe MCP Server Extension
10- *
10+ *
1111 * Provides integration with ToolPipe MCP Server, which offers 120+ developer utilities:
1212 * - Code tools: Review, minification, formatting (JS/TS/Python/SQL/CSS/HTML)
1313 * - Data tools: JSON/CSV/XML/YAML conversion, Base64, UUID generation
@@ -16,9 +16,6 @@ import * as vscode from 'vscode';
1616 * - DevOps: Docker Compose generation, GitHub Actions workflows, Nginx configs
1717 */
1818
19- // Store for MCP Server definitions
20- const mcpDefinitions = new Map < string , vscode . lm . McpServerDefinition > ( ) ;
21-
2219export async function activate ( context : vscode . ExtensionContext ) {
2320 const config = vscode . workspace . getConfiguration ( 'toolpipeMcpServer' ) ;
2421 const enabled = config . get ( 'enabled' , true ) ;
@@ -30,7 +27,7 @@ export async function activate(context: vscode.ExtensionContext) {
3027
3128 // Register MCP Server Definition Provider
3229 const provider = {
33- provideMcpServerDefinitions : async ( ) : Promise < vscode . lm . McpServerDefinition [ ] > => {
30+ provideMcpServerDefinitions : async ( ) : Promise < vscode . McpServerDefinition [ ] > => {
3431 return getMcpServerDefinitions ( ) ;
3532 }
3633 } ;
@@ -45,92 +42,36 @@ export async function activate(context: vscode.ExtensionContext) {
4542/**
4643 * Generates MCP Server definitions based on current configuration
4744 */
48- function getMcpServerDefinitions ( ) : vscode . lm . McpServerDefinition [ ] {
45+ function getMcpServerDefinitions ( ) : vscode . McpServerDefinition [ ] {
4946 const config = vscode . workspace . getConfiguration ( 'toolpipeMcpServer' ) ;
5047 const mode = config . get < string > ( 'mode' , 'remote' ) ;
5148
52- const definitions : vscode . lm . McpServerDefinition [ ] = [ ] ;
49+ const definitions : vscode . McpServerDefinition [ ] = [ ] ;
5350
5451 if ( mode === 'remote' ) {
55- const remoteUrl = config . get < string > ( 'remoteUrl' , 'https://troops-submission-what-stays.trycloudflare.com/mcp' ) ;
56- definitions . push ( {
57- name : 'toolpipe' ,
58- displayName : 'ToolPipe Developer Tools' ,
59- description : 'Access 120+ developer utilities for code, data, security, API, and DevOps tasks' ,
60- type : 'http' ,
61- url : remoteUrl ,
62- capabilities : {
63- tools : { } ,
64- resources : { }
65- }
66- } as any ) ;
52+ const remoteUrl = config . get < string > ( 'remoteUrl' , '' ) ;
53+ if ( remoteUrl ) {
54+ definitions . push (
55+ new vscode . McpHttpServerDefinition (
56+ 'ToolPipe Developer Tools' ,
57+ vscode . Uri . parse ( remoteUrl )
58+ )
59+ ) ;
60+ }
6761 } else if ( mode === 'local' ) {
6862 const command = config . get < string > ( 'localCommand' , 'npx' ) ;
6963 const args = config . get < string [ ] > ( 'localArgs' , [ '@cosai-labs/toolpipe-mcp-server' ] ) ;
70-
71- definitions . push ( {
72- name : 'toolpipe' ,
73- displayName : 'ToolPipe Developer Tools (Local)' ,
74- description : 'Access 120+ developer utilities via locally-hosted ToolPipe server' ,
75- type : 'stdio' ,
76- command,
77- args,
78- capabilities : {
79- tools : { } ,
80- resources : { }
81- }
82- } as any ) ;
83- }
84-
85- return definitions ;
86- }
8764
88- /**
89- * Prompts user to configure ToolPipe if not already configured
90- */
91- async function promptConfigureToolPipe ( ) : Promise < void > {
92- const config = vscode . workspace . getConfiguration ( 'toolpipeMcpServer' ) ;
93-
94- if ( config . get ( 'configured' ) ) {
95- return ;
65+ definitions . push (
66+ new vscode . McpStdioServerDefinition (
67+ 'ToolPipe Developer Tools (Local)' ,
68+ command ,
69+ args
70+ )
71+ ) ;
9672 }
9773
98- const choice = await vscode . window . showQuickPick (
99- [
100- {
101- label : 'Use Remote Server (Cloud-hosted)' ,
102- description : 'Connect to ToolPipe cloud server (no setup required)' ,
103- value : 'remote'
104- } ,
105- {
106- label : 'Use Local Server (npm-based)' ,
107- description : 'Run ToolPipe locally: npx @cosai-labs/toolpipe-mcp-server' ,
108- value : 'local'
109- } ,
110- {
111- label : 'Skip Configuration' ,
112- description : 'Configure later' ,
113- value : 'skip'
114- }
115- ] ,
116- { placeHolder : 'Choose ToolPipe server mode' }
117- ) ;
118-
119- if ( ! choice ) {
120- return ;
121- }
122-
123- if ( choice . value === 'skip' ) {
124- return ;
125- }
126-
127- // Update configuration
128- await config . update ( 'mode' , choice . value , vscode . ConfigurationTarget . Global ) ;
129- await config . update ( 'configured' , true , vscode . ConfigurationTarget . Global ) ;
130-
131- vscode . window . showInformationMessage (
132- `ToolPipe MCP Server configured to use ${ choice . value } mode. Settings can be changed in preferences.`
133- ) ;
74+ return definitions ;
13475}
13576
13677export function deactivate ( ) {
0 commit comments