mcp_use configuration is organized into two main areas: Client Configuration for connecting to MCP servers, and Agent Configuration for customizing agent behavior and LLM integration.
from mcp_use import MCPAgentfrom langchain_openai import ChatOpenAI# Configure your agent with an LLMllm = ChatOpenAI(model="gpt-4o")agent = MCPAgent(llm=llm, client=client)
Set up your MCPClient to connect to MCP servers. This includes configuring server connections, managing API keys, and setting up multi-server environments.Start here:Client Configuration Guide →
2
Agent Configuration
Configure your MCPAgent’s behavior, including LLM integration, tool restrictions, memory settings, and custom prompts.Continue with:Agent Configuration Guide →
# Complex multi-server configurationclient = MCPClient.from_config_file("multi-server.json")agent = MCPAgent( llm=llm, client=client, use_server_manager=True, # Auto-select servers system_prompt="You have access to web browsing, file operations, and API tools.")