Skip to content
Merged
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
19 changes: 19 additions & 0 deletions autorca_core/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@
import sys
import argparse
from pathlib import Path
from datetime import datetime, timedelta

Check failure on line 12 in autorca_core/cli/__main__.py

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Ruff (F401)

autorca_core/cli/__main__.py:12:32: F401 `datetime.timedelta` imported but unused

from autorca_core.reasoning.loop import run_rca, run_rca_from_files, DataSourcesConfig
from autorca_core.outputs.reports import generate_markdown_report, save_report
from autorca_core.logging import configure_logging


def run_mcp_server():
"""Start the MCP server."""
try:
from autorca_core.mcp.server import start_mcp_server
start_mcp_server()
except ImportError:
print("Error: MCP server requires the 'mcp' package.")
print("Install with: pip install 'autorca-core[mcp]'")
sys.exit(1)


def main():
"""Main CLI entry point."""
parser = argparse.ArgumentParser(
Expand All @@ -31,6 +42,12 @@
"quickstart",
help="Run quickstart example with synthetic data",
)

# MCP server command
mcp_parser = subparsers.add_parser(

Check failure on line 47 in autorca_core/cli/__main__.py

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Ruff (F841)

autorca_core/cli/__main__.py:47:5: F841 Local variable `mcp_parser` is assigned to but never used
"mcp-server",
help="Start MCP server for Claude Desktop integration",
)
quickstart_parser.add_argument(
"--log-level",
type=str,
Expand Down Expand Up @@ -127,6 +144,8 @@
run_quickstart()
elif args.command == "run":
run_custom_rca(args)
elif args.command == "mcp-server":
run_mcp_server()
else:
parser.print_help()
sys.exit(1)
Expand Down
11 changes: 11 additions & 0 deletions autorca_core/mcp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
MCP server module for AutoRCA-Core.

Exposes AutoRCA-Core functionality as MCP tools for integration with
Claude Desktop, Claude Code, and other MCP-compatible clients.
"""

from autorca_core.mcp.server import create_mcp_server, start_mcp_server

__all__ = ["create_mcp_server", "start_mcp_server"]

Loading
Loading