Quick Start
How It Works
Transport Types
Choose how to connect to MCP servers:| Transport | Use Case | Example |
|---|---|---|
Stdio | Local subprocess | npx @anthropic/mcp-server-* |
HTTP | Remote API | https://api.example.com/mcp |
WebSocket | Realtime connection | wss://live.example.com/mcp |
Configuration Options
MCPBuilder Methods
| Method | Signature | Description |
|---|---|---|
name(n) | fn name(impl Into<String>) -> Self | Set server name |
server(cmd, args) | fn server(impl Into<String>, &[&str]) -> Self | Stdio transport |
http(url) | fn http(impl Into<String>) -> Self | HTTP transport |
websocket(url) | fn websocket(impl Into<String>) -> Self | WebSocket transport |
config(cfg) | fn config(MCPConfig) -> Self | Set full config |
security(sec) | fn security(SecurityConfig) -> Self | Set security |
build() | fn build(self) -> Result<MCP> | Build client |
MCP Methods
| Method | Signature | Description |
|---|---|---|
connect() | async fn connect(&mut self) -> Result<()> | Connect to server |
disconnect() | async fn disconnect(&mut self) -> Result<()> | Disconnect |
is_connected() | fn is_connected(&self) -> bool | Check connection |
list_tools() | async fn list_tools(&self) -> Result<Vec<MCPTool>> | List available tools |
list_resources() | async fn list_resources(&self) -> Result<Vec<MCPResource>> | List resources |
list_prompts() | async fn list_prompts(&self) -> Result<Vec<MCPPrompt>> | List prompts |
call_tool(call) | async fn call_tool(&self, MCPCall) -> Result<MCPCallResult> | Execute tool |
read_resource(uri) | async fn read_resource(&self, &str) -> Result<MCPContent> | Read resource |
Popular MCP Servers
| Server | Purpose | Command |
|---|---|---|
| Memory | Persistent memory | @anthropic/mcp-server-memory |
| Filesystem | File operations | @anthropic/mcp-server-filesystem |
| Fetch | HTTP requests | @anthropic/mcp-server-fetch |
| GitHub | GitHub API | @anthropic/mcp-server-github |
Best Practices
Use Stdio for local tools
Use Stdio for local tools
Stdio transport is simplest and most reliable for local MCP servers.
Set appropriate timeouts
Set appropriate timeouts
Increase timeout for slow-starting servers or remote connections.
Combine multiple servers
Combine multiple servers
Chain servers for rich capabilities - memory + filesystem + web.

