style: Fix imports and line length formatting

This commit is contained in:
David Soria Parra
2024-12-19 22:33:40 +00:00
parent 7bbf71e29a
commit a79f51f55f
37 changed files with 242 additions and 135 deletions

View File

@@ -2,6 +2,5 @@
from .cli import app
if __name__ == "__main__":
app()

View File

@@ -48,8 +48,8 @@ def update_claude_config(
config_dir = get_claude_config_path()
if not config_dir:
raise RuntimeError(
"Claude Desktop config directory not found. Please ensure Claude Desktop "
"is installed and has been run at least once to initialize its configuration."
"Claude Desktop config directory not found. Please ensure Claude Desktop"
" is installed and has been run at least once to initialize its config."
)
config_file = config_dir / "claude_desktop_config.json"

View File

@@ -295,7 +295,8 @@ def run(
"""Run a MCP server.
The server can be specified in two ways:
1. Module approach: server.py - runs the module directly, expecting a server.run() call
1. Module approach: server.py - runs the module directly, expecting a server.run()
call
2. Import approach: server.py:app - imports and runs the specified server object
Note: This command runs the server directly. You are responsible for ensuring
@@ -346,7 +347,8 @@ def install(
typer.Option(
"--name",
"-n",
help="Custom name for the server (defaults to server's name attribute or file name)",
help="Custom name for the server (defaults to server's name attribute or"
" file name)",
),
] = None,
with_editable: Annotated[
@@ -410,7 +412,8 @@ def install(
logger.error("Claude app not found")
sys.exit(1)
# Try to import server to get its name, but fall back to file name if dependencies missing
# Try to import server to get its name, but fall back to file name if dependencies
# missing
name = server_name
server = None
if not name:
@@ -419,7 +422,8 @@ def install(
name = server.name
except (ImportError, ModuleNotFoundError) as e:
logger.debug(
"Could not import server (likely missing dependencies), using file name",
"Could not import server (likely missing dependencies), using file"
" name",
extra={"error": str(e)},
)
name = file.stem