standardgraph 1.2.2__tar.gz → 1.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: standardgraph
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: 158,000+ education standards (math, science, ELA, social studies, CS, arts) across 300 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server
5
5
  Author: StandardGraph
6
6
  License-Expression: MIT
@@ -22,7 +22,9 @@ Requires-Dist: numpy>=1.26.0
22
22
 
23
23
  # standardgraph
24
24
 
25
- **157,000+ education standards across 298 curriculum systems, accessible as a Claude MCP server.**
25
+ <!-- mcp-name: io.github.swoopeagle/standardgraph -->
26
+
27
+ **158,000+ education standards across 300 curriculum systems, accessible as a Claude MCP server.**
26
28
 
27
29
  Covers seven subjects — Mathematics, Science, ELA, Social Studies, Computer Science, Arts, and World Languages — across the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, AP, and more. Standards are cross-referenced to subject hubs (CCSS for math, NGSS for science, etc.) via semantic similarity, with LLM quality scores on the strongest mappings.
28
30
 
@@ -1,6 +1,8 @@
1
1
  # standardgraph
2
2
 
3
- **157,000+ education standards across 298 curriculum systems, accessible as a Claude MCP server.**
3
+ <!-- mcp-name: io.github.swoopeagle/standardgraph -->
4
+
5
+ **158,000+ education standards across 300 curriculum systems, accessible as a Claude MCP server.**
4
6
 
5
7
  Covers seven subjects — Mathematics, Science, ELA, Social Studies, Computer Science, Arts, and World Languages — across the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, AP, and more. Standards are cross-referenced to subject hubs (CCSS for math, NGSS for science, etc.) via semantic similarity, with LLM quality scores on the strongest mappings.
6
8
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "standardgraph"
3
- version = "1.2.2"
3
+ version = "1.2.4"
4
4
  description = "158,000+ education standards (math, science, ELA, social studies, CS, arts) across 300 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -28,6 +28,7 @@ Repository = "https://github.com/swoopeagle/standardgraph"
28
28
 
29
29
  [project.scripts]
30
30
  standardgraph = "common_core.server:main"
31
+ standardgraph-serve = "common_core.server:serve_http"
31
32
 
32
33
  [build-system]
33
34
  requires = ["setuptools>=61"]
@@ -215,6 +215,17 @@ def _grade_key(g: str) -> int:
215
215
  return 99
216
216
 
217
217
 
218
+ # A single-letter CCSS cluster segment sitting directly before the final numeric
219
+ # ordinal (e.g. the 'A' in '6.RP.A.3'). The DB is inconsistent about retaining it
220
+ # — most IDs keep it ('5.NF.A.2') but some dropped it on ingest ('6.RP.3') — so
221
+ # lookups normalise it away to match either form.
222
+ _CLUSTER_LETTER = re.compile(r"\.[A-Z](?=\.\d)")
223
+
224
+
225
+ def _loose_id(sid: str) -> str:
226
+ return _CLUSTER_LETTER.sub("", sid)
227
+
228
+
218
229
  # ── Embedding ─────────────────────────────────────────────────────────────────
219
230
 
220
231
  def _embed_query(text: str) -> np.ndarray:
@@ -375,6 +386,18 @@ def lookup_standard(
375
386
  conn = _db()
376
387
 
377
388
  row = conn.execute("SELECT * FROM standards WHERE id = ?", (sid,)).fetchone()
389
+ if not row:
390
+ # Tolerate cluster-letter drift: match ignoring the single-letter cluster
391
+ # segment, so '6.RP.A.3' finds a stored '6.RP.3' (and vice versa).
392
+ target = _loose_id(sid)
393
+ match_id = next(
394
+ (cid for (cid,) in conn.execute(
395
+ "SELECT id FROM standards WHERE system=?", (system,))
396
+ if _loose_id(cid) == target),
397
+ None,
398
+ )
399
+ if match_id:
400
+ row = conn.execute("SELECT * FROM standards WHERE id = ?", (match_id,)).fetchone()
378
401
  if not row:
379
402
  # Suggest nearby IDs
380
403
  suggestions = [
@@ -943,5 +966,27 @@ def main() -> None:
943
966
  mcp.run()
944
967
 
945
968
 
969
+ def serve_http() -> None:
970
+ """Run the server over streamable-HTTP for remote/hosted deployments.
971
+
972
+ Reads SG_HTTP_HOST / SG_HTTP_PORT (defaults 0.0.0.0:8010). Intended to sit
973
+ behind a TLS-terminating tunnel (Cloudflare Tunnel / Tailscale Funnel), so
974
+ Host/Origin are wildcarded to let the proxied hostname through FastMCP's
975
+ DNS-rebinding guard. Only expose read-only, non-secret data this way.
976
+ """
977
+ import os
978
+
979
+ host = os.getenv("SG_HTTP_HOST", "0.0.0.0")
980
+ port = int(os.getenv("SG_HTTP_PORT", "8010"))
981
+ print(f"StandardGraph HTTP MCP → http://{host}:{port}/mcp (DB={DB_PATH})")
982
+ mcp.run(
983
+ transport="http",
984
+ host=host,
985
+ port=port,
986
+ allowed_hosts=["*"],
987
+ allowed_origins=["*"],
988
+ )
989
+
990
+
946
991
  if __name__ == "__main__":
947
992
  main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: standardgraph
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: 158,000+ education standards (math, science, ELA, social studies, CS, arts) across 300 curriculum systems, cross-referenced via NLP — accessible as a Claude MCP server
5
5
  Author: StandardGraph
6
6
  License-Expression: MIT
@@ -22,7 +22,9 @@ Requires-Dist: numpy>=1.26.0
22
22
 
23
23
  # standardgraph
24
24
 
25
- **157,000+ education standards across 298 curriculum systems, accessible as a Claude MCP server.**
25
+ <!-- mcp-name: io.github.swoopeagle/standardgraph -->
26
+
27
+ **158,000+ education standards across 300 curriculum systems, accessible as a Claude MCP server.**
26
28
 
27
29
  Covers seven subjects — Mathematics, Science, ELA, Social Studies, Computer Science, Arts, and World Languages — across the US (CCSS + all 50 states), Canada, Australia, UK, Singapore, Japan, New Zealand, Ireland, Hong Kong, India, Ghana, South Africa, Rwanda, Cambridge International, IB MYP/DP, AP, and more. Standards are cross-referenced to subject hubs (CCSS for math, NGSS for science, etc.) via semantic similarity, with LLM quality scores on the strongest mappings.
28
30
 
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  standardgraph = common_core.server:main
3
+ standardgraph-serve = common_core.server:serve_http
File without changes