chore: remove trailing spaces and ensure newline
This commit is contained in:
@@ -17,10 +17,10 @@ def get_python_path():
|
||||
"""Get the path to the Python executable in the virtual environment."""
|
||||
project_root = get_project_root()
|
||||
venv_python = os.path.join(project_root, "venv", "bin", "python")
|
||||
|
||||
|
||||
if os.path.exists(venv_python):
|
||||
return venv_python
|
||||
|
||||
|
||||
# Fallback to system Python
|
||||
return sys.executable
|
||||
|
||||
@@ -30,7 +30,7 @@ def generate_config():
|
||||
python_path = get_python_path()
|
||||
# Use absolute path to the MCP CLI script to avoid double-slash issues
|
||||
script_path = os.path.join(project_root, "mcp_server_cli.py")
|
||||
|
||||
|
||||
# Load .env file from project root to get BASECAMP_ACCOUNT_ID
|
||||
dotenv_path = os.path.join(project_root, ".env")
|
||||
load_dotenv(dotenv_path)
|
||||
@@ -56,13 +56,13 @@ def generate_config():
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return config
|
||||
|
||||
def get_cursor_config_path():
|
||||
"""Get the path to the Cursor MCP configuration file."""
|
||||
home = Path.home()
|
||||
|
||||
|
||||
if sys.platform == "darwin": # macOS
|
||||
return home / ".cursor" / "mcp.json"
|
||||
elif sys.platform == "win32": # Windows
|
||||
@@ -74,59 +74,59 @@ def main():
|
||||
"""Main function."""
|
||||
config = generate_config()
|
||||
config_path = get_cursor_config_path()
|
||||
|
||||
|
||||
print("🔧 Generated Cursor MCP Configuration:")
|
||||
print(json.dumps(config, indent=2))
|
||||
print()
|
||||
|
||||
|
||||
print(f"📁 Configuration should be saved to: {config_path}")
|
||||
print()
|
||||
|
||||
|
||||
# Check if the file exists and offer to update it
|
||||
if config_path.exists():
|
||||
print("⚠️ Configuration file already exists.")
|
||||
response = input("Do you want to update it? (y/N): ").lower().strip()
|
||||
|
||||
|
||||
if response in ['y', 'yes']:
|
||||
# Read existing config
|
||||
try:
|
||||
with open(config_path, 'r') as f:
|
||||
existing_config = json.load(f)
|
||||
|
||||
|
||||
# Update the basecamp server configuration
|
||||
if "mcpServers" not in existing_config:
|
||||
existing_config["mcpServers"] = {}
|
||||
|
||||
|
||||
existing_config["mcpServers"]["basecamp"] = config["mcpServers"]["basecamp"]
|
||||
|
||||
|
||||
# Write back the updated config
|
||||
config_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(config_path, 'w') as f:
|
||||
json.dump(existing_config, f, indent=2)
|
||||
|
||||
|
||||
print("✅ Configuration updated successfully!")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error updating configuration: {e}")
|
||||
|
||||
|
||||
else:
|
||||
print("Configuration not updated.")
|
||||
else:
|
||||
response = input("Do you want to create the configuration file? (y/N): ").lower().strip()
|
||||
|
||||
|
||||
if response in ['y', 'yes']:
|
||||
try:
|
||||
config_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(config_path, 'w') as f:
|
||||
json.dump(config, f, indent=2)
|
||||
|
||||
|
||||
print("✅ Configuration file created successfully!")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error creating configuration file: {e}")
|
||||
else:
|
||||
print("Configuration file not created.")
|
||||
|
||||
|
||||
print()
|
||||
print("📋 Next steps:")
|
||||
print("1. Make sure you've authenticated with Basecamp: python oauth_app.py")
|
||||
@@ -134,4 +134,4 @@ def main():
|
||||
print("3. Check Cursor Settings → MCP for a green checkmark next to 'basecamp'")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user