Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions mcp_server_odoo/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ def main(argv: Optional[list[str]] = None) -> int:
Returns:
Exit code (0 for success, non-zero for failure)
"""
# Load environment variables from .env file
load_dotenv()

# Create argument parser
parser = argparse.ArgumentParser(
Expand Down
12 changes: 8 additions & 4 deletions mcp_server_odoo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,16 @@ def load_config(env_file: Optional[Path] = None) -> OdooConfig:
)
load_dotenv(env_file)
else:
# Check current directory for .env
# Try to load .env from current directory
default_env = Path(".env")
env_loaded = False

if default_env.exists():
load_dotenv()
elif not os.getenv("ODOO_URL"):
# No .env file and no ODOO_URL in environment
load_dotenv(default_env)
env_loaded = True

# If no .env file found and no ODOO_URL in environment, raise error
if not env_loaded and not os.getenv("ODOO_URL"):
raise ValueError(
"No .env file found and ODOO_URL not set in environment.\n"
"Please create a .env file based on .env.example or set environment variables."
Expand Down
2 changes: 1 addition & 1 deletion mcp_server_odoo/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
logger = get_logger(__name__)

# Server version
SERVER_VERSION = "0.1.0"
SERVER_VERSION = "0.3.1"


class OdooMCPServer:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "mcp-server-odoo"
version = "0.3.0"
version = "0.3.1"
description = "A Model Context Protocol server for Odoo ERP systems"
readme = "README.md"
requires-python = ">=3.10"
Expand Down