MongoDB for VS Code Extension includes the MongoDB MCP server, a model context protocol (MCP) server that lets you interact with your MongoDB data from AI assistants and tools.MongoDB for VS Code Extension包括MongoDB MCP服务器,这是一个模型上下文协议(MCP)服务器,允许您从AI助手和工具与MongoDB数据进行交互。
To learn more about the MongoDB MCP server, see the MongoDB MCP Server documentation.要了解有关MongoDB MCP服务器的更多信息,请参阅MongoDB MCP服务器文档。
Overview概述
The MongoDB MCP Server lets you use natural language to interact with your MongoDB data from AI clients like Github Copilot, and any other MCP-compatible AI clients in VS Code.MongoDB MCP服务器允许您使用自然语言与来自Github Copilot等AI客户端以及VS Code中任何其他兼容MCP的AI客户端的MongoDB数据进行交互。
The MongoDB MCP server in the VS Code Extension uses the same connection as your active MongoDB connection in VS Code. When you switch connections in VS Code, the MCP server automatically updates to proxy the new connection. The server runs locally on your machine and only provides access to the MongoDB deployment that you're currently connected to in VS Code.VS Code扩展中的MongoDB MCP服务器使用与VS Code中活动的MongoDB连接相同的连接。当您在VS Code中切换连接时,MCP服务器会自动更新以代理新连接。服务器在机器上本地运行,只提供对您当前在VS Code中连接的MongoDB部署的访问。
Note
You can configure the MCP server to start automatically when you use the VS Code Extension to connect to your MongoDB deployment. For details, see the mdb.mcp.server setting.您可以将MCP服务器配置为在使用VS Code扩展连接到MongoDB部署时自动启动。有关详细信息,请参阅mdb.mcp.server设置。
Manage the MCP Server管理MCP服务器
To manage the MongoDB MCP server from the VS Code Extension, see the MCP Server settings.要从VS Code扩展管理MongoDB MCP服务器,请参阅MCP服务器设置。
The MongoDB VS Code Extension also includes the following commands:MongoDB VS Code扩展还包括以下命令: