How do I call an MCP server in VS Code?
Set up the configuration
VS Code reads MCP server definitions from a configuration file or user settings. Each server entry includes a type, such as stdio or HTTP, plus the command or URL. Keep names short and clear so they are easy to find in the tool list.
Once the server starts, open the chat view and check the tools list. You can often trigger a tool by asking for a task that matches its description. Mention the tool name in your prompt if the model does not pick it on its own.
- Choose stdio for local servers
- Choose HTTP for remote servers
- Keep server names short
- Check output logs when a server fails
Troubleshooting
If a server fails, open its log output. Common problems include a wrong command path, a missing runtime such as Node or Python, or a port already in use. Fixing one of these usually gets the server running.
Restart the server after changing its configuration, since VS Code does not always reload it automatically. Restarting the editor is a reliable fallback when nothing else works.
- Check the command path
- Confirm the runtime is installed
- Look for a port conflict
- Restart the server after config changes
Common mistakes
- Using an absolute path that only works on another computer.
- Forgetting to restart the server after editing its config.
- Assuming every chat mode can use MCP tools.
