Model Context Protocol (MCP) client, connection pooling, and tool discovery for VT Code.
Layer 1 crate that provides MCP integration, enabling VT Code to connect to MCP servers for extended tool capabilities. Includes connection pooling, tool discovery, and schema validation.
| Area | Modules | Description |
|---|---|---|
| Client | client.rs, provider.rs, rmcp_client.rs |
MCP client implementations |
| Transport | rmcp_transport.rs, connection_pool.rs |
Transport layer and connection management |
| Discovery | tool_discovery.rs, tool_discovery_cache.rs, schema.rs |
Tool discovery and caching |
| Types | types.rs, traits.rs, errors.rs, enhanced_config.rs |
Type definitions and configuration |
| Utils | utils.rs |
Utility functions |
The MCP client handles communication with MCP servers, including request/response handling and protocol negotiation.
Connection pooling manages multiple MCP server connections efficiently, reducing overhead for repeated requests.
Tool discovery automatically finds and catalogs available tools from MCP servers:
tool_discovery.rs— discovers tools from connected serverstool_discovery_cache.rs— caches discovered tools for performanceschema.rs— tool schema validation
cli.rsstays in vtcode-core (depends oncrate::cli::input_hardening)rmcp_clientispub(crate)— not part of the public APIconvert_to_rmcp()ispub(crate)— internal JSON bridgermcp-reqwestis a renamedreqwestwith rustls features — not the same as the workspacereqwest
MCP servers are configured through vtcode.toml:
[mcp]
servers = [
{ name = "example", url = "http://localhost:3000" }
]Environment variables:
DEFAULT_ENV_VARSis platform-conditional (#[cfg(unix)]/#[cfg(windows)])
vtcode-config— MCP configurationvtcode-commons— shared utilitiesvtcode-utility-tool-specs— tool specifications
- MCP Integration Guide — setup and usage
- Tool Specifications — tool definitions
- Security Model — MCP security considerations