clarity-api 3.3.2__tar.gz → 3.3.5__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.
Files changed (76) hide show
  1. {clarity_api-3.3.2/clarity_api.egg-info → clarity_api-3.3.5}/PKG-INFO +3 -9
  2. {clarity_api-3.3.2 → clarity_api-3.3.5}/README.md +0 -2
  3. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/__init__.py +18 -1
  4. clarity_api-3.3.5/clarity_api/__main__.py +4 -0
  5. clarity_api-3.3.5/clarity_api/connector_sources.py +86 -0
  6. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/kg_ingest.py +4 -80
  7. clarity_api-3.3.5/clarity_api/mcp_server.py +22 -0
  8. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/certification.json +7 -10
  9. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/clarity.ttl +1 -2
  10. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/mappings/source.yaml +1 -1
  11. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/prompts/analytics_specialist.json +0 -2
  12. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/version.py +0 -1
  13. {clarity_api-3.3.2 → clarity_api-3.3.5/clarity_api.egg-info}/PKG-INFO +3 -9
  14. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api.egg-info/SOURCES.txt +2 -12
  15. clarity_api-3.3.5/clarity_api.egg-info/entry_points.txt +8 -0
  16. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api.egg-info/requires.txt +1 -7
  17. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api.egg-info/top_level.txt +0 -1
  18. {clarity_api-3.3.2 → clarity_api-3.3.5}/pyproject.toml +14 -17
  19. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/test_fleet_name.py +3 -14
  20. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/test_kg_ingest.py +4 -5
  21. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_init_dynamics.py +0 -7
  22. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_mcp_registration.py +2 -2
  23. clarity_api-3.3.2/MANIFEST.in +0 -5
  24. clarity_api-3.3.2/clarity_api/__main__.py +0 -4
  25. clarity_api-3.3.2/clarity_api/connectors/mcp_source_presets.json +0 -16
  26. clarity_api-3.3.2/clarity_api/connectors/tool_schema_fingerprints.json +0 -8
  27. clarity_api-3.3.2/clarity_api/mcp_server.py +0 -92
  28. clarity_api-3.3.2/clarity_api.egg-info/entry_points.txt +0 -17
  29. clarity_api-3.3.2/requirements.txt +0 -1
  30. clarity_api-3.3.2/scripts/security_sanitizer.py +0 -318
  31. clarity_api-3.3.2/scripts/verify_api_integration.py +0 -238
  32. clarity_api-3.3.2/tests/__init__.py +0 -0
  33. clarity_api-3.3.2/tests/integration/__init__.py +0 -0
  34. clarity_api-3.3.2/tests/test_default_content_surfaces.py +0 -43
  35. clarity_api-3.3.2/tests/unit/__init__.py +0 -0
  36. clarity_api-3.3.2/tests/unit/test_startup.py +0 -21
  37. {clarity_api-3.3.2 → clarity_api-3.3.5}/LICENSE +0 -0
  38. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/api/__init__.py +0 -0
  39. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/api/api_client_base.py +0 -0
  40. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/api/api_client_insights.py +0 -0
  41. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/api_client.py +0 -0
  42. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/auth.py +0 -0
  43. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/clarity_api.py +0 -0
  44. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/clarity_models.py +0 -0
  45. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/decorators.py +0 -0
  46. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/exceptions.py +0 -0
  47. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/mcp/__init__.py +0 -0
  48. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/mcp/mcp_insights.py +0 -0
  49. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/mcp_config.json +0 -0
  50. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/models.py +0 -0
  51. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/__init__.py +0 -0
  52. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/fixtures/records.json +0 -0
  53. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/migrations/manifest.json +0 -0
  54. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/ontology/shapes/connector.shacl.ttl +0 -0
  55. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/services/__init__.py +0 -0
  56. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/services/insights_service.py +0 -0
  57. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-analytics-ingestion/SKILL.md +0 -0
  58. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-analytics-ingestion/WORKFLOW.md +0 -0
  59. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-api-operations/SKILL.md +0 -0
  60. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-api-operations/agents/openai.yaml +0 -0
  61. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-api-operations/references/catalog.md +0 -0
  62. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-behavioral-insights/SKILL.md +0 -0
  63. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api/skills/clarity-behavioral-insights/WORKFLOW.md +0 -0
  64. {clarity_api-3.3.2 → clarity_api-3.3.5}/clarity_api.egg-info/dependency_links.txt +0 -0
  65. {clarity_api-3.3.2 → clarity_api-3.3.5}/setup.cfg +0 -0
  66. {clarity_api-3.3.2/clarity_api/connectors → clarity_api-3.3.5/tests}/__init__.py +0 -0
  67. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/conftest.py +0 -0
  68. {clarity_api-3.3.2/clarity_api/prompts → clarity_api-3.3.5/tests/integration}/__init__.py +0 -0
  69. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/integration/test_data_export_integration.py +0 -0
  70. {clarity_api-3.3.2/clarity_api/skills → clarity_api-3.3.5/tests/unit}/__init__.py +0 -0
  71. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_api_client.py +0 -0
  72. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_auth.py +0 -0
  73. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_clarity_api.py +0 -0
  74. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_clarity_models.py +0 -0
  75. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_errors.py +0 -0
  76. {clarity_api-3.3.2 → clarity_api-3.3.5}/tests/unit/test_insights_service.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clarity-api
3
- Version: 3.3.2
3
+ Version: 3.3.5
4
4
  Summary: Microsoft Clarity API + MCP Server + A2A Server
5
- Author-email: Project Maintainers <maintainers@users.noreply.github.com>
5
+ Author-email: Repository Maintainers <maintainers@knuckles.team>
6
6
  License: MIT
7
7
  Classifier: Development Status :: 5 - Production/Stable
8
8
  Classifier: License :: Public Domain
@@ -12,15 +12,11 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: <3.15,>=3.12
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18
15
+ Requires-Dist: agent-connector-sdk[mcp]<0.6.0,>=0.5.4
16
16
  Requires-Dist: requests>=2.34.2
17
17
  Requires-Dist: python-dotenv>=1.2.4
18
18
  Requires-Dist: pydantic[email]>=2.14.1
19
19
  Requires-Dist: urllib3>=2.8.0
20
- Provides-Extra: mcp
21
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18; extra == "mcp"
22
- Provides-Extra: all
23
- Requires-Dist: clarity-api[mcp]>=2.0.1; extra == "all"
24
20
  Provides-Extra: test
25
21
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
26
22
  Requires-Dist: pytest>=9.1.1; extra == "test"
@@ -47,8 +43,6 @@ Dynamic: license-file
47
43
  ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/clarity-api)
48
44
  ![PyPI - Wheel](https://img.shields.io/pypi/wheel/clarity-api)
49
45
 
50
- *Version: 3.3.2*
51
-
52
46
  **Microsoft Clarity API + MCP Server + A2A Agent**
53
47
 
54
48
  `clarity-api` is a typed, action-routed connector for the
@@ -17,8 +17,6 @@
17
17
  ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/clarity-api)
18
18
  ![PyPI - Wheel](https://img.shields.io/pypi/wheel/clarity-api)
19
19
 
20
- *Version: 3.3.2*
21
-
22
20
  **Microsoft Clarity API + MCP Server + A2A Agent**
23
21
 
24
22
  `clarity-api` is a typed, action-routed connector for the
@@ -9,7 +9,7 @@ import importlib
9
9
  import inspect
10
10
  from typing import Any
11
11
 
12
- from clarity_api.version import __author__, __credits__, __version__
12
+ from clarity_api.version import __author__, __credits__
13
13
 
14
14
  __all__: list[str] = ["__version__", "__author__", "__credits__"]
15
15
 
@@ -72,3 +72,20 @@ def __getattr__(name: str) -> Any:
72
72
 
73
73
  def __dir__() -> list[str]:
74
74
  return sorted(list(globals().keys()) + __all__)
75
+
76
+
77
+ from importlib.metadata import version as _v
78
+
79
+ from agent_connector_sdk.connector import Connector
80
+
81
+ from clarity_api.api_client import Api
82
+ from clarity_api.auth import get_client
83
+
84
+ __version__ = _v("clarity-api")
85
+
86
+ connector = Connector(
87
+ api=Api,
88
+ get_client=get_client,
89
+ tools="clarity_api.mcp_server",
90
+ instructions="Microsoft Clarity API MCP Server - Export dashboard data and live insights broken down by up to three dimensions.",
91
+ )
@@ -0,0 +1,4 @@
1
+ from agent_connector_sdk import run
2
+
3
+ if __name__ == "__main__":
4
+ run()
@@ -0,0 +1,86 @@
1
+ """Data sources of this connector, declared by tool name (generated by connector-ontology-map migrate).
2
+
3
+ Served live as ``connector://resources``. Regenerate by editing the declarations, not the tools.
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from __future__ import annotations
8
+
9
+ from agent_connector_sdk.ingest.live_declaration import source_meta
10
+
11
+ SOURCES = (
12
+ source_meta(
13
+ tool="clarity_get_data_export",
14
+ source_id="clarity-insights",
15
+ record_type="clarity-insight",
16
+ id_field="metricName",
17
+ preset={
18
+ "doc_type": "clarity-insight",
19
+ "params": {
20
+ "action": "get_data_export",
21
+ "params_json": '{"number_of_days": 3}',
22
+ },
23
+ },
24
+ records_path="data.data",
25
+ server="clarity-mcp",
26
+ text_field="metricName",
27
+ title_field="metricName",
28
+ ),
29
+ )
30
+
31
+ SCHEMA_VERSION = 2
32
+
33
+ FIELD_SETS = {
34
+ "fields_1": {
35
+ "dimensionName": "xsd:string",
36
+ "distinctUserCount": "xsd:integer",
37
+ "externalToolId": "xsd:string",
38
+ "metricName": "xsd:string",
39
+ "numOfDays": "xsd:integer",
40
+ "pagesPerSessionPercentage": "xsd:decimal",
41
+ "totalBotSessionCount": "xsd:integer",
42
+ "totalSessionCount": "xsd:integer",
43
+ },
44
+ }
45
+
46
+ SCHEMA_MAPPINGS = {
47
+ "BehaviorDimension": {
48
+ "field_sets": ["fields_1"],
49
+ "ontology_class": None,
50
+ },
51
+ "BehaviorInsight": {
52
+ "field_sets": ["fields_1"],
53
+ "ontology_class": "Insight",
54
+ },
55
+ "ClarityProject": {
56
+ "field_sets": ["fields_1"],
57
+ "ontology_class": "SoftwareProject",
58
+ },
59
+ "ClaritySession": {
60
+ "field_sets": ["fields_1"],
61
+ "ontology_class": None,
62
+ },
63
+ }
64
+
65
+ RESOURCES = (
66
+ {
67
+ "id_prefix": "behaviordimension",
68
+ "label": "Behavior Dimension",
69
+ "name": "BehaviorDimension",
70
+ },
71
+ {
72
+ "id_prefix": "behaviorinsight",
73
+ "label": "Behavior Insight",
74
+ "name": "BehaviorInsight",
75
+ },
76
+ {
77
+ "id_prefix": "clarityproject",
78
+ "label": "Clarity Project",
79
+ "name": "ClarityProject",
80
+ },
81
+ {
82
+ "id_prefix": "claritysession",
83
+ "label": "Clarity Session Snapshot",
84
+ "name": "ClaritySession",
85
+ },
86
+ )
@@ -13,17 +13,11 @@ from __future__ import annotations
13
13
  from typing import Any
14
14
 
15
15
  from agent_connector_sdk.ingest import (
16
- ChangeSet,
17
- Document,
18
- Entity,
19
- IngestBinding,
20
- IngestError,
21
16
  KnowledgeIngest,
22
- Relationship,
23
- current_ingest,
17
+ SourceStream,
24
18
  )
25
19
 
26
- _BINDING = IngestBinding(connector="clarity-mcp", stream="clarity")
20
+ STREAM = SourceStream.for_package(__package__.split(".")[0], "clarity")
27
21
 
28
22
  # Canonical dimension names Clarity segments metrics by (mirrors InputModel).
29
23
  _DIMENSIONS = (
@@ -39,76 +33,6 @@ _DIMENSIONS = (
39
33
  )
40
34
 
41
35
 
42
- def _to_entity(record: dict[str, Any]) -> Entity:
43
- return Entity(
44
- id=record["id"],
45
- node_type=record["node_type"],
46
- properties={k: v for k, v in record.items() if k not in ("id", "node_type")},
47
- )
48
-
49
-
50
- def _to_relationship(record: dict[str, Any]) -> Relationship:
51
- props = {
52
- k: v for k, v in record.items() if k not in ("source", "target", "relationship")
53
- }
54
- return Relationship(
55
- source=record["source"],
56
- target=record["target"],
57
- relationship=record["relationship"],
58
- properties=props or None,
59
- )
60
-
61
-
62
- def _to_document(record: dict[str, Any]) -> Document:
63
- return Document(
64
- id=record["id"],
65
- text=record["text"],
66
- title=record.get("title"),
67
- source_uri=record.get("source_uri"),
68
- properties={
69
- k: v
70
- for k, v in record.items()
71
- if k not in ("id", "text", "title", "source_uri")
72
- },
73
- )
74
-
75
-
76
- async def ingest_entities(
77
- entities: list[dict[str, Any]],
78
- relationships: list[dict[str, Any]] | None = None,
79
- *,
80
- ingest: KnowledgeIngest | None = None,
81
- ) -> dict[str, int]:
82
- """Write canonical typed nodes and relationships through the SDK's ingest facade."""
83
- if not entities:
84
- raise IngestError("ingest_entities needs at least one entity")
85
- change_set = ChangeSet(
86
- entities=tuple(_to_entity(e) for e in entities),
87
- relationships=tuple(_to_relationship(r) for r in relationships or ()),
88
- )
89
- service = ingest or current_ingest()
90
- receipt = await service.submit(_BINDING, change_set)
91
- return {"nodes": receipt.affected_count, "edges": receipt.relationship_count}
92
-
93
-
94
- async def ingest_documents(
95
- documents: list[dict[str, Any]],
96
- *,
97
- ingest: KnowledgeIngest | None = None,
98
- ) -> dict[str, int]:
99
- """Write text records as ``:Document`` nodes (semantic-search fodder).
100
-
101
- Each doc: ``{"id":..., "text":..., "title"?:..., "source_uri"?:..., ...props}``.
102
- Validation and SDK failures are surfaced as ``IngestError``.
103
- """
104
- if not documents:
105
- raise IngestError("ingest_documents needs at least one document")
106
- change_set = ChangeSet(documents=tuple(_to_document(d) for d in documents))
107
- service = ingest or current_ingest()
108
- receipt = await service.submit(_BINDING, change_set)
109
- return {"nodes": receipt.affected_count, "edges": receipt.relationship_count}
110
-
111
-
112
36
  # --- Clarity record -> typed-node mapping ----------------------------------
113
37
 
114
38
 
@@ -360,8 +284,8 @@ async def ingest_export(
360
284
  entities, relationships, documents = map_export(
361
285
  metrics, project=project, num_of_days=num_of_days, dimensions=dimensions
362
286
  )
363
- ent_res = await ingest_entities(entities, relationships, ingest=ingest)
364
- doc_res = await ingest_documents(documents, ingest=ingest)
287
+ ent_res = await STREAM.entities(entities, relationships, ingest=ingest)
288
+ doc_res = await STREAM.documents(documents, ingest=ingest)
365
289
  return {
366
290
  "nodes": ent_res.get("nodes", 0),
367
291
  "edges": ent_res.get("edges", 0),
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/python
2
+ import warnings
3
+
4
+ # Filter RequestsDependencyWarning early to prevent log spam
5
+ with warnings.catch_warnings():
6
+ warnings.simplefilter("ignore")
7
+ try:
8
+ from requests.exceptions import RequestsDependencyWarning
9
+
10
+ warnings.filterwarnings("ignore", category=RequestsDependencyWarning)
11
+ except ImportError:
12
+ pass
13
+
14
+ # General urllib3/chardet mismatch warnings
15
+ warnings.filterwarnings("ignore", message=".*urllib3.*or chardet.*")
16
+ warnings.filterwarnings("ignore", message=".*urllib3.*or charset_normalizer.*")
17
+
18
+
19
+ from clarity_api.mcp import register_insights_tools # noqa: F401
20
+
21
+ # SDK discovery registers the register_<tag>_tools functions bound in this module.
22
+ __all__ = ["register_insights_tools"]
@@ -1,14 +1,11 @@
1
1
  {
2
- "api_version": "arbora.io/v1",
2
+ "api_version": "graphos.io/v1",
3
3
  "artifacts": {
4
- "clarity_api/connectors/mcp_source_presets.json": "91e8680edf17e12a9cf7d684024178f132077516230208ba22a3e64acc8360cc",
5
- "clarity_api/connectors/tool_schema_fingerprints.json": "ab3d448dd855b658d77183dbd4bcbd3a17b08aed5c115f30e896c6a3a56c0ec9",
6
- "clarity_api/ontology/clarity.ttl": "b1c1d0acd7423f3d7399a8f6dfdd24e7bd5c0512468215bf14530664e7491358",
4
+ "clarity_api/ontology/clarity.ttl": "b8133fdae5338ea92b0c3f67bdd957a5abf196938522e0f7009204bc73aba9e2",
7
5
  "clarity_api/ontology/fixtures/records.json": "861e97db78862a7cf203da92e1e8e28a42ef8d831a9a79b0e1932f6fe26fe729",
8
- "clarity_api/ontology/mappings/source.yaml": "b4f4c4fe81e104a33a60f3e8501447974947146864e675a90771c30b99811db0",
6
+ "clarity_api/ontology/mappings/source.yaml": "cd0aa6276797ced63cd7832e689bc15e462907555fa0615a5169fd8eaf2cc87c",
9
7
  "clarity_api/ontology/migrations/manifest.json": "8e3ee220110378ab676abf0815fc33c21d415e23ffedd187713abd647ddac10b",
10
- "clarity_api/ontology/shapes/connector.shacl.ttl": "0ebc54aba872a0a757ea8ed70b5dda389206866fdb2b8e6875bbfe85b5c109c0",
11
- "connector_manifest.yml": "b7897427c061dbe5edff3a3657b8cbeb7c2b794f65259d0cecca43bd261d79e4"
8
+ "clarity_api/ontology/shapes/connector.shacl.ttl": "0ebc54aba872a0a757ea8ed70b5dda389206866fdb2b8e6875bbfe85b5c109c0"
12
9
  },
13
10
  "checks": {
14
11
  "declared_tool_schema": "passed",
@@ -18,11 +15,11 @@
18
15
  "synthetic_fixture_contract": "passed"
19
16
  },
20
17
  "compatibility": {
21
- "agent_connector_sdk": ">=2.5.0,<3",
18
+ "agent_utilities": ">=2.5.0,<3",
22
19
  "bundle_schema": "2",
23
20
  "epistemic_graph": ">=2.27.0,<3"
24
21
  },
25
- "connector": "clarity-mcp",
22
+ "connector": "clarity-api",
26
23
  "kind": "ConnectorSourceAttestation",
27
24
  "live_certified": false,
28
25
  "mode": "offline-source",
@@ -32,5 +29,5 @@
32
29
  "signer": "UNSIGNED-PREVIEW",
33
30
  "signing_public_key": "",
34
31
  "status": "source-validated",
35
- "validated_at": "2026-08-26T13:42:55Z"
32
+ "validated_at": "2026-10-24T09:36:38Z"
36
33
  }
@@ -117,5 +117,4 @@
117
117
  rdfs:comment """Microsoft Clarity behavioral-analytics model — projects, aggregate
118
118
  session-analytics snapshots, named metric insights, and their dimension breakdowns —
119
119
  federated into the agent-connector-sdk knowledge-graph hub. Reuses the shared :Document
120
- and :Person classes.""" ;
121
- owl:imports <http://knuckles.team/kg/enterprise> .
120
+ and :Person classes.""" .
@@ -1,5 +1,5 @@
1
1
  schema_version: '1'
2
- connector: clarity-api
2
+ connector: clarity-mcp
3
3
  ontology_source: clarity
4
4
  sync:
5
5
  - preset: clarity-insights
@@ -4,8 +4,6 @@
4
4
  "schema_version": "1.0",
5
5
  "prompt_version": "0.1.0",
6
6
  "source": "clarity-api",
7
- "extends": "agent-connector-sdk:base",
8
- "compose": "append",
9
7
  "description": "Microsoft Clarity behavioral-analytics specialist: export, interpret, and graph-ingest live insights over the clarity-api MCP server.",
10
8
  "metadata": {
11
9
  "topic": "Behavioral Web Analytics",
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python
2
2
 
3
- __version__ = "3.3.2"
4
3
  __author__ = "Project Maintainers"
5
4
  __credits__ = "Project Maintainers"
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clarity-api
3
- Version: 3.3.2
3
+ Version: 3.3.5
4
4
  Summary: Microsoft Clarity API + MCP Server + A2A Server
5
- Author-email: Project Maintainers <maintainers@users.noreply.github.com>
5
+ Author-email: Repository Maintainers <maintainers@knuckles.team>
6
6
  License: MIT
7
7
  Classifier: Development Status :: 5 - Production/Stable
8
8
  Classifier: License :: Public Domain
@@ -12,15 +12,11 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: <3.15,>=3.12
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18
15
+ Requires-Dist: agent-connector-sdk[mcp]<0.6.0,>=0.5.4
16
16
  Requires-Dist: requests>=2.34.2
17
17
  Requires-Dist: python-dotenv>=1.2.4
18
18
  Requires-Dist: pydantic[email]>=2.14.1
19
19
  Requires-Dist: urllib3>=2.8.0
20
- Provides-Extra: mcp
21
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.18; extra == "mcp"
22
- Provides-Extra: all
23
- Requires-Dist: clarity-api[mcp]>=2.0.1; extra == "all"
24
20
  Provides-Extra: test
25
21
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
26
22
  Requires-Dist: pytest>=9.1.1; extra == "test"
@@ -47,8 +43,6 @@ Dynamic: license-file
47
43
  ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/clarity-api)
48
44
  ![PyPI - Wheel](https://img.shields.io/pypi/wheel/clarity-api)
49
45
 
50
- *Version: 3.3.2*
51
-
52
46
  **Microsoft Clarity API + MCP Server + A2A Agent**
53
47
 
54
48
  `clarity-api` is a typed, action-routed connector for the
@@ -1,14 +1,13 @@
1
1
  LICENSE
2
- MANIFEST.in
3
2
  README.md
4
3
  pyproject.toml
5
- requirements.txt
6
4
  clarity_api/__init__.py
7
5
  clarity_api/__main__.py
8
6
  clarity_api/api_client.py
9
7
  clarity_api/auth.py
10
8
  clarity_api/clarity_api.py
11
9
  clarity_api/clarity_models.py
10
+ clarity_api/connector_sources.py
12
11
  clarity_api/decorators.py
13
12
  clarity_api/exceptions.py
14
13
  clarity_api/kg_ingest.py
@@ -25,9 +24,6 @@ clarity_api.egg-info/top_level.txt
25
24
  clarity_api/api/__init__.py
26
25
  clarity_api/api/api_client_base.py
27
26
  clarity_api/api/api_client_insights.py
28
- clarity_api/connectors/__init__.py
29
- clarity_api/connectors/mcp_source_presets.json
30
- clarity_api/connectors/tool_schema_fingerprints.json
31
27
  clarity_api/mcp/__init__.py
32
28
  clarity_api/mcp/mcp_insights.py
33
29
  clarity_api/ontology/__init__.py
@@ -37,11 +33,9 @@ clarity_api/ontology/fixtures/records.json
37
33
  clarity_api/ontology/mappings/source.yaml
38
34
  clarity_api/ontology/migrations/manifest.json
39
35
  clarity_api/ontology/shapes/connector.shacl.ttl
40
- clarity_api/prompts/__init__.py
41
36
  clarity_api/prompts/analytics_specialist.json
42
37
  clarity_api/services/__init__.py
43
38
  clarity_api/services/insights_service.py
44
- clarity_api/skills/__init__.py
45
39
  clarity_api/skills/clarity-analytics-ingestion/SKILL.md
46
40
  clarity_api/skills/clarity-analytics-ingestion/WORKFLOW.md
47
41
  clarity_api/skills/clarity-api-operations/SKILL.md
@@ -49,11 +43,8 @@ clarity_api/skills/clarity-api-operations/agents/openai.yaml
49
43
  clarity_api/skills/clarity-api-operations/references/catalog.md
50
44
  clarity_api/skills/clarity-behavioral-insights/SKILL.md
51
45
  clarity_api/skills/clarity-behavioral-insights/WORKFLOW.md
52
- scripts/security_sanitizer.py
53
- scripts/verify_api_integration.py
54
46
  tests/__init__.py
55
47
  tests/conftest.py
56
- tests/test_default_content_surfaces.py
57
48
  tests/test_fleet_name.py
58
49
  tests/test_kg_ingest.py
59
50
  tests/integration/__init__.py
@@ -66,5 +57,4 @@ tests/unit/test_clarity_models.py
66
57
  tests/unit/test_errors.py
67
58
  tests/unit/test_init_dynamics.py
68
59
  tests/unit/test_insights_service.py
69
- tests/unit/test_mcp_registration.py
70
- tests/unit/test_startup.py
60
+ tests/unit/test_mcp_registration.py
@@ -0,0 +1,8 @@
1
+ [agent_connector_sdk.connector]
2
+ clarity-mcp = clarity_api:connector
3
+
4
+ [agent_connector_sdk.prompt_providers]
5
+ clarity-api = clarity_api.prompts
6
+
7
+ [console_scripts]
8
+ clarity-mcp = agent_connector_sdk.cli:serve
@@ -1,15 +1,9 @@
1
- agent-connector-sdk[mcp]<1.0.0,>=0.3.18
1
+ agent-connector-sdk[mcp]<0.6.0,>=0.5.4
2
2
  requests>=2.34.2
3
3
  python-dotenv>=1.2.4
4
4
  pydantic[email]>=2.14.1
5
5
  urllib3>=2.8.0
6
6
 
7
- [all]
8
- clarity-api[mcp]>=2.0.1
9
-
10
- [mcp]
11
- agent-connector-sdk[mcp]<1.0.0,>=0.3.18
12
-
13
7
  [test]
14
8
  pytest-xdist>=3.8.0
15
9
  pytest>=9.1.1
@@ -4,6 +4,5 @@ dist
4
4
  dist-sdist
5
5
  docker
6
6
  docs
7
- scripts
8
7
  specs
9
8
  tests
@@ -4,43 +4,32 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "clarity-api"
7
- version = "3.3.2"
7
+ version = "3.3.5"
8
8
  description = "Microsoft Clarity API + MCP Server + A2A Server"
9
9
  readme = "README.md"
10
10
  classifiers = [ "Development Status :: 5 - Production/Stable", "License :: Public Domain", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3",]
11
11
  requires-python = ">=3.12, <3.15"
12
- dependencies = [ "agent-connector-sdk[mcp]>=0.3.18,<1.0.0", "requests>=2.34.2", "python-dotenv>=1.2.4", "pydantic[email]>=2.14.1", "urllib3>=2.8.0",]
12
+ dependencies = [ "agent-connector-sdk[mcp]>=0.5.4,<0.6.0", "requests>=2.34.2", "python-dotenv>=1.2.4", "pydantic[email]>=2.14.1", "urllib3>=2.8.0",]
13
13
  [[project.authors]]
14
- name = "Project Maintainers"
15
- email = "maintainers@users.noreply.github.com"
14
+ name = "Repository Maintainers"
15
+ email = "maintainers@knuckles.team"
16
16
 
17
17
  [project.license]
18
18
  text = "MIT"
19
19
 
20
20
  [project.optional-dependencies]
21
- mcp = [ "agent-connector-sdk[mcp]>=0.3.18,<1.0.0",]
22
- all = [ "clarity-api[mcp]>=2.0.1",]
23
21
  test = [
24
22
  "pytest-xdist>=3.8.0", "pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0",]
25
23
 
26
24
  [project.scripts]
27
- clarity-mcp = "clarity_api.mcp_server:mcp_server"
28
-
29
- [project.entry-points."agent_connector_sdk.skill_providers"]
30
- clarity-api = "clarity_api.skills"
31
-
32
- [project.entry-points."agent_connector_sdk.ontology_providers"]
33
- clarity-api = "clarity_api.ontology"
34
-
35
- [project.entry-points."agent_connector_sdk.source_connector_providers"]
36
- clarity-api = "clarity_api.connectors"
25
+ clarity-mcp = "agent_connector_sdk.cli:serve"
37
26
 
38
27
  [project.entry-points."agent_connector_sdk.prompt_providers"]
39
28
  clarity-api = "clarity_api.prompts"
40
29
 
41
30
  # The one declared connector identity: the fleet name (SDK-CONNECTOR-CONTROL-R071).
42
31
  [project.entry-points."agent_connector_sdk.connector"]
43
- clarity-mcp = "clarity_api"
32
+ clarity-mcp = "clarity_api:connector"
44
33
 
45
34
  [tool.uv.workspace]
46
35
  members = ["."]
@@ -54,6 +43,7 @@ override-dependencies = [
54
43
  ]
55
44
 
56
45
  [tool.ruff]
46
+ extend-exclude = ["tests", "scripts"]
57
47
  line-length = 88
58
48
  target-version = "py312"
59
49
 
@@ -82,3 +72,10 @@ ignore_names = ["request", "config", "cls", "__context", "model_post_init", "con
82
72
 
83
73
  [tool.pipelines_hooks.ste]
84
74
  exempt = ["specs/*", "specs/**/*"]
75
+
76
+ [tool.pipelines.container]
77
+ install_extras = {"mcp" = []}
78
+ env_file_optional = true
79
+
80
+ [tool.pipelines.api_integration]
81
+ baseline = 33.3
@@ -2,9 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from agent_connector_sdk.connector_identity import connector_name
5
6
  import ast
6
- import json
7
- import re
8
7
  import tomllib
9
8
  from pathlib import Path
10
9
 
@@ -36,18 +35,8 @@ def _call_connectors(path: Path) -> list[str]:
36
35
  def test_connector_name_is_the_fleet_name() -> None:
37
36
  pyproject = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
38
37
  assert pyproject["project"]["entry-points"]["agent_connector_sdk.connector"] == {
39
- FLEET: "clarity_api"
38
+ FLEET: "clarity_api:connector"
40
39
  }
41
- manifest_path = PACKAGE / "connector_manifest.yml"
42
- if not manifest_path.is_file():
43
- manifest_path = ROOT / "connector_manifest.yml"
44
- manifest = manifest_path.read_text(encoding="utf-8")
45
- match = re.search(r'^\s*"?connector"?\s*:\s*"?([^"\s,]+)', manifest, re.MULTILINE)
46
- assert match is not None and match.group(1) == FLEET
47
- fingerprints = PACKAGE / "connectors" / "tool_schema_fingerprints.json"
48
- if fingerprints.is_file():
49
- assert (
50
- json.loads(fingerprints.read_text(encoding="utf-8"))["connector"] == FLEET
51
- )
40
+ assert connector_name("clarity_api") == FLEET
52
41
  for module in sorted(PACKAGE.glob("*.py")):
53
42
  assert all(name == FLEET for name in _call_connectors(module)), module.name
@@ -18,8 +18,7 @@ import pytest
18
18
  from agent_connector_sdk.ingest import IngestError, KnowledgeIngest
19
19
 
20
20
  from clarity_api.kg_ingest import (
21
- ingest_documents,
22
- ingest_entities,
21
+ STREAM,
23
22
  ingest_export,
24
23
  ingest_response,
25
24
  map_export,
@@ -87,7 +86,7 @@ class _FakeResponse:
87
86
 
88
87
  async def test_ingest_entities_writes_nodes_and_edges(ingest):
89
88
  service, transport = ingest
90
- res = await ingest_entities(
89
+ res = await STREAM.entities(
91
90
  [
92
91
  {"id": "a", "node_type": "ClarityProject", "name": "p"},
93
92
  {"id": "b", "node_type": "ClaritySession"},
@@ -107,7 +106,7 @@ async def test_ingest_entities_writes_nodes_and_edges(ingest):
107
106
 
108
107
  async def test_ingest_documents_writes_document_nodes(ingest):
109
108
  service, transport = ingest
110
- res = await ingest_documents(
109
+ res = await STREAM.documents(
111
110
  [{"id": "clarity:doc:x", "text": "hello", "title": "T"}],
112
111
  ingest=service,
113
112
  )
@@ -193,4 +192,4 @@ async def test_ingest_response_materializes_empty_snapshot(ingest):
193
192
  async def test_ingest_empty_is_rejected(ingest):
194
193
  service, _transport = ingest
195
194
  with pytest.raises(IngestError, match="at least one entity"):
196
- await ingest_entities([], ingest=service)
195
+ await STREAM.entities([], ingest=service)
@@ -8,13 +8,6 @@ import pytest
8
8
  import clarity_api
9
9
 
10
10
 
11
- @pytest.mark.concept("CY-OS.governance.package-server-bootstrap")
12
- def test_concept_cla_005_version_exposed():
13
- """CLA-005: the package advertises a non-empty version string."""
14
- assert isinstance(clarity_api.__version__, str)
15
- assert clarity_api.__version__
16
-
17
-
18
11
  @pytest.mark.concept("CY-OS.governance.package-server-bootstrap")
19
12
  def test_concept_cla_005_core_members_exposed():
20
13
  """CLA-005: the eagerly-loaded ``Api`` member is exported."""
@@ -31,8 +31,8 @@ async def test_concept_cla_001_insights_tool_registers():
31
31
  @pytest.mark.concept("CLA-001")
32
32
  async def test_concept_cla_001_get_mcp_instance_builds():
33
33
  """CLA-001: the assembled MCP server exposes the data-export tool."""
34
- from clarity_api.mcp_server import get_mcp_instance
34
+ from agent_connector_sdk.connector import build_server
35
35
 
36
- mcp, args, middlewares, registered_tags = get_mcp_instance()
36
+ _, mcp = build_server("clarity_api", command_args=[])
37
37
  names = await _list_tool_names(mcp)
38
38
  assert "clarity_get_data_export" in names