This guide covers advanced features and power user configurations for MCP Connect.
Configure advanced HTTP transport settings:
{
"servers": {
"my-server": {
"remote": {
"type": "streamable-http",
"url": "https://api.example.com/mcp",
"headers": [
{
"key": "Authorization",
"value": "Bearer ${TOKEN}"
},
{
"key": "X-Custom-Header",
"value": "custom-value"
}
]
},
"timeout": 60,
"retryAttempts": 5
}
}
}
Customize retry behavior per server:
{
"servers": {
"unreliable-server": {
"remote": { ... },
"timeout": 30,
"retryAttempts": 10
}
}
}
Change the namespace separator:
{
"routing": {
"method": "namespace-prefix",
"separator": "::"
}
}
This results in tools like github::search_code instead of github/search_code.
For complex routing, you can use different separators, but each server must use the same separator configured in routing.
Use different .env files for different environments:
{
"envFile": ".env.production"
}
Or use environment-specific files:
.env.development.env.production.env.localEnvironment variables are substituted in:
{
"remote": {
"url": "https://${API_HOST}/mcp",
"headers": [
{
"key": "Authorization",
"value": "Bearer ${${ENV_PREFIX}_TOKEN}"
}
]
}
}
Use the legacy load balancing mode for distributing requests across multiple endpoints:
mcp-connect load-balance \
--endpoints "https://api1.example.com/mcp,https://api2.example.com/mcp" \
--transport http \
--timeout 30
Start the server with debug logging:
mcp-connect serve --debug
Set log level for detailed output:
mcp-connect serve --log-level trace
Available levels: trace, debug, info, warn, error
Test a specific server with debug output:
mcp-connect config test github --debug
MCP Connect automatically manages connections. For high-throughput scenarios:
When adding multiple servers, use batch scripts:
#!/bin/bash
mcp-connect config add github modelcontextprotocol/github-mcp-server
mcp-connect config add context7 --search
mcp-connect config add filesystem modelcontextprotocol/server-filesystem
Your registry should implement:
GET /servers?limit={limit}&cursor={cursor}GET /servers?search={query}GET /servers/{name}/versions/{version}If your registry requires authentication, configure it in the registry URL or headers (if supported by your registry implementation).
Automate configuration generation:
#!/bin/bash
# Generate configs for all IDEs
mcp-connect generate --ide zed
mcp-connect generate --ide vscode
mcp-connect generate --ide cursor
Use in CI/CD pipelines:
# GitHub Actions example
- name: Test MCP Connect
run: |
mcp-connect config validate
mcp-connect config test --all
Run MCP Connect in Docker:
FROM rust:1.75 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates
COPY --from=builder /app/target/release/mcp-connect /usr/local/bin/
WORKDIR /workspace
ENTRYPOINT ["mcp-connect"]
.env files: Already in .gitignore.env periodicallychmod 600 .envMCP Connect can be integrated into custom applications:
use mcp_config::ConfigManager;
use mcp_connect::commands::serve;
// Load configuration
let mut manager = ConfigManager::new()?;
let config = manager.load()?;
// Use configuration programmatically
for (name, server) in config.servers {
println!("Server: {} - {}", name, server.description.unwrap_or_default());
}
Set up webhooks to automatically update configurations:
# Webhook endpoint that updates config
curl -X POST https://your-webhook.com/update-config \
-H "Content-Type: application/json" \
-d @updated-config.json
Enable structured logging:
mcp-connect serve --log-level info > mcp-connect.log 2>&1
Monitor server health:
# Check server status
mcp-connect config test --all
# Validate configuration
mcp-connect config validate
Increase timeout for slow networks:
{
"servers": {
"slow-server": {
"timeout": 120
}
}
}
For many servers, monitor memory usage:
# Check process memory
ps aux | grep mcp-connect
Use Rust profiling tools:
# Install cargo-flamegraph
cargo install flamegraph
# Profile the server
cargo flamegraph --bin mcp-connect -- serve