mcp-chat 0.0.5__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-chat
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Simple CLI MCP Client to quickly test and explore MCP servers from the command line
5
5
  Project-URL: Bug Tracker, https://github.com/hideya/mcp-client-langchain-py/issues
6
6
  Project-URL: Source Code, https://github.com/hideya/mcp-client-langchain-py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-chat"
3
- version = "0.0.5"
3
+ version = "0.0.6"
4
4
  description = "Simple CLI MCP Client to quickly test and explore MCP servers from the command line"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -34,7 +34,10 @@ except ImportError as e:
34
34
  sys.exit(1)
35
35
 
36
36
  # Local application imports
37
- from .config_loader import load_config
37
+ try:
38
+ from .config_loader import load_config # Package import
39
+ except ImportError:
40
+ from config_loader import load_config # Direct script import
38
41
 
39
42
  # Type definitions
40
43
  ConfigType = dict[str, Any]
@@ -52,10 +55,23 @@ class Colors(str, Enum):
52
55
 
53
56
  def parse_arguments() -> argparse.Namespace:
54
57
  """Parse and return command line args for config path and verbosity."""
58
+ # Try to get version, with fallback for development
59
+ try:
60
+ from . import __version__
61
+ version = __version__
62
+ except ImportError:
63
+ # Fallback for development (running script directly)
64
+ version = "dev"
65
+
55
66
  parser = argparse.ArgumentParser(
56
67
  description="CLI Chat Application",
57
68
  formatter_class=argparse.ArgumentDefaultsHelpFormatter
58
69
  )
70
+ parser.add_argument(
71
+ "--version",
72
+ action="version",
73
+ version=f"%(prog)s {version}"
74
+ )
59
75
  parser.add_argument(
60
76
  "-c", "--config",
61
77
  default="llm_mcp_config.json5",
@@ -237,46 +253,16 @@ async def run() -> None:
237
253
  """Main async function to set up and run the simple chat app."""
238
254
  mcp_cleanup: McpServerCleanupFn | None = None
239
255
  try:
240
- # Debug: Check working directory and .env file existence
241
- import os
242
- from pathlib import Path
243
-
244
- print(f"DEBUG: Current working directory: {os.getcwd()}")
245
- env_file = Path(".env")
246
- print(f"DEBUG: .env file exists: {env_file.exists()}")
247
- if env_file.exists():
248
- print(f"DEBUG: .env file path: {env_file.absolute()}")
249
-
250
- # Try to load .env file with multiple strategies
251
- from pathlib import Path
252
-
253
- # Strategy 1: Try current working directory
256
+ # Load environment variables from .env file
257
+ # Workaround: For some reason, load_dotenv() without arguments
258
+ # sometimes fails to find the .env file in the current directory
259
+ # when installed via PyPI.
260
+ # Explicitly specifying the path works reliably.
254
261
  env_file = Path(".env")
255
262
  if env_file.exists():
256
263
  load_dotenv(env_file)
257
- print(f"DEBUG: Loaded .env from: {env_file.absolute()}")
258
- else:
259
- # Strategy 2: Try default load_dotenv behavior
260
- result = load_dotenv()
261
- print(f"DEBUG: load_dotenv() default result: {result}")
262
-
263
- # Strategy 3: Try looking in parent directories
264
- current_dir = Path.cwd()
265
- for parent in [current_dir] + list(current_dir.parents):
266
- potential_env = parent / ".env"
267
- if potential_env.exists():
268
- load_dotenv(potential_env)
269
- print(f"DEBUG: Loaded .env from parent: {potential_env}")
270
- break
271
-
272
- # Debug: Check if environment variables are loaded
273
- openai_key = os.getenv('OPENAI_API_KEY')
274
- print(f"DEBUG: OPENAI_API_KEY loaded: {openai_key is not None}")
275
- if openai_key:
276
- print(f"DEBUG: Key length: {len(openai_key)}")
277
- print(f"DEBUG: Key starts with: {openai_key[:10]}...")
278
264
  else:
279
- print("DEBUG: OPENAI_API_KEY is None or empty")
265
+ load_dotenv() # Fallback to default behavior
280
266
 
281
267
  args = parse_arguments()
282
268
  logger = init_logger(args.verbose)
@@ -770,7 +770,7 @@ wheels = [
770
770
 
771
771
  [[package]]
772
772
  name = "mcp-chat"
773
- version = "0.0.4"
773
+ version = "0.0.5"
774
774
  source = { editable = "." }
775
775
  dependencies = [
776
776
  { name = "langchain" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes