mcp-server-sqlseed 0.2.1__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ ENV/
33
33
  .idea/
34
34
  .trae/
35
35
  .claude/
36
+ .gemini/
36
37
  .sonarlint/
37
38
  *.swp
38
39
  *.swo
@@ -62,6 +63,9 @@ examples/notebooks/batch_config.yaml
62
63
  *.nbconvert.ipynb
63
64
  .ipynb_checkpoints/
64
65
 
66
+ # AI-generated config outputs
67
+ *_config.yaml
68
+
65
69
  # OS
66
70
  .DS_Store
67
71
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-server-sqlseed
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: MCP server for sqlseed - AI-powered SQLite test data generation
5
5
  Project-URL: Homepage, https://github.com/sunbos/sqlseed
6
6
  Project-URL: Repository, https://github.com/sunbos/sqlseed/tree/main/plugins/mcp-server-sqlseed
@@ -92,8 +92,7 @@ When `sqlseed-ai` is installed and an API key is configured (`SQLSEED_AI_API_KEY
92
92
  - `mcp >= 1.0`
93
93
 
94
94
  Optional:
95
- - `sqlseed-ai` (for `sqlseed_generate_yaml` tool)
96
- - `google-generativeai` (for Gemma 4 tools: `sqlseed_gemma4_analyze`, `sqlseed_gemma4_agent_fill`)
95
+ - `sqlseed-ai` (for `sqlseed_generate_yaml`, `sqlseed_gemma4_analyze`, `sqlseed_gemma4_agent_fill`, `sqlseed_list_gemma_models` tools)
97
96
 
98
97
  ## License
99
98
 
@@ -70,8 +70,7 @@ When `sqlseed-ai` is installed and an API key is configured (`SQLSEED_AI_API_KEY
70
70
  - `mcp >= 1.0`
71
71
 
72
72
  Optional:
73
- - `sqlseed-ai` (for `sqlseed_generate_yaml` tool)
74
- - `google-generativeai` (for Gemma 4 tools: `sqlseed_gemma4_analyze`, `sqlseed_gemma4_agent_fill`)
73
+ - `sqlseed-ai` (for `sqlseed_generate_yaml`, `sqlseed_gemma4_analyze`, `sqlseed_gemma4_agent_fill`, `sqlseed_list_gemma_models` tools)
75
74
 
76
75
  ## License
77
76
 
@@ -74,8 +74,7 @@ AI 助手会依次调用:
74
74
  - `mcp >= 1.0`
75
75
 
76
76
  可选:
77
- - `sqlseed-ai`(用于 `sqlseed_generate_yaml` 工具)
78
- - `google-generativeai`(用于 Gemma 4 工具:`sqlseed_gemma4_analyze`、`sqlseed_gemma4_agent_fill`)
77
+ - `sqlseed-ai`(用于 `sqlseed_generate_yaml`、`sqlseed_gemma4_analyze`、`sqlseed_gemma4_agent_fill`、`sqlseed_list_gemma_models` 工具)
79
78
 
80
79
  ## 许可证
81
80
 
@@ -29,13 +29,13 @@ def _build_ai_config(
29
29
  db_path: str,
30
30
  model: str | None,
31
31
  backend: str | None,
32
- ) -> tuple[AIConfig, dict[str, Any] | None]:
32
+ ) -> tuple[AIConfig | None, dict[str, Any] | None]:
33
33
  """Build an AIConfig with Gemma 4 defaults, validating db_path and backend.
34
34
 
35
- Returns (config, None) on success, or (config, error_dict) on failure.
35
+ Returns (config, None) on success, or (None, error_dict) on failure.
36
36
  """
37
37
  if not _AI_AVAILABLE:
38
- return AIConfig(), {"error": "sqlseed-ai plugin not installed. Install with: pip install sqlseed-ai"}
38
+ return None, {"error": "sqlseed-ai plugin not installed. Install with: pip install sqlseed-ai"}
39
39
 
40
40
  db_path = _validate_db_path(db_path)
41
41
 
@@ -46,7 +46,9 @@ def _build_ai_config(
46
46
  try:
47
47
  ai_config.backend = AIBackend(backend)
48
48
  except ValueError:
49
- return ai_config, {"error": f"Invalid backend: {backend}. Use: google_ai_studio, ollama, openai_compat"}
49
+ return None, {
50
+ "error": f"Invalid backend: {backend}. Use: google_ai_studio, lm_studio, ollama, openai_compat"
51
+ }
50
52
  ai_config.resolve_model()
51
53
 
52
54
  return ai_config, None
@@ -230,21 +232,22 @@ def sqlseed_gemma4_analyze(
230
232
  table structure and recommend data generation configurations. It demonstrates
231
233
  Gemma 4's Native Function Calling feature for the AI Agent track.
232
234
 
233
- Supported backends: google_ai_studio (default), ollama, openai_compat.
234
- Supported models: gemma-4-26b-it (default), gemma-4-31b-it, gemma-4-4b-it, gemma-4-2b-it.
235
+ Supported backends: google_ai_studio (default), lm_studio, ollama, openai_compat.
236
+ Supported models: gemma-4-26b-a4b-it (default), gemma-4-31b-it, gemma-4-12b-it, gemma-4-e4b-it, gemma-4-e2b-it.
235
237
  """
236
238
  ai_config, err = _build_ai_config(db_path, model, backend)
237
239
  if err is not None:
238
240
  return err
241
+ assert ai_config is not None # guaranteed by err check above
239
242
 
240
243
  with DataOrchestrator(db_path) as orch:
241
244
  _validate_table_name(table_name, orch.get_table_names())
242
245
  schema_ctx = orch.get_schema_context(table_name)
243
246
 
244
247
  analyzer = SchemaAnalyzer(config=ai_config)
245
- result = analyzer.analyze_table_from_ctx(**_serialize_schema_context(schema_ctx))
248
+ result = analyzer.analyze_table_from_ctx(**schema_ctx)
246
249
 
247
- if result is None:
250
+ if not result:
248
251
  return {"error": "Gemma 4 analysis returned no result. Check API key and model availability."}
249
252
 
250
253
  return {
@@ -278,6 +281,7 @@ def sqlseed_gemma4_agent_fill(
278
281
  ai_config, err = _build_ai_config(db_path, model, backend)
279
282
  if err is not None:
280
283
  return err
284
+ assert ai_config is not None # guaranteed by err check above
281
285
 
282
286
  # Step 1: AI analysis with self-correction
283
287
  analyzer = SchemaAnalyzer(config=ai_config)
@@ -325,6 +329,18 @@ def sqlseed_list_gemma_models() -> dict[str, Any]:
325
329
  Returns information about all supported Gemma 4 models,
326
330
  including recommended use cases for each variant.
327
331
  """
332
+ if not _AI_AVAILABLE:
333
+ return {
334
+ "models": [],
335
+ "backends": [
336
+ {"id": "google_ai_studio", "description": "Google AI Studio API (free tier available, recommended)"},
337
+ {"id": "lm_studio", "description": "LM Studio local deployment (http://127.0.0.1:1234, GUI-based)"},
338
+ {"id": "ollama", "description": "Ollama local deployment (offline, CLI-based)"},
339
+ {"id": "openai_compat", "description": "Any OpenAI-compatible API endpoint"},
340
+ ],
341
+ "error": "sqlseed-ai plugin not installed. Install with: pip install sqlseed-ai",
342
+ }
343
+
328
344
  models = []
329
345
  for member in GemmaModel:
330
346
  models.append(
@@ -344,6 +360,6 @@ def sqlseed_list_gemma_models() -> dict[str, Any]:
344
360
  return {
345
361
  "models": models,
346
362
  "backends": backends,
347
- "default_model": "gemma-4-26b-it",
363
+ "default_model": "gemma-4-26b-a4b-it",
348
364
  "default_backend": "google_ai_studio",
349
365
  }