Railway mcp deploy#1328
Open
itsablabla wants to merge 12 commits into
Open
Conversation
- Add AgentTool wrapper (app/mcp/agent_tool.py): stateless agent-per-call
pattern exposing Manus, DataAnalysis, SWEAgent, BrowserAgent as MCP tools
- Upgrade MCP server (app/mcp/server.py):
* SSE transport mode with uvicorn
* Bearer token auth middleware (MCP_SERVER_AUTH_TOKEN env var)
* /health endpoint for Railway health checks
* PORT env var binding for Railway compatibility
* Registers both high-level agent tools and low-level primitives
- Patch config.py: ${VAR_NAME} env var substitution in TOML config
- Add config/config.toml: production config with env var placeholders
- Update Dockerfile: Playwright chromium install, production CMD
- Add railway.json: infrastructure-as-code for Railway deployment
- Update run_mcp_server.py: accept --transport sse argument
… crash without Daytona
…esponds immediately Railway healthcheck fires within seconds of container start. Heavy imports (LLM config, Playwright, agent modules) were blocking the HTTP server from binding. Now uvicorn starts first, /health responds instantly, and tools are loaded asynchronously after the server is up.
structlog is imported by app/utils/logger.py but was not in requirements.txt, causing ModuleNotFoundError on container startup and healthcheck failure.
…g deps daytona SDK is not on PyPI and is only needed for SandboxManus/BrowserAgent sandbox tools. Use try/except per-agent so the server starts successfully even when optional dependencies are missing. Each agent logs a warning if it cannot be loaded rather than crashing the entire server.
…support Changes: - daytona_stub/: New stub package that satisfies all 'from daytona import ...' statements without requiring the real (private) Daytona SDK. Sandbox operations raise NotImplementedError at runtime if called without a real key. - Dockerfile: Install daytona stub after requirements.txt so all 4 agents (Manus, DataAnalysis, SWEAgent, BrowserAgent) can be imported at startup. - data_visualization.py: Fix f-string backslash syntax (lines 142, 190) for Python 3.11 compatibility. Was valid in 3.12 only; now works on both. Result: All 7 MCP tools will be available: run_manus, run_data_analysis, run_swe, run_browser, bash, str_replace_editor, terminate.
Pydantic's to_param() calls self.parameters but @Property returns the descriptor object instead of calling it, causing: AttributeError: 'property' object has no attribute 'get' Fix: Define parameters as a plain Pydantic dict field initialized in __init__() so BaseTool.to_param() correctly serializes it. Verified locally: to_param() now returns {'type': 'object', ...} dict.
- Move all stdlib imports to top block (before basicConfig call) so isort does not flag a split import section - Add missing blank lines before class/function definitions at module level - Reformat health_check return dict to black style - Remove duplicate `import importlib` from _load_tools (was inlined twice) - Standardise comment dashes to ASCII (removes unicode em-dash)
…re-commit) - autoflake: remove unused `Optional` from typing imports - black: add missing blank line before AgentTool class definition - isort: ensure 2 blank lines after import block - Replace unicode em-dash in comment with ASCII hyphen
Author
CI Fix: Pre-commit Formatting CorrectionsDiagnosis: The PR's Root causes found in
Fix applied (2 commits to
No functional changes were made — all modifications are formatting-only. The Railway deployment logic, SSE/HTTP transport, Bearer auth middleware, deferred tool loading, and The pre-commit hooks should now pass, clearing the unstable CI status. Automated review by GitHub PR Monitor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features
Feature Docs
Influence
Result
Other