feat: Add Smithery CLI deployment support
- Add smithery package as dependency - Create smithery_server.py with @smithery.server() decorator - Add SmitheryConfigSchema for session config (nextcloud_url, username, app_password) - Add [tool.smithery] section to pyproject.toml - Remove manual .well-known/mcp-config endpoint (Smithery handles this) Smithery CLI will automatically: - Extract config schema from the decorated function - Handle session config parsing from query parameters - Make config accessible via ctx.session_config in tools 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1407,51 +1407,6 @@ def get_app(transport: str = "sse", enabled_apps: list[str] | None = None):
|
||||
routes.append(Route("/health/ready", health_ready, methods=["GET"]))
|
||||
logger.info("Health check endpoints enabled: /health/live, /health/ready")
|
||||
|
||||
# ADR-016: MCP config discovery endpoint for Smithery
|
||||
# Returns the session configuration schema that Smithery uses to render the config UI
|
||||
def mcp_config(request):
|
||||
"""MCP configuration discovery endpoint.
|
||||
|
||||
Returns the JSON schema for session configuration parameters.
|
||||
Used by Smithery to render the configuration form for users.
|
||||
"""
|
||||
return JSONResponse(
|
||||
{
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"required": ["nextcloud_url", "username", "app_password"],
|
||||
"properties": {
|
||||
"nextcloud_url": {
|
||||
"type": "string",
|
||||
"title": "Nextcloud URL",
|
||||
"description": "Your Nextcloud instance URL (e.g., https://cloud.example.com). Must be publicly accessible.",
|
||||
"pattern": "^https?://.+",
|
||||
},
|
||||
"username": {
|
||||
"type": "string",
|
||||
"title": "Username",
|
||||
"description": "Your Nextcloud username",
|
||||
"minLength": 1,
|
||||
},
|
||||
"app_password": {
|
||||
"type": "string",
|
||||
"title": "App Password",
|
||||
"description": "Nextcloud app password. Generate at Settings > Security > App passwords. Do NOT use your main password.",
|
||||
"minLength": 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
"exampleConfig": {
|
||||
"nextcloud_url": "https://cloud.example.com",
|
||||
"username": "alice",
|
||||
"app_password": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
routes.append(Route("/.well-known/mcp-config", mcp_config, methods=["GET"]))
|
||||
logger.info("MCP config discovery endpoint enabled: /.well-known/mcp-config")
|
||||
|
||||
# Add test webhook endpoint (for development/testing)
|
||||
routes.append(
|
||||
Route("/webhooks/nextcloud", handle_nextcloud_webhook, methods=["POST"])
|
||||
|
||||
Reference in New Issue
Block a user