From 94527c034440bab785abf188f002b0b31a4b6168 Mon Sep 17 00:00:00 2001 From: Vikrant-Khedkar Date: Tue, 11 Nov 2025 12:39:48 +0530 Subject: [PATCH 1/2] make api key requried --- smithery.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/smithery.yaml b/smithery.yaml index 246e74f..4acf7aa 100644 --- a/smithery.yaml +++ b/smithery.yaml @@ -1,2 +1,13 @@ # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml + + +configSchema: + # JSON Schema defining the configuration options for the MCP. + type: "object" + required: ["scrapegraphApiKey"] + properties: + scrapegraphApiKey: + type: "string" + description: "Your Scrapegraph API key" + runtime: "python" \ No newline at end of file From 4579347d9d9eaf8287a40435c5b69c47a4bf2604 Mon Sep 17 00:00:00 2001 From: Vikrant-Khedkar Date: Tue, 11 Nov 2025 19:04:21 +0530 Subject: [PATCH 2/2] refactor: Enhance ConfigSchema to support aliasing for Scrapegraph API key --- src/scrapegraph_mcp/server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/scrapegraph_mcp/server.py b/src/scrapegraph_mcp/server.py index 9d7d91f..4c74d38 100644 --- a/src/scrapegraph_mcp/server.py +++ b/src/scrapegraph_mcp/server.py @@ -17,7 +17,7 @@ import httpx from fastmcp import Context, FastMCP from smithery.decorators import smithery -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, AliasChoices # Configure logging logging.basicConfig( @@ -342,7 +342,11 @@ def close(self) -> None: class ConfigSchema(BaseModel): scrapegraph_api_key: Optional[str] = Field( default=None, - description="Your Scrapegraph API key (optional - can also be set via SGAI_API_KEY environment variable)" + description="Your Scrapegraph API key (optional - can also be set via SGAI_API_KEY environment variable)", + # Accept both camelCase (from smithery.yaml) and snake_case (internal) for validation, + # and serialize back to camelCase to match Smithery expectations. + validation_alias=AliasChoices("scrapegraphApiKey", "scrapegraph_api_key"), + serialization_alias="scrapegraphApiKey", )