Skip to main content

Configuration Guide

This guide covers all the configuration options available in OmniMind.

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:
and load it in Python using
This will make all the keys defined in .env available in your Python 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:
and then import it in your Python code as:
or any other method you might prefer.

MCP Server Configuration

OmniMind 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:
MCP servers can use different connection types (STDIO, HTTP). For details on these connection types and how to configure them, see the Connection Types guide.

Configuration Options

  • server_name: A unique identifier for your MCP server
  • command: The command to start the MCP server
  • args: Array of arguments to pass to the command
  • env: 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.):
For a complete example of using multiple servers, see the multi-server example in our repository.

Agent Configuration

When creating an MCPAgent, you can configure several parameters:

Available Parameters

  • config_path: Path to the server configuration file.
  • api_key: Authentication key for accessing services.
  • server_name: Specifies the target server for tasks.

Error Handling

OmniMind provides several ways to handle errors:
  1. Connection Errors: Check your MCP server configuration and ensure the server is running
  2. Authentication Errors: Verify your API keys are correctly set in the environment
  3. Timeout Errors: Adjust the max_steps parameter if operations are timing out

Best Practices

  1. Always use environment variables for sensitive information
  2. Keep configuration files in version control (without sensitive data)
  3. Use appropriate timeouts for different types of operations
  4. Enable verbose logging during development
  5. Test configurations in a development environment before production