Skip to main content
Glama

start_server

Initialize a development server by specifying a command, process name, and optional parameters like port and working directory, designed for use with the Code MCP Server to enable AI interactions with VS Code.

Instructions

Start a development server

Input Schema

NameRequiredDescriptionDefault
commandYesServer command
cwdNoWorking directory
nameYesProcess name for reference
portNoPort number

Input Schema (JSON Schema)

{ "properties": { "command": { "description": "Server command", "type": "string" }, "cwd": { "description": "Working directory", "type": "string" }, "name": { "description": "Process name for reference", "type": "string" }, "port": { "description": "Port number", "type": "number" } }, "required": [ "command", "name" ], "type": "object" }

Implementation Reference

  • The exported startServer function serves as the entry point to start the MCP server. It instantiates VSCodeServer and calls its start method, handling any startup errors.
    export function startServer() { const server = new VSCodeServer() server.start().catch(async error => { await logToFile('Failed to start server:', error) process.exit(1) }) }
  • CLI registration: calls startServer() when running the default command to start the server.
    startServer();
  • Direct execution registration: calls startServer() if the file is executed directly.
    startServer()
  • The start() method of VSCodeServer class that connects the MCP Server using StdioServerTransport.
    public async start() { await this.log('Starting VS Code MCP Server...') const transport = new StdioServerTransport() await this.log('MCP Server starting with stdio transport') await this.server.connect(transport) await this.log('VS Code MCP Server started successfully') }
  • Comment and export indicating usage for CLI.
    // Export the startServer function for CLI usage export function startServer() { const server = new VSCodeServer() server.start().catch(async error => { await logToFile('Failed to start server:', error) process.exit(1) })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/block/vscode-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server