Skip to content

MCP Integration

Vinh Nguyen edited this page Aug 5, 2026 · 1 revision

MCP Integration

VT Code connects to external Model Context Protocol (MCP) servers as a client, and can also expose its own tools as an embedded MCP server. This page mirrors the MCP specification.

Enabling MCP

[mcp]
enabled = true
max_concurrent_connections = 5
request_timeout_seconds = 30
retry_attempts = 3

Configuring Providers

Stdio transport

[[mcp.providers]]
name = "time"
enabled = true
command = "uvx"
args = ["mcp-server-time"]
working_directory = "./servers/time"
max_concurrent_requests = 2

[mcp.providers.env]
PYTHONUNBUFFERED = "1"

HTTP transport

[[mcp.providers]]
name = "figma"
enabled = true
endpoint = "https://mcp.figma.com/mcp"
api_key_env = "FIGMA_MCP_TOKEN"
protocol_version = "2025-06-18"
headers = { "X-Client" = "vtcode" }

startup_timeout_seconds and tool_timeout_seconds override the global defaults per provider; setting them to 0 disables the timeout (handy for first-run npm downloads).

Allowlists

MCP access is gated by pattern-based allowlists. Provider-specific rules override defaults:

[mcp.allowlist]
enforce = true

[mcp.allowlist.default]
resources = ["docs/*"]

[mcp.allowlist.providers.context7]
resources = ["journals/*"]

Here context7 can only access journals/*, while other providers match docs/*. Enable enforce = true to make rules mandatory.

Security

[mcp.security]
auth_enabled = true
api_key_env = "VT_MCP_API_KEY"

[mcp.security.rate_limit]
requests_per_minute = 120
concurrent_requests = 6

[mcp.security.validation]
schema_validation_enabled = true
path_traversal_protection = true

Embedded MCP Server

Expose curated VT Code tools over SSE or HTTP:

[mcp.server]
enabled = true
bind_address = "127.0.0.1"
port = 3030
transport = "sse"
exposed_tools = ["read_file"]

TUI

  • /mcp manages MCP connections from the TUI.
  • [mcp.ui] controls event rendering: mode (compact), max_events, show_provider_names, and per-provider renderers.

Troubleshooting

  • Unexpected tool permissions — provider rules override defaults; missing patterns may block tools the defaults would allow.
  • TOML ordering — keep [mcp] keys after any nested [mcp.ui] section; a new header resets the table context.
  • HTTP transport — requires a streaming implementation (SSE); use stdio transports when possible.

Related

Clone this wiki locally