Configuration Guide
This guide covers all the configuration options available in easy-mcp-use.API Keys
Make sure to have the API key relative to the provider of your choice available in the environment. You can either: 1 - Create.env
file with your keys as:
.env
available in your runtime, granted that you run from where the .env is located.
2 - Set it in your environment by running in your terminal the following command, e.g. for OpenAI:
MCP Server Configuration
easy-mcp-use supports any MCP server through a flexible configuration system. (For a list of awesome servers you can visit https://github.com/punkpeye/awesome-mcp-servers or https://github.com/appcypher/awesome-mcp-servers which have an amazing collection of them) The configuration is defined in a JSON file with the following structure:Configuration Options
server_name
: A unique identifier for your MCP servercommand
: The command to start the MCP serverargs
: Array of arguments to pass to the commandenv
: Environment variables to set for the server
Example Configuration
Here’s a basic example of how to configure an MCP server:Multiple Server Configuration
You can configure multiple MCP servers in a single configuration file, allowing you to use different servers for different tasks or combine their capabilities (e.g.):Agent Configuration
When creating an MCPAgent, you can configure several parameters: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)serverName
: Name of the server to use (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)
Tool Access Control
You can restrict which tools are available to the agent for security or to limit its capabilities:- Restricting access to sensitive operations
- Limiting agent capabilities for specific tasks
- Preventing the agent from using potentially dangerous tools
- Focusing the agent on specific functionality
Error Handling
easy-mcp-use provides several ways to handle errors:- Connection Errors: Check your MCP server configuration and ensure the server is running
- Authentication Errors: Verify your API keys are correctly set in the environment
- Timeout Errors: Adjust the
maxSteps
parameter if operations are timing out