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:
Chris Coutinho
2025-11-22 18:05:33 +01:00
co-authored by Claude
parent 8d29ce0122
commit b8dc413b73
4 changed files with 123 additions and 45 deletions
-45
View File
@@ -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"])