vtcode-mcp

June 17, 2026 · View on GitHub

Model Context Protocol (MCP) client, connection pooling, and tool discovery for VT Code.

Overview

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.

Module Groups

AreaModulesDescription
Clientclient.rs, provider.rs, rmcp_client.rsMCP client implementations
Transportrmcp_transport.rs, connection_pool.rsTransport layer and connection management
Discoverytool_discovery.rs, tool_discovery_cache.rs, schema.rsTool discovery and caching
Typestypes.rs, traits.rs, errors.rs, enhanced_config.rsType definitions and configuration
Utilsutils.rsUtility functions

Key Components

Client

The MCP client handles communication with MCP servers, including request/response handling and protocol negotiation.

Connection Pool

Connection pooling manages multiple MCP server connections efficiently, reducing overhead for repeated requests.

Tool Discovery

Tool discovery automatically finds and catalogs available tools from MCP servers:

  • tool_discovery.rs — discovers tools from connected servers
  • tool_discovery_cache.rs — caches discovered tools for performance
  • schema.rs — tool schema validation

Architecture Notes

  • cli.rs stays in vtcode-core (depends on crate::cli::input_hardening)
  • rmcp_client is pub(crate) — not part of the public API
  • convert_to_rmcp() is pub(crate) — internal JSON bridge
  • rmcp-reqwest is a renamed reqwest with rustls features — not the same as the workspace reqwest

Configuration

MCP servers are configured through vtcode.toml:

[mcp]
servers = [
  { name = "example", url = "http://localhost:3000" }
]

Environment variables:

  • DEFAULT_ENV_VARS is platform-conditional (#[cfg(unix)] / #[cfg(windows)])

Dependencies

  • vtcode-config — MCP configuration
  • vtcode-commons — shared utilities
  • vtcode-utility-tool-specs — tool specifications

See Also