Looking for client configuration? This guide covers agent-specific configuration. For MCP client and server connection setup, see the Client Configuration guide.
Basic Configuration
Create an agent with minimal configuration:Agent Parameters
When creating an MCPAgent, you can configure several parameters to customize its behavior:Available Parameters
llm: Any LangChain-compatible language model (required)client: The MCPClient instance (optional if connectors are provided)connectors: List of connectors if not using client (optional)maxSteps: Maximum number of steps the agent can take (default: 5)autoInitialize: Whether to initialize automatically (default: false)memoryEnabled: Whether to enable memory (default: true)systemPrompt: Custom system prompt (optional)systemPromptTemplate: Custom system prompt template (optional)additionalInstructions: Additional instructions for the agent (optional)disallowedTools: List of tool names that should not be available to the agent (optional)useServerManager: Enable dynamic server selection (default: false)
Tool Access Control
You can restrict which tools are available to the agent for security or to limit its capabilities. Here’s a complete example showing how to set up an agent with restricted tool access:Server Manager
The Server Manager is an agent-level feature that enables dynamic server selection for improved performance with multi-server setups. To improve efficiency and potentially reduce agent confusion when many tools are available, you can enable the Server Manager by settinguseServerManager: true when creating the MCPAgent.