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: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies = [
]

[project.scripts]
sgraph-mcp-server = "src.server_modular:main"
sgraph-mcp-server = "src.server:main"

[build-system]
requires = ["setuptools", "wheel"]
Expand Down
43 changes: 24 additions & 19 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,39 @@
# Set up logging
setup_logging()

# Create MCP server
mcp = FastMCP("SGraph")
mcp.settings.port = 8008

# Initialize the components
print("🔧 Initializing modular components...")

# Import tool modules and register them with the MCP server
from src.tools import model_tools, search_tools, analysis_tools, navigation_tools

# Register all tools with the MCP server
model_tools.register_tools(mcp)
search_tools.register_tools(mcp)
analysis_tools.register_tools(mcp)
navigation_tools.register_tools(mcp)

print("✅ All tool modules loaded successfully")
def create_server():
"""Create and configure the MCP server with all tools registered."""
print("🔧 Initializing modular components...")

# Create MCP server
mcp = FastMCP("SGraph")
mcp.settings.port = 8008

# Import tool modules and register them with the MCP server
from src.tools import model_tools, search_tools, analysis_tools, navigation_tools

# Register all tools with the MCP server
model_tools.register_tools(mcp)
search_tools.register_tools(mcp)
analysis_tools.register_tools(mcp)
navigation_tools.register_tools(mcp)

print("✅ All tool modules loaded successfully")
return mcp


def main():
"""Main entry point for the MCP server."""
print("🚀 Starting modular MCP server...")

# Create server with all tools registered
mcp = create_server()

print(f"📊 Server will run on http://0.0.0.0:8008")
print(f"🛠️ Modular server initialized with all tools registered")

# Add initialization delay before starting
time.sleep(1.0)

# Start the server - all initialization is complete at this point
mcp.run(transport="sse")


Expand Down
2 changes: 1 addition & 1 deletion tools/debugging/mcp_connection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ async def run_connection_diagnostics(server_url: str = "http://localhost:8008/ss
print("\n🔧 TROUBLESHOOTING SUGGESTIONS:")

if not diagnostics["server_port"]["status"]:
print("• Start the server: uv run src/server_modular.py")
print("• Start the server: uv run python -m src.server")

if not diagnostics["nodejs_version"]["status"]:
print("• Install Node.js v20+: https://nodejs.org/")
Expand Down