spice-mcp 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

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.

Potentially problematic release.


This version of spice-mcp might be problematic. Click here for more details.

@@ -9,4 +9,11 @@ def resolve_raw_sql_template_id() -> int:
9
9
  Tests stub HTTP boundaries and only require a consistent integer. This
10
10
  placeholder can be adjusted if upstream semantics change.
11
11
  """
12
- return int(os.getenv("SPICE_RAW_SQL_QUERY_ID", "4060379"))
12
+ env_value = os.getenv("SPICE_RAW_SQL_QUERY_ID")
13
+ if env_value:
14
+ try:
15
+ return int(env_value.strip())
16
+ except (ValueError, AttributeError):
17
+ # Invalid environment variable, fallback to default
18
+ pass
19
+ return 4060379
spice_mcp/mcp/server.py CHANGED
@@ -229,26 +229,7 @@ async def dune_query(
229
229
  _ensure_initialized()
230
230
  assert EXECUTE_QUERY_TOOL is not None
231
231
  try:
232
- # Limit concurrent executions to preserve API quota
233
- if 'asyncio' not in globals():
234
- pass # type: ignore
235
- if SEMAPHORE is not None:
236
- async with SEMAPHORE: # type: ignore
237
- return await EXECUTE_QUERY_TOOL.execute(
238
- query=query,
239
- parameters=parameters,
240
- refresh=refresh,
241
- max_age=max_age,
242
- limit=limit,
243
- offset=offset,
244
- sample_count=sample_count,
245
- sort_by=sort_by,
246
- columns=columns,
247
- format=format,
248
- extras=extras,
249
- timeout_seconds=timeout_seconds,
250
- )
251
- # Fallback without semaphore
232
+ # Execute query directly without semaphore concurrency control
252
233
  return await EXECUTE_QUERY_TOOL.execute(
253
234
  query=query,
254
235
  parameters=parameters,
@@ -313,6 +313,15 @@ class ExecuteQueryTool(MCPTool):
313
313
  if template_id_value is not None:
314
314
  extra_fields["template_query_id"] = template_id_value
315
315
 
316
+ # Compute query SHA256 for better debugging
317
+ q_sha = None
318
+ try:
319
+ q_sha = self._persist_query_sql(q_use, q_type)
320
+ if q_sha:
321
+ extra_fields["query_sha256"] = q_sha
322
+ except Exception:
323
+ pass
324
+
316
325
  self.query_history.record(
317
326
  execution_id="unknown",
318
327
  query_type=_categorize_query(query),
@@ -324,9 +333,22 @@ class ExecuteQueryTool(MCPTool):
324
333
  )
325
334
 
326
335
  enriched = self._enrich_error(exc)
327
- context = {"tool": "dune_query", "query": q_use}
336
+ context = {"tool": "dune_query", "query": q_use, "query_type": _categorize_query(q_use)}
328
337
  if enriched:
329
338
  context.update(enriched)
339
+
340
+ # Add debugging information for raw SQL failures
341
+ if q_type == "raw_sql" and "could not determine execution" in str(exc):
342
+ context.update({
343
+ "debug_info": "Raw SQL execution failed - this may be related to FastMCP async/concurrency handling",
344
+ "template_query_id": template_id_value,
345
+ "environment_vars": {
346
+ "SPICE_RAW_SQL_QUERY_ID": os.getenv("SPICE_RAW_SQL_QUERY_ID"),
347
+ "DUNE_API_KEY_present": bool(os.getenv("DUNE_API_KEY"))
348
+ },
349
+ "suggested_action": "Retry or check if the template query (4060379) is accessible"
350
+ })
351
+
330
352
  return error_response(exc, context=context)
331
353
 
332
354
  def _persist_query_sql(self, query: str, q_type: str) -> str | None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spice-mcp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: MCP server for Dune Analytics data access
5
5
  Author-email: Evan-Kim2028 <ekcopersonal@gmail.com>
6
6
  License-File: LICENSE
@@ -12,7 +12,7 @@ spice_mcp/adapters/dune/extract.py,sha256=frIFRUNJ99UlP26N9F-p1psX-e_TVq9vJTQxh0
12
12
  spice_mcp/adapters/dune/helpers.py,sha256=BgDKr_g-UqmU2hoMb0ejQZHta_NbKwR1eDJp33sJYNk,227
13
13
  spice_mcp/adapters/dune/transport.py,sha256=eRP-jPY2ZXxvTX9HSjIFqFUlbIzXspgH95jBFoTlpaQ,1436
14
14
  spice_mcp/adapters/dune/types.py,sha256=57TMX07u-Gq4BYwRAuZV0xI81nVXgtpp7KBID9YbKyQ,1195
15
- spice_mcp/adapters/dune/typing_utils.py,sha256=QSgPSsRZ88GEUdr55OwbYb9wVlT8bkS0iBDWlzzO5g0,367
15
+ spice_mcp/adapters/dune/typing_utils.py,sha256=EpWneGDn-eQdo6lkLuESR09KXkDj9OqGz8bEF3JaFkM,574
16
16
  spice_mcp/adapters/dune/urls.py,sha256=bcuPERkFQduRTT2BrgzVhoFrMn-Lkvw9NmktcBZYEig,3902
17
17
  spice_mcp/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  spice_mcp/core/errors.py,sha256=jlfTuyRaAaA_oU07KUk-1pDAAa43KG0BbZc5CINXtoE,3256
@@ -20,10 +20,10 @@ spice_mcp/core/models.py,sha256=2AgAPcaDPEXLdka1E6-0cXN_QNsN2rnDoBnDTDDsO6I,2121
20
20
  spice_mcp/core/ports.py,sha256=-wtWjpYSjL-qugUtsm0MTngtJZWzr7QNDbAUCj4BTS0,2028
21
21
  spice_mcp/logging/query_history.py,sha256=doE9lod64uzJxlA2XzHH2-VAmC6WstYAkQ0taEAxiIM,4315
22
22
  spice_mcp/mcp/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
23
- spice_mcp/mcp/server.py,sha256=km_gWerdoGTdbhHO2wp28AX28OJTwj3-tJA5EMoeFe4,18801
23
+ spice_mcp/mcp/server.py,sha256=RtvK0u9Q3dp3JMALrVFL43Li1lKdaQwLvtZuoo0pkbY,18082
24
24
  spice_mcp/mcp/tools/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
25
25
  spice_mcp/mcp/tools/base.py,sha256=Xw8k5WAXotCdZRd-cVJIFPH87JH8DH0sh1zKu-KmW3w,1047
26
- spice_mcp/mcp/tools/execute_query.py,sha256=VFy7x3-l1KbW5f02hByMDrejZE8eU_fn60d_fdUOgSc,16480
26
+ spice_mcp/mcp/tools/execute_query.py,sha256=y2HU3Cv6T7QBXBDMea0TlXcf8_ERkq2sJeaexR6kBXE,17556
27
27
  spice_mcp/mcp/tools/sui_package_overview.py,sha256=a1CcpfBzEFzScjXgxLu9urxdtSbXjF98ugWPOX167rc,1736
28
28
  spice_mcp/observability/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  spice_mcp/observability/logging.py,sha256=ceJUEpKGpf5PAgPBmpB49zjqhdGCAESfLemFUhDSmI8,529
@@ -32,8 +32,8 @@ spice_mcp/service_layer/discovery_service.py,sha256=202O0SzCZGQukd9kb2JYfarLygZH
32
32
  spice_mcp/service_layer/query_admin_service.py,sha256=4q1NAAuTui7cm83Aq2rFDLIzKTHX17yzbSoSJyCmLbI,1356
33
33
  spice_mcp/service_layer/query_service.py,sha256=q0eAVW5I3sUxm29DgzPN_cH3rZEzmKwmdE3Xj4qP9lI,3878
34
34
  spice_mcp/service_layer/sui_service.py,sha256=G-LOsl-z-ldMxAYAetnG17IQlpVtLchGUjN6opU-PF0,4712
35
- spice_mcp-0.1.1.dist-info/METADATA,sha256=WghxqMf1wdHX3M_GgfPiP-ZRMg9apFZSVetiOzuL1qQ,9316
36
- spice_mcp-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
- spice_mcp-0.1.1.dist-info/entry_points.txt,sha256=4XiXX13Vy-oiUJwlcO_82OltBaxFnEnkJ-76sZGm5os,56
38
- spice_mcp-0.1.1.dist-info/licenses/LICENSE,sha256=r0GNDnDY1RSkVQp7kEEf6MQU21OrNGJkxUHIsv6eyLk,1079
39
- spice_mcp-0.1.1.dist-info/RECORD,,
35
+ spice_mcp-0.1.2.dist-info/METADATA,sha256=TB63rlJQOinwNKj3XvevK0OLLF2Ic0xYmeLU_kaiuas,9316
36
+ spice_mcp-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
+ spice_mcp-0.1.2.dist-info/entry_points.txt,sha256=4XiXX13Vy-oiUJwlcO_82OltBaxFnEnkJ-76sZGm5os,56
38
+ spice_mcp-0.1.2.dist-info/licenses/LICENSE,sha256=r0GNDnDY1RSkVQp7kEEf6MQU21OrNGJkxUHIsv6eyLk,1079
39
+ spice_mcp-0.1.2.dist-info/RECORD,,